mirror of
https://github.com/cachix/install-nix-action.git
synced 2025-06-08 18:04:29 +00:00
v7
This commit is contained in:
parent
033d472283
commit
49df04613e
6774 changed files with 1602535 additions and 1 deletions
20
node_modules/ajv/.tonic_example.js
generated
vendored
Normal file
20
node_modules/ajv/.tonic_example.js
generated
vendored
Normal file
|
@ -0,0 +1,20 @@
|
|||
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));
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue