@hyperjump/json-schema 0.22.0 → 0.23.2

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/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.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,
@@ -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,
@@ -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.22.0",
3
+ "version": "0.23.2",
4
4
  "description": "A JSON Schema Validator",
5
5
  "main": "lib/index.js",
6
6
  "exports": {
@@ -13,7 +13,7 @@
13
13
  "test": "mocha --require ts-node/register 'lib/**/*.spec.ts'",
14
14
  "build": "rollup --config rollup.config.js",
15
15
  "prepublishOnly": "npm run build",
16
- "postinstall": "npx rimraf dist"
16
+ "postinstall": "node -e \"require('fs').rmSync('dist', { recursive: true })\""
17
17
  },
18
18
  "repository": "github:hyperjump-io/json-schema-validator",
19
19
  "keywords": [
@@ -53,7 +53,7 @@
53
53
  "typescript": "*"
54
54
  },
55
55
  "dependencies": {
56
- "@hyperjump/json-schema-core": "^0.27.0",
56
+ "@hyperjump/json-schema-core": "^0.28.0",
57
57
  "fastest-stable-stringify": "^2.0.2"
58
58
  }
59
59
  }
@@ -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 };