
Security News
Axios Supply Chain Attack Reaches OpenAI macOS Signing Pipeline, Forces Certificate Rotation
OpenAI rotated macOS signing certificates after a malicious Axios package reached its CI pipeline in a broader software supply chain attack.
js-nested-pick
Advanced tools
Creates an object composed of the picked object properties from a nested object using a dot path, select specific fields based conditions with filter arrays with MongoDB queries
Can be used in js/ts projects in node/browser.
Support select number of fields from nested object with dot and object with query:
const pick = require('js-nested-pick');
const data = {
name: 'Dan',
age: 30,
}
const values = pick(data, ['name']) // {name: 'Dan'}
Simple select
['name', 'age']
Select name and age from object
Deep select with dot
['user.firstname']
Select user.name from inner object
Ommit fileds
['-password']
Select all fields except the password
Deep ommit fileds with dot
['-user.address']
Select all fields except the user address
Deep select/ ommit using object with path
['*', {path: 'user', select: ['-paasword']}]
Select all fields, but in the user object, remove the password field
Select field in root object base of query on the data - using sift (read sift docs to see the options)
[{when: {isPublic: true}, then: ['*'], otherwise: ['title']}]
When the data.isPublic equal to true then in the data.posts select all fields, otherwise select only the title (post can be object or array)
Select field in inner object or array base of query on the data - using sift (read sift docs to see the options)
[{path: 'post', when: {isPublic: true}, then: ['*'], otherwise: ['title']}]
When the data.isPublic equal to true then in the data.posts select all fields, otherwise select only the title (post can be object or array)
Select field in inner object or array base of query on the item data - using sift (read sift docs to see the options)
[{path: 'posts', where: {isPublic: true}, then: ['*'], otherwise: ['title']}]
When the post.isPublic equal to true then select all post fields, otherwise select only the title (post can be object or array)
Dependencies:
Test with jest
FAQs
Creates an object composed of the picked object properties from a nested object using a dot path, select specific fields based conditions with filter arrays with MongoDB queries
The npm package js-nested-pick receives a total of 9 weekly downloads. As such, js-nested-pick popularity was classified as not popular.
We found that js-nested-pick demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Security News
OpenAI rotated macOS signing certificates after a malicious Axios package reached its CI pipeline in a broader software supply chain attack.

Security News
Open source is under attack because of how much value it creates. It has been the foundation of every major software innovation for the last three decades. This is not the time to walk away from it.

Security News
Socket CEO Feross Aboukhadijeh breaks down how North Korea hijacked Axios and what it means for the future of software supply chain security.