Submit
Path:
~
/
/
proc
/
self
/
root
/
usr
/
lib
/
node_modules
/
npm
/
node_modules
/
har-validator
/
node_modules
/
ajv
/
File Content:
.tonic_example.js
var Ajv = require('ajv'); var ajv = new Ajv({allErrors: true}); var schema = { "properties": { "foo": { "type": "string" }, "bar": { "type": "number", "maximum": 3 } } }; var validate = ajv.compile(schema); test({"foo": "abc", "bar": 2}); test({"foo": 2, "bar": 4}); function test(data) { var valid = validate(data); if (valid) console.log('Valid!'); else console.log('Invalid: ' + ajv.errorsText(validate.errors)); }
Submit
FILE
FOLDER
Name
Size
Permission
Action
dist
---
0755
lib
---
0755
scripts
---
0755
.tonic_example.js
439 bytes
0644
LICENSE
1090 bytes
0644
README.md
85598 bytes
0644
package.json
3936 bytes
0644
N4ST4R_ID | Naxtarrr