@hyperjump/json-schema 0.19.0 → 0.22.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +39 -1
- package/dist/json-schema-amd.js +4218 -4378
- package/dist/json-schema-amd.js.map +1 -1
- package/dist/json-schema-amd.min.js +2 -3
- package/dist/json-schema-amd.min.js.map +1 -1
- package/dist/json-schema-cjs.js +2267 -2427
- package/dist/json-schema-cjs.js.map +1 -1
- package/dist/json-schema-cjs.min.js +2 -3
- package/dist/json-schema-cjs.min.js.map +1 -1
- package/dist/json-schema-esm.js +2268 -2415
- package/dist/json-schema-esm.js.map +1 -1
- package/dist/json-schema-esm.min.js +2 -3
- package/dist/json-schema-esm.min.js.map +1 -1
- package/dist/json-schema-iife.js +4222 -4382
- package/dist/json-schema-iife.js.map +1 -1
- package/dist/json-schema-iife.min.js +2 -3
- package/dist/json-schema-iife.min.js.map +1 -1
- package/dist/json-schema-system.js +4221 -4368
- package/dist/json-schema-system.js.map +1 -1
- package/dist/json-schema-system.min.js +2 -3
- package/dist/json-schema-system.min.js.map +1 -1
- package/dist/json-schema-umd.js +4221 -4381
- package/dist/json-schema-umd.js.map +1 -1
- package/dist/json-schema-umd.min.js +2 -3
- package/dist/json-schema-umd.min.js.map +1 -1
- package/lib/draft-04.js +6 -6
- package/lib/draft-06.js +6 -6
- package/lib/draft-07.js +6 -6
- package/lib/draft-2019-09.js +7 -7
- package/lib/draft-2020-12.js +7 -7
- package/lib/index.d.ts +2 -0
- package/lib/index.js +1 -0
- package/lib/index.mjs +1 -0
- package/package.json +19 -19
package/lib/draft-04.js
CHANGED
|
@@ -4,15 +4,15 @@ const metaSchema = require("../meta/draft-04/schema");
|
|
|
4
4
|
|
|
5
5
|
|
|
6
6
|
// JSON Schema Draft-04
|
|
7
|
-
const
|
|
7
|
+
const jsonSchemaVersion = "http://json-schema.org/draft-04/schema";
|
|
8
8
|
|
|
9
|
-
Schema.setConfig(
|
|
10
|
-
Schema.setConfig(
|
|
11
|
-
Schema.setConfig(
|
|
12
|
-
Schema.setConfig(
|
|
9
|
+
Schema.setConfig(jsonSchemaVersion, "baseToken", "id");
|
|
10
|
+
Schema.setConfig(jsonSchemaVersion, "embeddedToken", "id");
|
|
11
|
+
Schema.setConfig(jsonSchemaVersion, "anchorToken", "id");
|
|
12
|
+
Schema.setConfig(jsonSchemaVersion, "jrefToken", "$ref");
|
|
13
13
|
|
|
14
14
|
Schema.add(JSON.parse(metaSchema));
|
|
15
|
-
Core.defineVocabulary(
|
|
15
|
+
Core.defineVocabulary(jsonSchemaVersion, {
|
|
16
16
|
"validate": keywords.validate,
|
|
17
17
|
"additionalItems": keywords.additionalItems,
|
|
18
18
|
"additionalProperties": keywords.additionalProperties,
|
package/lib/draft-06.js
CHANGED
|
@@ -3,15 +3,15 @@ const keywords = require("./keywords");
|
|
|
3
3
|
const metaSchema = require("../meta/draft-06/schema");
|
|
4
4
|
|
|
5
5
|
|
|
6
|
-
const
|
|
6
|
+
const jsonSchemaVersion = "http://json-schema.org/draft-06/schema";
|
|
7
7
|
|
|
8
|
-
Schema.setConfig(
|
|
9
|
-
Schema.setConfig(
|
|
10
|
-
Schema.setConfig(
|
|
11
|
-
Schema.setConfig(
|
|
8
|
+
Schema.setConfig(jsonSchemaVersion, "baseToken", "$id");
|
|
9
|
+
Schema.setConfig(jsonSchemaVersion, "embeddedToken", "$id");
|
|
10
|
+
Schema.setConfig(jsonSchemaVersion, "anchorToken", "$id");
|
|
11
|
+
Schema.setConfig(jsonSchemaVersion, "jrefToken", "$ref");
|
|
12
12
|
|
|
13
13
|
Schema.add(JSON.parse(metaSchema));
|
|
14
|
-
Core.defineVocabulary(
|
|
14
|
+
Core.defineVocabulary(jsonSchemaVersion, {
|
|
15
15
|
"validate": keywords.validate,
|
|
16
16
|
"additionalItems": keywords.additionalItems6,
|
|
17
17
|
"additionalProperties": keywords.additionalProperties6,
|
package/lib/draft-07.js
CHANGED
|
@@ -3,15 +3,15 @@ const keywords = require("./keywords");
|
|
|
3
3
|
const metaSchema = require("../meta/draft-07/schema");
|
|
4
4
|
|
|
5
5
|
|
|
6
|
-
const
|
|
6
|
+
const jsonSchemaVersion = "http://json-schema.org/draft-07/schema";
|
|
7
7
|
|
|
8
|
-
Schema.setConfig(
|
|
9
|
-
Schema.setConfig(
|
|
10
|
-
Schema.setConfig(
|
|
11
|
-
Schema.setConfig(
|
|
8
|
+
Schema.setConfig(jsonSchemaVersion, "baseToken", "$id");
|
|
9
|
+
Schema.setConfig(jsonSchemaVersion, "embeddedToken", "$id");
|
|
10
|
+
Schema.setConfig(jsonSchemaVersion, "anchorToken", "$id");
|
|
11
|
+
Schema.setConfig(jsonSchemaVersion, "jrefToken", "$ref");
|
|
12
12
|
|
|
13
13
|
Schema.add(JSON.parse(metaSchema));
|
|
14
|
-
Core.defineVocabulary(
|
|
14
|
+
Core.defineVocabulary(jsonSchemaVersion, {
|
|
15
15
|
"validate": keywords.validate,
|
|
16
16
|
"additionalItems": keywords.additionalItems6,
|
|
17
17
|
"additionalProperties": keywords.additionalProperties6,
|
package/lib/draft-2019-09.js
CHANGED
|
@@ -9,14 +9,14 @@ const formatMetaSchema = require("../meta/draft/2019-09/meta/format");
|
|
|
9
9
|
const contentMetaSchema = require("../meta/draft/2019-09/meta/content");
|
|
10
10
|
|
|
11
11
|
|
|
12
|
-
const
|
|
12
|
+
const jsonSchemaVersion = "https://json-schema.org/draft/2019-09/vocab/core";
|
|
13
13
|
|
|
14
|
-
Schema.setConfig(
|
|
15
|
-
Schema.setConfig(
|
|
16
|
-
Schema.setConfig(
|
|
17
|
-
Schema.setConfig(
|
|
18
|
-
Schema.setConfig(
|
|
19
|
-
Schema.setConfig(
|
|
14
|
+
Schema.setConfig(jsonSchemaVersion, "baseToken", "$id");
|
|
15
|
+
Schema.setConfig(jsonSchemaVersion, "embeddedToken", "$id");
|
|
16
|
+
Schema.setConfig(jsonSchemaVersion, "anchorToken", "$anchor");
|
|
17
|
+
Schema.setConfig(jsonSchemaVersion, "recursiveAnchorToken", "$recursiveAnchor");
|
|
18
|
+
Schema.setConfig(jsonSchemaVersion, "vocabularyToken", "$vocabulary");
|
|
19
|
+
Schema.setConfig(jsonSchemaVersion, "mandatoryVocabularies", ["https://json-schema.org/draft/2019-09/vocab/core"]);
|
|
20
20
|
|
|
21
21
|
Schema.add(JSON.parse(metaSchema));
|
|
22
22
|
|
package/lib/draft-2020-12.js
CHANGED
|
@@ -11,14 +11,14 @@ const contentMetaSchema = require("../meta/draft/2020-12/meta/content");
|
|
|
11
11
|
const unevaluatedMetaSchema = require("../meta/draft/2020-12/meta/unevaluated");
|
|
12
12
|
|
|
13
13
|
|
|
14
|
-
const
|
|
14
|
+
const jsonSchemaVersion = "https://json-schema.org/draft/2020-12/vocab/core";
|
|
15
15
|
|
|
16
|
-
Schema.setConfig(
|
|
17
|
-
Schema.setConfig(
|
|
18
|
-
Schema.setConfig(
|
|
19
|
-
Schema.setConfig(
|
|
20
|
-
Schema.setConfig(
|
|
21
|
-
Schema.setConfig(
|
|
16
|
+
Schema.setConfig(jsonSchemaVersion, "baseToken", "$id");
|
|
17
|
+
Schema.setConfig(jsonSchemaVersion, "embeddedToken", "$id");
|
|
18
|
+
Schema.setConfig(jsonSchemaVersion, "anchorToken", "$anchor");
|
|
19
|
+
Schema.setConfig(jsonSchemaVersion, "dynamicAnchorToken", "$dynamicAnchor");
|
|
20
|
+
Schema.setConfig(jsonSchemaVersion, "vocabularyToken", "$vocabulary");
|
|
21
|
+
Schema.setConfig(jsonSchemaVersion, "mandatoryVocabularies", ["https://json-schema.org/draft/2020-12/vocab/core"]);
|
|
22
22
|
|
|
23
23
|
Schema.add(JSON.parse(metaSchema));
|
|
24
24
|
|
package/lib/index.d.ts
CHANGED
|
@@ -9,6 +9,7 @@ export type JsonSchema = {
|
|
|
9
9
|
interpret: typeof Core.interpret;
|
|
10
10
|
setMetaOutputFormat: typeof Core.setMetaOutputFormat;
|
|
11
11
|
setShouldMetaValidate: typeof Core.setShouldMetaValidate;
|
|
12
|
+
addMediaTypePlugin: typeof Core.addMediaTypePlugin;
|
|
12
13
|
FLAG: typeof Core.FLAG;
|
|
13
14
|
BASIC: typeof Core.BASIC;
|
|
14
15
|
DETAILED: typeof Core.DETAILED;
|
|
@@ -24,6 +25,7 @@ export const compile: JsonSchema["compile"];
|
|
|
24
25
|
export const interpret: JsonSchema["interpret"];
|
|
25
26
|
export const setMetaOutputFormat: JsonSchema["setMetaOutputFormat"];
|
|
26
27
|
export const setShouldMetaValidate: JsonSchema["setShouldMetaValidate"];
|
|
28
|
+
export const addMediaTypePlugin: JsonSchema["addMediaTypePlugin"];
|
|
27
29
|
export const FLAG: JsonSchema["FLAG"];
|
|
28
30
|
export const BASIC: JsonSchema["BASIC"];
|
|
29
31
|
export const DETAILED: JsonSchema["DETAILED"];
|
package/lib/index.js
CHANGED
|
@@ -16,6 +16,7 @@ module.exports = {
|
|
|
16
16
|
interpret: Core.interpret,
|
|
17
17
|
setMetaOutputFormat: Core.setMetaOutputFormat,
|
|
18
18
|
setShouldMetaValidate: Core.setShouldMetaValidate,
|
|
19
|
+
addMediaTypePlugin: Core.addMediaTypePlugin,
|
|
19
20
|
FLAG: Core.FLAG,
|
|
20
21
|
BASIC: Core.BASIC,
|
|
21
22
|
DETAILED: Core.DETAILED,
|
package/lib/index.mjs
CHANGED
|
@@ -8,6 +8,7 @@ export const compile = JsonSchema.compile;
|
|
|
8
8
|
export const interpret = JsonSchema.interpret;
|
|
9
9
|
export const setMetaOutputFormat = JsonSchema.setMetaOutputFormat;
|
|
10
10
|
export const setShouldMetaValidate = JsonSchema.setShouldMetaValidate;
|
|
11
|
+
export const addMediaTypePlugin = JsonSchema.addMediaTypePlugin;
|
|
11
12
|
export const FLAG = JsonSchema.FLAG;
|
|
12
13
|
export const BASIC = JsonSchema.BASIC;
|
|
13
14
|
export const DETAILED = JsonSchema.DETAILED;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@hyperjump/json-schema",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.22.0",
|
|
4
4
|
"description": "A JSON Schema Validator",
|
|
5
5
|
"main": "lib/index.js",
|
|
6
6
|
"exports": {
|
|
@@ -33,27 +33,27 @@
|
|
|
33
33
|
"url": "https://github.com/sponsors/jdesrosiers"
|
|
34
34
|
},
|
|
35
35
|
"devDependencies": {
|
|
36
|
-
"@rollup/plugin-commonjs": "
|
|
37
|
-
"@rollup/plugin-node-resolve": "
|
|
38
|
-
"@types/chai": "
|
|
39
|
-
"@types/mocha": "
|
|
40
|
-
"@typescript-eslint/eslint-plugin": "
|
|
41
|
-
"@typescript-eslint/parser": "
|
|
42
|
-
"chai": "
|
|
43
|
-
"eslint": "
|
|
44
|
-
"eslint-import-resolver-node": "
|
|
45
|
-
"eslint-import-resolver-typescript": "
|
|
46
|
-
"eslint-plugin-import": "
|
|
36
|
+
"@rollup/plugin-commonjs": "*",
|
|
37
|
+
"@rollup/plugin-node-resolve": "*",
|
|
38
|
+
"@types/chai": "*",
|
|
39
|
+
"@types/mocha": "*",
|
|
40
|
+
"@typescript-eslint/eslint-plugin": "*",
|
|
41
|
+
"@typescript-eslint/parser": "*",
|
|
42
|
+
"chai": "*",
|
|
43
|
+
"eslint": "*",
|
|
44
|
+
"eslint-import-resolver-node": "*",
|
|
45
|
+
"eslint-import-resolver-typescript": "*",
|
|
46
|
+
"eslint-plugin-import": "*",
|
|
47
47
|
"json-schema-test-suite": "github:json-schema-org/JSON-Schema-Test-Suite",
|
|
48
|
-
"mocha": "
|
|
49
|
-
"rimraf": "
|
|
50
|
-
"rollup": "
|
|
51
|
-
"rollup-plugin-terser": "
|
|
52
|
-
"ts-node": "
|
|
53
|
-
"typescript": "
|
|
48
|
+
"mocha": "*",
|
|
49
|
+
"rimraf": "*",
|
|
50
|
+
"rollup": "*",
|
|
51
|
+
"rollup-plugin-terser": "*",
|
|
52
|
+
"ts-node": "*",
|
|
53
|
+
"typescript": "*"
|
|
54
54
|
},
|
|
55
55
|
"dependencies": {
|
|
56
|
-
"@hyperjump/json-schema-core": "^0.
|
|
56
|
+
"@hyperjump/json-schema-core": "^0.27.0",
|
|
57
57
|
"fastest-stable-stringify": "^2.0.2"
|
|
58
58
|
}
|
|
59
59
|
}
|