Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
371 changed files
with
21,321 additions
and
19,377 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
const jsConfig = require("@ajv-validator/config/.eslintrc_js") | ||
const tsConfig = require("@ajv-validator/config/.eslintrc") | ||
|
||
module.exports = { | ||
env: { | ||
es6: true, | ||
node: true, | ||
}, | ||
overrides: [ | ||
jsConfig, | ||
{ | ||
...tsConfig, | ||
files: ["*.ts"], | ||
rules: { | ||
...tsConfig.rules, | ||
complexity: ["error", 17], | ||
"@typescript-eslint/no-empty-function": "off", | ||
"@typescript-eslint/no-explicit-any": "off", | ||
"@typescript-eslint/no-floating-promises": "off", | ||
"@typescript-eslint/no-implied-eval": "off", | ||
"@typescript-eslint/no-invalid-this": "off", | ||
"@typescript-eslint/no-parameter-properties": "off", | ||
"@typescript-eslint/no-unnecessary-condition": "warn", | ||
"@typescript-eslint/no-unsafe-assignment": "off", | ||
"@typescript-eslint/no-unsafe-member-access": "off", | ||
"@typescript-eslint/restrict-template-expressions": "off", | ||
}, | ||
}, | ||
], | ||
} |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
spec/JSON-Schema-Test-Suite | ||
.browser | ||
coverage | ||
dist | ||
bundle | ||
.nyc_output | ||
spec/_json |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,20 +1,20 @@ | ||
var Ajv = require('ajv'); | ||
var ajv = new Ajv({allErrors: true}); | ||
var Ajv = require("ajv") | ||
var ajv = new Ajv({allErrors: true}) | ||
|
||
var schema = { | ||
"properties": { | ||
"foo": { "type": "string" }, | ||
"bar": { "type": "number", "maximum": 3 } | ||
} | ||
}; | ||
properties: { | ||
foo: {type: "string"}, | ||
bar: {type: "number", maximum: 3}, | ||
}, | ||
} | ||
|
||
var validate = ajv.compile(schema); | ||
var validate = ajv.compile(schema) | ||
|
||
test({"foo": "abc", "bar": 2}); | ||
test({"foo": 2, "bar": 4}); | ||
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)); | ||
} | ||
var valid = validate(data) | ||
if (valid) console.log("Valid!") | ||
else console.log("Invalid: " + ajv.errorsText(validate.errors)) | ||
} |
Oops, something went wrong.