diff options
Diffstat (limited to 'sandbox/testAppNevena/Front/node_modules/ajv/.runkit_example.js')
-rw-r--r-- | sandbox/testAppNevena/Front/node_modules/ajv/.runkit_example.js | 23 |
1 files changed, 0 insertions, 23 deletions
diff --git a/sandbox/testAppNevena/Front/node_modules/ajv/.runkit_example.js b/sandbox/testAppNevena/Front/node_modules/ajv/.runkit_example.js deleted file mode 100644 index 0d578d5d..00000000 --- a/sandbox/testAppNevena/Front/node_modules/ajv/.runkit_example.js +++ /dev/null @@ -1,23 +0,0 @@ -const Ajv = require("ajv") -const ajv = new Ajv({allErrors: true}) - -const schema = { - type: "object", - properties: { - foo: {type: "string"}, - bar: {type: "number", maximum: 3}, - }, - required: ["foo", "bar"], - additionalProperties: false, -} - -const validate = ajv.compile(schema) - -test({foo: "abc", bar: 2}) -test({foo: 2, bar: 4}) - -function test(data) { - const valid = validate(data) - if (valid) console.log("Valid!") - else console.log("Invalid: " + ajv.errorsText(validate.errors)) -} |