-
-
Notifications
You must be signed in to change notification settings - Fork 864
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
184 changed files
with
10,319 additions
and
11,311 deletions.
There are no files selected for viewing
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,6 @@ | ||
spec/JSON-Schema-Test-Suite | ||
.browser | ||
coverage | ||
dist | ||
.nyc_output | ||
lib/dotjs |
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)) | ||
} |
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
Oops, something went wrong.