@hyperjump/json-schema 0.23.1 → 0.23.3

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.
Files changed (40) hide show
  1. package/dist/json-schema-amd.js +495 -762
  2. package/dist/json-schema-amd.js.map +1 -1
  3. package/dist/json-schema-amd.min.js +1 -1
  4. package/dist/json-schema-amd.min.js.map +1 -1
  5. package/dist/json-schema-cjs.js +495 -762
  6. package/dist/json-schema-cjs.js.map +1 -1
  7. package/dist/json-schema-cjs.min.js +1 -1
  8. package/dist/json-schema-cjs.min.js.map +1 -1
  9. package/dist/json-schema-esm.js +495 -762
  10. package/dist/json-schema-esm.js.map +1 -1
  11. package/dist/json-schema-esm.min.js +1 -1
  12. package/dist/json-schema-esm.min.js.map +1 -1
  13. package/dist/json-schema-iife.js +495 -762
  14. package/dist/json-schema-iife.js.map +1 -1
  15. package/dist/json-schema-iife.min.js +1 -1
  16. package/dist/json-schema-iife.min.js.map +1 -1
  17. package/dist/json-schema-system.js +495 -762
  18. package/dist/json-schema-system.js.map +1 -1
  19. package/dist/json-schema-system.min.js +1 -1
  20. package/dist/json-schema-system.min.js.map +1 -1
  21. package/dist/json-schema-umd.js +495 -762
  22. package/dist/json-schema-umd.js.map +1 -1
  23. package/dist/json-schema-umd.min.js +1 -1
  24. package/dist/json-schema-umd.min.js.map +1 -1
  25. package/lib/common.d.ts +1 -0
  26. package/lib/draft-04.d.ts +3 -2
  27. package/lib/draft-06.d.ts +3 -2
  28. package/lib/draft-06.js +2 -2
  29. package/lib/draft-07.d.ts +3 -2
  30. package/lib/draft-07.js +2 -2
  31. package/lib/draft-2019-09.d.ts +3 -2
  32. package/lib/draft-2019-09.js +2 -2
  33. package/lib/draft-2020-12.d.ts +3 -2
  34. package/lib/draft-2020-12.js +2 -2
  35. package/lib/keywords/index.js +0 -2
  36. package/lib/keywords/maxLength.js +1 -1
  37. package/lib/keywords/minLength.js +1 -1
  38. package/package.json +1 -1
  39. package/lib/keywords/maxLength6.js +0 -7
  40. package/lib/keywords/minLength6.js +0 -7
@@ -0,0 +1 @@
1
+ export type JsonSchemaType = "object" | "array" | "string" | "number" | "integer" | "boolean" | "null";
package/lib/draft-04.d.ts CHANGED
@@ -1,4 +1,5 @@
1
- import type { Json, JsonType } from "@hyperjump/json-schema-core";
1
+ import type { Json } from "@hyperjump/json-schema-core";
2
+ import type { JsonSchemaType } from "./common";
2
3
 
3
4
 
