
Company News
Jerod Santo Joins Socket as Head of Media
Allow myself to introduce... myself.
json-filter2
Advanced tools
根据用户定义的数据结构过滤掉不需要的字段 例如,原始数据:
let obj = {
const obj = {
id: 1,
name: "wanglihui",
password: "test",
family: {
first: 1,
second: 'two'
},
birthday: new Date(),
// willNull: null,
};
现在只想返回, id 和family中的second,可以定义如下数据结构:
const destObj = {
id: 'number',
family: {
second: 'string'
}
}
最终拿到的结果是:
{
id: 1,
family: {
second: 'test'
}
}
npm install json-filter --save
数据结构定义
| 定义是类型 | javascript类型 |
|---|---|
| date | Date |
| boolean | boolean |
| number | number |
| string | string |
| ? | 允许此值为空,如 ?number |
其他当做对象处理
mocha
FAQs
filter unexport key and value
The npm package json-filter2 receives a total of 3 weekly downloads. As such, json-filter2 popularity was classified as not popular.
We found that json-filter2 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.

Company News
Allow myself to introduce... myself.

Research
/Security News
A Twitch browser extension on Chrome and Firefox forwards users’ live OAuth session tokens through proxies controlled by a Russian bot service.

Security News
Anthropic found biased reasoning and recklessness drove Claude Mythos 5 to publish malware on PyPI and compromise a security vendor.