object-fields
Advanced tools
Comparing version 1.3.2 to 1.3.3
{ | ||
"name": "object-fields", | ||
"version": "1.3.2", | ||
"version": "1.3.3", | ||
"description": "Utility functions around object paths", | ||
@@ -5,0 +5,0 @@ "main": "lib/index.js", |
@@ -22,12 +22,16 @@ # object-fields | ||
```js | ||
const objectPaths = require('object-fields'); | ||
const objectFields = require('object-fields'); | ||
objectPaths.split('data(file1,file2)'); | ||
objectFields.split('data(file1,file2)'); | ||
// => ["data.file1", "data.file2"] | ||
objectPaths.join(['data', 'data']); | ||
objectFields.join(['data', 'data']); | ||
// => "data" | ||
objectPaths.join(['path.to.thing', 'path.to.other.thing']); | ||
objectFields.join(['path.to.thing', 'path.to.other.thing']); | ||
// => "path.to(thing,other.thing)" | ||
objectPaths.getParents(['child', 'parent.child', 'grandparent.parent.child']); | ||
objectFields.getParents(['child', 'parent.child', 'grandparent.parent.child']); | ||
// => ['parent', 'grandparent', 'grandparent.parent'] | ||
const data = [{ id: 1, name: 'one' }, { id: 2, name: 'two' }]; | ||
objectFields.retain(data, ['name']); // updates data in place | ||
// data => [{ name: 'one' }, { name: 'two' }] | ||
``` | ||
@@ -34,0 +38,0 @@ |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
14219
59