4
5
  export type Draft04Schema = {
@@ -31,7 +32,7 @@ export type Draft04Schema = {
31
32
  patternProperties?: Record<string, Draft04Schema>;
32
33
  dependencies?: Record<string, Draft04Schema | string[]>;
33
34
  enum?: Json[];
34
- type?: JsonType | JsonType[];
35
+ type?: JsonSchemaType | JsonSchemaType[];
35
36
  format?: "date-time" | "email" | "hostname" | "ipv4" | "ipv6" | "uri";
36
37
  allOf?: Draft04Schema[];
37
38
  anyOf?: Draft04Schema[];
package/lib/draft-06.d.ts CHANGED
@@ -1,4 +1,5 @@
1
- import type { Json, JsonType } from "@hyperjump/json-schema-core";
1
+ import type { Json } from "@hyperjump/json-schema-core";
2
+ import type { JsonSchemaType } from "./common";
2
3
 
3
4
 
4
5
  export type Draft06Schema = boolean | {
@@ -35,7 +36,7 @@ export type Draft06Schema = boolean | {
35
36
  propertyNames?: Draft06Schema;
36
37
  const?: Json;
37
38
  enum?: Json[];
38
- type?: JsonType | JsonType[];
39
+ type?: JsonSchemaType | JsonSchemaType[];
39
40
  format?: "date-time" | "email" | "hostname" | "ipv4" | "ipv6" | "uri" | "uri-reference" | "uri-template" | "json-pointer";
40
41
  allOf?: Draft06Schema[];
41
42
  anyOf?: Draft06Schema[];
package/lib/draft-06.js CHANGED
@@ -30,11 +30,11 @@ Core.defineVocabulary(jsonSchemaVersion, {
30
30
  "format": keywords.metaData,
31
31
  "items": keywords.items,
32
32
  "maxItems": keywords.maxItems,
33
- "maxLength": keywords.maxLength6,
33
+ "maxLength": keywords.maxLength,
34
34
  "maxProperties": keywords.maxProperties,
35
35
  "maximum": keywords.maximum,
36
36
  "minItems": keywords.minItems,
37
- "minLength": keywords.minLength6,
37
+ "minLength": keywords.minLength,
38
38
  "minProperties": keywords.minProperties,
39
39
  "minimum": keywords.minimum,
40
40
  "multipleOf": keywords.multipleOf,
package/lib/draft-07.d.ts CHANGED
@@ -1,4 +1,5 @@
1
- import type { Json, JsonType } from "@hyperjump/json-schema-core";
1
+ import type { Json } from "@hyperjump/json-schema-core";
2
+ import type { JsonSchemaType } from "./common";
2
3
 
3
4
 
4
5
  export type Draft07Schema = boolean | {
@@ -38,7 +39,7 @@ export type Draft07Schema = boolean | {
38
39
  propertyNames?: Draft07Schema;
39
40
  const?: Json;
40
41
  enum?: Json[];
41
- type?: JsonType | JsonType[];
42
+ type?: JsonSchemaType | JsonSchemaType[];
42
43
  format?: "date-time" | "date" | "time" | "email" | "idn-email" | "hostname" | "idn-hostname" | "ipv4" | "ipv6" | "uri" | "uri-reference" | "iri" | "iri-reference" | "uri-template" | "json-pointer" | "relative-json-pointer" | "regex";
43
44
  contentMediaType?: string;
44
45
  contentEncoding?: string;
package/lib/draft-07.js CHANGED
@@ -32,11 +32,11 @@ Core.defineVocabulary(jsonSchemaVersion, {
32
32
  "else": keywords.else,
33
33
  "items": keywords.items,
34
34
  "maxItems": keywords.maxItems,
35
- "maxLength": keywords.maxLength6,
35
+ "maxLength": keywords.maxLength,
36
36
  "maxProperties": keywords.maxProperties,
37
37
  "maximum": keywords.maximum,
38
38
  "minItems": keywords.minItems,
39
- "minLength": keywords.minLength6,
39
+ "minLength": keywords.minLength,
40
40
  "minProperties": keywords.minProperties,
41
41
  "minimum": keywords.minimum,
42
42
  "multipleOf": keywords.multipleOf,
@@ -1,4 +1,5 @@
1
- import type { Json, JsonType } from "@hyperjump/json-schema-core";
1
+ import type { Json } from "@hyperjump/json-schema-core";
2
+ import type { JsonSchemaType } from "./common";
2
3
 
3
4
 
4
5
  export type Draft201909Schema = boolean | {
@@ -47,7 +48,7 @@ export type Draft201909Schema = boolean | {
47
48
  dependentRequired?: Record<string, string[]>;
48
49
  const?: Json;
49
50
  enum?: Json[];
50
- type?: JsonType | JsonType[];
51
+ type?: JsonSchemaType | JsonSchemaType[];
51
52
  title?: string;
52
53
  description?: string;
53
54
  default?: Json;
@@ -57,11 +57,11 @@ Core.defineVocabulary("https://json-schema.org/draft/2019-09/vocab/validation",
57
57
  "exclusiveMaximum": keywords.exclusiveMaximum,
58
58
  "exclusiveMinimum": keywords.exclusiveMinimum,
59
59
  "maxItems": keywords.maxItems,
60
- "maxLength": keywords.maxLength6,
60
+ "maxLength": keywords.maxLength,
61
61
  "maxProperties": keywords.maxProperties,
62
62
  "maximum": keywords.maximum,
63
63
  "minItems": keywords.minItems,
64
- "minLength": keywords.minLength6,
64
+ "minLength": keywords.minLength,
65
65
  "minProperties": keywords.minProperties,
66
66
  "minimum": keywords.minimum,
67
67
  "multipleOf": keywords.multipleOf,
@@ -1,4 +1,5 @@
1
- import type { Json, JsonType } from "@hyperjump/json-schema-core";
1
+ import type { Json } from "@hyperjump/json-schema-core";
2
+ import type { JsonSchemaType } from "./common";
2
3
 
3
4
 
4
5
  export type Draft202012Schema = boolean | {
@@ -48,7 +49,7 @@ export type Draft202012Schema = boolean | {
48
49
  dependentRequired?: Record<string, string[]>;
49
50
  const?: Json;
50
51
  enum?: Json[];
51
- type?: JsonType | JsonType[];
52
+ type?: JsonSchemaType | JsonSchemaType[];
52
53
  title?: string;
53
54
  description?: string;
54
55
  default?: Json;
@@ -57,11 +57,11 @@ Core.defineVocabulary("https://json-schema.org/draft/2020-12/vocab/validation",
57
57
  "exclusiveMaximum": keywords.exclusiveMaximum,
58
58
  "exclusiveMinimum": keywords.exclusiveMinimum,
59
59
  "maxItems": keywords.maxItems,
60
- "maxLength": keywords.maxLength6,
60
+ "maxLength": keywords.maxLength,
61
61
  "maxProperties": keywords.maxProperties,
62
62
  "maximum": keywords.maximum,
63
63
  "minItems": keywords.minItems,
64
- "minLength": keywords.minLength6,
64
+ "minLength": keywords.minLength,
65
65
  "minProperties": keywords.minProperties,
66
66
  "minimum": keywords.minimum,
67
67
  "multipleOf": keywords.multipleOf,
@@ -25,14 +25,12 @@ module.exports = {
25
25
  items202012: require("./items202012"),
26
26
  maxItems: require("./maxItems"),
27
27
  maxLength: require("./maxLength"),
28
- maxLength6: require("./maxLength6"),
29
28
  maxProperties: require("./maxProperties"),
30
29
  maximumExclusiveMaximum: require("./maximum-exclusiveMaximum"),
31
30
  maximum: require("./maximum"),
32
31
  metaData: Keywords.metaData,
33
32
  minItems: require("./minItems"),
34
33
  minLength: require("./minLength"),
35
- minLength6: require("./minLength6"),
36
34
  minProperties: require("./minProperties"),
37
35
  minimumExclusiveMinimum: require("./minimum-exclusiveMinimum"),
38
36
  minimum: require("./minimum"),
@@ -2,6 +2,6 @@ const { Schema, Instance } = require("@hyperjump/json-schema-core");
2
2
 
3
3
 
4
4
  const compile = (schema) => Schema.value(schema);
5
- const interpret = (maxLength, instance) => !Instance.typeOf(instance, "string") || Instance.length(instance) <= maxLength;
5
+ const interpret = (maxLength, instance) => !Instance.typeOf(instance, "string") || [...Instance.value(instance)].length <= maxLength;
6
6
 
7
7
  module.exports = { compile, interpret };
@@ -2,6 +2,6 @@ const { Schema, Instance } = require("@hyperjump/json-schema-core");
2
2
 
3
3
 
4
4
  const compile = (schema) => Schema.value(schema);
5
- const interpret = (minLength, instance) => !Instance.typeOf(instance, "string") || Instance.length(instance) >= minLength;
5
+ const interpret = (minLength, instance) => !Instance.typeOf(instance, "string") || [...Instance.value(instance)].length >= minLength;
6
6
 
7
7
  module.exports = { compile, interpret };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hyperjump/json-schema",
3
- "version": "0.23.1",
3
+ "version": "0.23.3",
4
4
  "description": "A JSON Schema Validator",
5
5
  "main": "lib/index.js",
6
6
  "exports": {
@@ -1,7 +0,0 @@
1
- const { Schema, Instance } = require("@hyperjump/json-schema-core");
2
-
3
-
4
- const compile = (schema) => Schema.value(schema);
5
- const interpret = (maxLength, instance) => !Instance.typeOf(instance, "string") || [...Instance.value(instance)].length <= maxLength;
6
-
7
- module.exports = { compile, interpret };
@@ -1,7 +0,0 @@
1
- const { Schema, Instance } = require("@hyperjump/json-schema-core");
2
-
3
-
4
- const compile = (schema) => Schema.value(schema);
5
- const interpret = (minLength, instance) => !Instance.typeOf(instance, "string") || [...Instance.value(instance)].length >= minLength;
6
-
7
- module.exports = { compile, interpret };