
Security News
Risky Biz Podcast: Making Reachability Analysis Work in Real-World Codebases
This episode explores the hard problem of reachability analysis, from static analysis limits to handling dynamic languages and massive dependency trees.
easy-object-validator
Advanced tools
深度校验一个值是否合法
当前文档版本是2.x,API不兼容1.x版本,点击查看1.x文档
npm i -S easy-object-validator
# 构建
npm run build
# 单元测试
npm run test
import validator from 'easy-object-validator'
const obj = {
foo: 123,
bar: 'hello',
child: {
foo: true,
bar: [1, 2, 3, 4],
child: {
bar: null
}
}
};
validator(obj, {
foo: validator.test(/^\d+$/),
bar: validator.string.length(5),
child: {
foo: validator.boolean.isRequired,
bar: validator.array.length(4),
child: validator.shape({
bar: validator.isEmpty
})
}
})
// true
validator 的校验规则基于 Validate 类
用得不爽就造轮子😶,欢迎提issues或PR
2.0.1
2019.09.20
FAQs
The npm package easy-object-validator receives a total of 2 weekly downloads. As such, easy-object-validator popularity was classified as not popular.
We found that easy-object-validator 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
This episode explores the hard problem of reachability analysis, from static analysis limits to handling dynamic languages and massive dependency trees.
Security News
/Research
Malicious Nx npm versions stole secrets and wallet info using AI CLI tools; Socket’s AI scanner detected the supply chain attack and flagged the malware.
Security News
CISA’s 2025 draft SBOM guidance adds new fields like hashes, licenses, and tool metadata to make software inventories more actionable.