
Research
/Security News
Popular Go Decimal Library Targeted by Long-Running Typosquat with DNS Backdoor
A long-running Go typosquat impersonated the popular shopspring/decimal library and used DNS TXT records to execute commands.
super-deep-pick
Advanced tools
As you know lodash.pick, so this module like that but DEEEEEEEEEEEEEEEP.
As you know Facebook API or GraphQL. They developer can pick the fields they want to return
Example for Facebook:
https://graph.facebook.com/v3.1/me?access_token=ACCESS_TOKEN&fields=id,email,name,birthday,first_name,last_name,age_range,link,gender,locale,picture,timezone,updated_time,verified
So when you use this module, you can handle this very easy:
const deepPick = require('deepPick');
const data = 'Array or Object';
const fields = request.query.fields.split(',');
return deepPick(data, fields);
Because lodash.pick only work with level 1 of object, not pick deep like GraphQL
const deepPick = require('deepPick');
const data = {
id: 1,
title: 'Level 1',
level1: {
data1: [
{
level2: {
level3: {
id: 3,
title: 'Level 3',
data3: [
'foo',
'bar'
],
level4: {
id: 4,
title: 'Level 4',
data4: [
'foo2',
'bar2'
],
},
exclude: 'not return'
}
}
}
]
},
exclude: 'not return'
};
// User [] to easy understand data structure
const fields1 = [
'id',
'title',
'level1.data1[].level2.level3.id',
'level1.data1[].level2.level3.title',
'level1.data1[].level2.level3.data3[]',
'level1.data1[].level2.level3.level4.data4[]',
];
// not use [], but everything work
const fields2 = [
'id',
'title',
'level1.data1.level2.level3.id',
'level1.data1.level2.level3.title',
'level1.data1.level2.level3.data3',
'level1.data1.level2.level3.level4.data4',
];
console.log(JSON.stringify(deepPick(data, fields1), null, 2));
console.log(JSON.stringify(deepPick(data, fields2), null, 2));
{
"id": 1,
"title": "Level 1",
"level1": {
"data1": [
{
"level2": {
"level3": {
"id": 3,
"title": "Level 3",
"data3": [
"foo",
"bar"
],
"level4": {
"data4": [
"foo2",
"bar2"
]
}
}
}
}
]
}
}
git clone git@github.com:kimthangatm/deep-pick.git
cd deep-pick
npm run test
npm run test:coverage
# or
yarn test
FAQs
Deep pick object or array data as lodash pick but very deep
We found that super-deep-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.

Research
/Security News
A long-running Go typosquat impersonated the popular shopspring/decimal library and used DNS TXT records to execute commands.

Research
Active npm supply chain attack compromises @antv packages in a fast-moving malicious publish wave tied to Mini Shai-Hulud.

Security News
/Research
Socket detected malicious node-ipc versions with obfuscated stealer/backdoor behavior in a developing npm supply chain attack.