Gathering detailed insights and metrics for @zitterorg/consequuntur-doloremque-ducimus
Gathering detailed insights and metrics for @zitterorg/consequuntur-doloremque-ducimus
Gathering detailed insights and metrics for @zitterorg/consequuntur-doloremque-ducimus
Gathering detailed insights and metrics for @zitterorg/consequuntur-doloremque-ducimus
npm install @zitterorg/consequuntur-doloremque-ducimus
Typescript
Module System
Node Version
NPM Version
64.7
Supply Chain
83.1
Quality
85.9
Maintenance
100
Vulnerability
99.3
License
Cumulative downloads
Total Downloads
Last day
0%
1
Compared to previous day
Last week
0%
1
Compared to previous week
Last month
0%
5
Compared to previous month
Last year
0%
10
Compared to previous year
41
Available methods:
Install / Uninstall with npm:
1$ npm install @zitterorg/consequuntur-doloremque-ducimus
1$ npm uninstall @zitterorg/consequuntur-doloremque-ducimus
1$ npm run test
After tests running coverage report can be found in coverage directory
To perform ESlint check run following command:
1$ npm run eslint
To fix issues, found by ESLint run:
1$ npm run eslint-fix
Require package:
1// by using require 2const resolver = require('@zitterorg/consequuntur-doloremque-ducimus'); 3// by using import 4//import resolver from "@zitterorg/consequuntur-doloremque-ducimus"; 5// by using object destructor 6//const {cloneObject} = require('dist/object-resolver');
Compares two objects for deep equality
1const result = resolver.isEqual({ a: 1, b: { c: 2 } }, { a: 1, b: { c: 2 } }); 2const result = resolver.isEqual([1, 2, 3], [1, 2, 4]);
Filters the properties of an object based on a predicate function
1const filtered = resolver.filterObject({ a: 1, b: 2, c: 3, d: 4 }, (value, key) => value % 2 === 0);
Removes properties with undefined
values from an object
1const cleaned = resolver.removeUndefinedProperties({ a: 1, b: undefined, c: { d: 4, e: undefined } });
Checks if nested property exists, if not return default value
1const prop = resolver.hasNestedProperty(obj, 'innerObject.deepObject.value');
2const prop = resolver.hasNestedProperty(obj, 'innerObject.deepObject.value', 'defaultValue');
Get nested property exists and if not empty perform some action
1const prop = resolver.getNestedProperty(obj, 'innerObject.deepObject.value')
2if (prop) {
3 // ...
4}
Fetch last chained nested property
1const prop = resolver.fetchLastNestedProperty(obj, 'prop');
Set a deeply nested property in an object
1const prop = resolver.setNestedProperty(obj, 'user.profile.name', 'John Doe');
Delete a deeply nested property in an object
1const prop = resolver.deleteNestedProperty(obj, 'user.profile.name', 'John Doe');
Deep cloning of object
1const objCopy = resolver.cloneObject(obj);
Deep cloning of structure (node > v17)
1const structureCopy = resolver.cloneStructure(obj, options);
1const obj1 = { a: 1, b: { c: 2 } }; 2const obj2 = { a: 1, b: { c: 2 } }; 3const compareResult = resolver.isEqual(obj1, obj2);
1const original = { a: 1, b: 2, c: 3, d: 4 }; 2const filtered = resolver.filterObject(original, (value, key) => value % 2 === 0); 3console.log(filtered);
1const original = { a: 1, b: undefined, c: { d: 4, e: undefined } }; 2const cleaned = resolver.removeUndefinedProperties(original);
1const obj = {
2 innerObject: {
3 deepObject: {
4 value: 'Here I am'
5 }
6 }
7};
8
9console.log(resolver.hasNestedProperty(obj, 'innerObject.deepObject.value')); // true
10console.log(resolver.hasNestedProperty(obj, 'innerObject.deepObject.wrongValue')); // false
11console.log(resolver.getNestedProperty(obj, 'innerObject.deepObject.value')); // 'Here I am'
12console.log(resolver.getNestedProperty(obj, 'innerObject.deepObject.wrongValue')); // undefined
13console.log(resolver.getNestedProperty(obj, 'innerObject.deepObject.wrongValue.oneMore', 'Oh-h-h')); // 'Oh-h-h'
1const obj = { 2 innerObject: { 3 deepObject: [ 4 { name: 'John' }, 5 { name: 'Nick' }, 6 { name: 'Ron' } 7 ] 8 } 9}; 10 11console.log(resolver.hasNestedProperty(obj, 'innerObject.deepObject.0.name')); // true 12console.log(resolver.getNestedProperty(obj, 'innerObject.deepObject.1.name')); // 'Nick'
1const obj = { role: { role: { role: 'student' } }}; 2const role = resolver.fetchLastNestedProperty(obj, 'role');
1const obj = {'a':{'b':2}, 'c':3}; 2const objCopy = resolver.cloneObject(obj);
MIT
No vulnerabilities found.
No security vulnerabilities found.