Security News
tea.xyz Spam Plagues npm and RubyGems Package Registries
Tea.xyz, a crypto project aimed at rewarding open source contributions, is once again facing backlash due to an influx of spam packages flooding public package registries.
json-inspector
Advanced tools
Json Inspector is json data validator & sanitizer. It allows you to define validation rules for complex data structures by simple and descriptive way of defining json-compliant inspector schema.
Readme
Json Inspector is json data validator & sanitizer. It allows you to define validation rules for complex data structures by simple and descriptive way of defining json-compliant inspector schema.
npm install json-inspector
or
bower install json-inspector
... or you can browserify
your own bundle for a browser, see npm run-script build
in the package.json
inspector.define('user', {
username: {
$nullable: true,
$isAlphanumeric: 'en-US',
$hasLengthOf: {max: 32}
},
email: {
$required: true,
$isEmail: {allow_display_name: true}
},
address: {
street: {
$is: String
},
zip: {
$isInt: {min: 1}
}
},
apps: {
$forEach: {
name: {
$in: ['app1', 'app2']
}
}
}
});
The JsonInspector can't validate object's properties which have matching names with one of the schema definition keywords
(those data properties are removed by default). This intentional design decision limits universality of the library in exchange for improved schema
readability and simplicity (less code). The issue is partialy solved by the keyword prefix
feature which allows you to dynamically change a prefix string of keywords (which defaults to the $
character). In practice, you most probably won't ecnouter this limitation (if you were to, you would have known by now).
If this limitation is a deal breaker, consider trying out the ajv validation library.
npm run-script tests
NOTE: The most of the actual data validation is handed over to the chriso validation library.
FAQs
Json Inspector is json data validator & sanitizer. It allows you to define validation rules for complex data structures by simple and descriptive way of defining json-compliant inspector schema.
The npm package json-inspector receives a total of 2 weekly downloads. As such, json-inspector popularity was classified as not popular.
We found that json-inspector 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
Tea.xyz, a crypto project aimed at rewarding open source contributions, is once again facing backlash due to an influx of spam packages flooding public package registries.
Security News
As cyber threats become more autonomous, AI-powered defenses are crucial for businesses to stay ahead of attackers who can exploit software vulnerabilities at scale.
Security News
UnitedHealth Group disclosed that the ransomware attack on Change Healthcare compromised protected health information for millions in the U.S., with estimated costs to the company expected to reach $1 billion.