-
-
Notifications
You must be signed in to change notification settings - Fork 867
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
11 changed files
with
148 additions
and
90 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,29 +1,32 @@ | ||
<template> | ||
<ClientOnly> | ||
<span> | ||
<a class="github-button" | ||
<a | ||
class="github-button" | ||
href="https://github.com/ajv-validator/ajv" | ||
data-show-count="true" | ||
data-size="large" | ||
aria-label="Star ajv-validator/ajv on GitHub" | ||
>Star</a> | ||
> | ||
Star | ||
</a> | ||
</span> | ||
</ClientOnly> | ||
</template> | ||
|
||
<script> | ||
export default { | ||
mounted() { | ||
let githubScript = document.createElement("script") | ||
githubScript.setAttribute("src", "https://buttons.github.io/buttons.js") | ||
document.head.appendChild(githubScript) | ||
} | ||
} | ||
export default { | ||
mounted() { | ||
let githubScript = document.createElement("script") | ||
githubScript.setAttribute("src", "https://buttons.github.io/buttons.js") | ||
document.head.appendChild(githubScript) | ||
}, | ||
} | ||
</script> | ||
|
||
<style scoped> | ||
span { | ||
vertical-align: -8px; | ||
padding-left: 20px; | ||
} | ||
span { | ||
vertical-align: -8px; | ||
padding-left: 20px; | ||
} | ||
</style> |
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 |
---|---|---|
|
@@ -6,7 +6,6 @@ | |
"types": "dist/ajv.d.ts", | ||
"files": [ | ||
"lib/", | ||
"docs/", | ||
"dist/", | ||
"scripts/", | ||
".tonic_example.js" | ||
|
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,27 @@ | ||
import type Ajv from "../.." | ||
import _Ajv from "../ajv_jtd" | ||
import * as assert from "assert" | ||
|
||
const PROP_COUNT = 10 | ||
|
||
describe("schema with many properties", () => { | ||
let ajv: Ajv | ||
const schema = {properties: {}} | ||
const data = {} | ||
const invalidData = {} | ||
|
||
before(() => { | ||
ajv = new _Ajv() | ||
for (let i = 0; i < PROP_COUNT; i++) { | ||
const prop = `prop${i}` | ||
schema.properties[prop] = {type: "uint16"} | ||
data[prop] = i | ||
invalidData[prop] = -i | ||
} | ||
}) | ||
|
||
it("should correctly compile reference to schema", () => { | ||
assert.strictEqual(ajv.validate(schema, data), true) | ||
assert.strictEqual(ajv.validate(schema, invalidData), false) | ||
}) | ||
}) |