
Research
Malicious npm Packages Impersonate Flashbots SDKs, Targeting Ethereum Wallet Credentials
Four npm packages disguised as cryptographic tools steal developer credentials and send them to attacker-controlled Telegram infrastructure.
jski validates a subset of json schema v4. Following features are missing or restricted:
options.definitions
or jski.object({...}).defintions({...})
npm install jski
var J = require('jski')();
var J = require('jski')();
var validator = J.object({
foo: J.number(),
bar: J.string().maxLength(255)
});
var errs = validator.validate({ foo: 11, bar: 'hello' });
var J = require('jski')();
var js = {
foo: { type: 'number' },
bar: { type: 'string', maxLength: 255 }
};
var validator = J.createValidator(js);
var errs = validator.validate({ foo: true, bar: 'hello' });
var J = require('jski')();
var json = J.object({ foo: J.string() }).toJSON();
J.boolean()
J.number().minimum(1).maximum(10).multipleOf()
J.integer()
- Same as numberJ.string().minLength(1).maxLength(10).pattern('[0-9]*').format('email')
J.array(J.number()).minItems(1).maxItems(10).uniqueItems(true).additionalItems(false)
J.array(J.number(), J.string(), J.boolean())
J.object({ foo: J.number() }).minProperties(1).maxProperties(10).required('foo', 'bar').additionalProperties(false)
J.enum(1, 2, 3)
J.any()
J.null()
J.allOf(schema1, schema2, schema3)
J.anyOf(schema1, schema2, schema3)
J.oneOf(schema1, schema2, schema3)
J.number().title('foo').description('bar').default(11)
validate(value, options)
returns an error array. When the value is valid, the array is empty.
var errors = J.number().maximum(127).validate(128)
Add Defintions:
J.object({...}).definitions({...})
var errors = J.object({...}).validate({...}, { definitions: {...} })
J.createValidator(Schema JSON)
J.object({ foo: j.string() }).toJSON()
J.createValue(J.number())
J.createValue({ type: 'number' })
J.object().validate(value, { definitions: defs, omitRefs: true })
definitions
- Dict where $refs are lookuped by nameomitRefs
- Do not validate $refsSimple way to reuse definitions without using an actual $ref
var validator = J
.mixin('foo', J.object({ bar: J.string() }))
.mixin('bar', J.object({ baz: J.number() }))
.object({
un: J.foo(),
dos: J.bar()
});
var J = require('jski)();
var v1 = J.object({ foo: J.string() });
assert(v1.context === J);
Error messages look like:
{ message: "Value is too long", code: "maxLength", path: "foo.bar[0].baz" }
FAQs
json schema validator
The npm package jski receives a total of 464 weekly downloads. As such, jski popularity was classified as not popular.
We found that jski 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
Four npm packages disguised as cryptographic tools steal developer credentials and send them to attacker-controlled Telegram infrastructure.
Security News
Ruby maintainers from Bundler and rbenv teams are building rv to bring Python uv's speed and unified tooling approach to Ruby development.
Security News
Following last week’s supply chain attack, Nx published findings on the GitHub Actions exploit and moved npm publishing to Trusted Publishers.