Socket
Socket
Sign inDemoInstall

object-fields

Package Overview
Dependencies
Maintainers
1
Versions
57
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

object-fields - npm Package Compare versions

Comparing version 1.3.2 to 1.3.3

2

package.json
{
"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 @@

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc