@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/README.md +9 -5
- package/dist/json-schema-amd.js +348 -285
- package/dist/json-schema-amd.js.map +1 -1
- package/dist/json-schema-amd.min.js +2 -2
- package/dist/json-schema-amd.min.js.map +1 -1
- package/dist/json-schema-cjs.js +348 -285
- package/dist/json-schema-cjs.js.map +1 -1
- package/dist/json-schema-cjs.min.js +2 -2
- package/dist/json-schema-cjs.min.js.map +1 -1
- package/dist/json-schema-esm.js +348 -285
- package/dist/json-schema-esm.js.map +1 -1
- package/dist/json-schema-esm.min.js +2 -2
- package/dist/json-schema-esm.min.js.map +1 -1
- package/dist/json-schema-iife.js +348 -285
- package/dist/json-schema-iife.js.map +1 -1
- package/dist/json-schema-iife.min.js +2 -2
- package/dist/json-schema-iife.min.js.map +1 -1
- package/dist/json-schema-system.js +348 -285
- package/dist/json-schema-system.js.map +1 -1
- package/dist/json-schema-system.min.js +2 -2
- package/dist/json-schema-system.min.js.map +1 -1
- package/dist/json-schema-umd.js +348 -285
- package/dist/json-schema-umd.js.map +1 -1
- package/dist/json-schema-umd.min.js +1 -1
- package/dist/json-schema-umd.min.js.map +1 -1
- package/lib/draft-06.js +2 -2
- package/lib/draft-07.js +2 -2
- package/lib/draft-2019-09.js +2 -2
- package/lib/draft-2020-12.js +2 -2
- package/lib/keywords/index.js +0 -2
- package/lib/keywords/maxLength.js +1 -1
- package/lib/keywords/minLength.js +1 -1
- package/package.json +3 -3
- package/lib/keywords/maxLength6.js +0 -7
- package/lib/keywords/minLength6.js +0 -7
package/dist/json-schema-amd.js
CHANGED
|
@@ -2,7 +2,7 @@ define(['exports'], (function (exports) { 'use strict';
|
|
|
2
2
|
|
|
3
3
|
var commonjsGlobal = typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {};
|
|
4
4
|
|
|
5
|
-
var justCurryIt = curry$
|
|
5
|
+
var justCurryIt$1 = curry$b;
|
|
6
6
|
|
|
7
7
|
/*
|
|
8
8
|
function add(a, b, c) {
|
|
@@ -27,7 +27,7 @@ define(['exports'], (function (exports) { 'use strict';
|
|
|
27
27
|
milesToKm(10); // 16.2
|
|
28
28
|
*/
|
|
29
29
|
|
|
30
|
-
function curry$
|
|
30
|
+
function curry$b(fn, arity) {
|
|
31
31
|
return function curried() {
|
|
32
32
|
if (arity == null) {
|
|
33
33
|
arity = fn.length;
|
|
@@ -1898,12 +1898,12 @@ define(['exports'], (function (exports) { 'use strict';
|
|
|
1898
1898
|
|
|
1899
1899
|
var common$1 = { jsonTypeOf: jsonTypeOf$2, resolveUrl: resolveUrl$3, urlFragment: urlFragment$1, pathRelative: pathRelative$1 };
|
|
1900
1900
|
|
|
1901
|
-
const curry$
|
|
1901
|
+
const curry$a = justCurryIt$1;
|
|
1902
1902
|
|
|
1903
1903
|
|
|
1904
1904
|
const nil$2 = "";
|
|
1905
1905
|
|
|
1906
|
-
const compile$
|
|
1906
|
+
const compile$N = (pointer) => {
|
|
1907
1907
|
if (pointer.length > 0 && pointer[0] !== "/") {
|
|
1908
1908
|
throw Error("Invalid JSON Pointer");
|
|
1909
1909
|
}
|
|
@@ -1911,8 +1911,8 @@ define(['exports'], (function (exports) { 'use strict';
|
|
|
1911
1911
|
return pointer.split("/").slice(1).map(unescape);
|
|
1912
1912
|
};
|
|
1913
1913
|
|
|
1914
|
-
const get$
|
|
1915
|
-
const ptr = compile$
|
|
1914
|
+
const get$2 = (pointer, value = undefined) => {
|
|
1915
|
+
const ptr = compile$N(pointer);
|
|
1916
1916
|
|
|
1917
1917
|
const fn = (value) => ptr.reduce(([value, pointer], segment) => {
|
|
1918
1918
|
return [applySegment(value, segment, pointer), append(segment, pointer)];
|
|
@@ -1922,8 +1922,8 @@ define(['exports'], (function (exports) { 'use strict';
|
|
|
1922
1922
|
};
|
|
1923
1923
|
|
|
1924
1924
|
const set = (pointer, subject = undefined, value = undefined) => {
|
|
1925
|
-
const ptr = compile$
|
|
1926
|
-
const fn = curry$
|
|
1925
|
+
const ptr = compile$N(pointer);
|
|
1926
|
+
const fn = curry$a((subject, value) => _set(ptr, subject, value, nil$2));
|
|
1927
1927
|
return subject === undefined ? fn : fn(subject, value);
|
|
1928
1928
|
};
|
|
1929
1929
|
|
|
@@ -1931,8 +1931,15 @@ define(['exports'], (function (exports) { 'use strict';
|
|
|
1931
1931
|
if (pointer.length === 0) {
|
|
1932
1932
|
return value;
|
|
1933
1933
|
} else if (pointer.length > 1) {
|
|
1934
|
-
|
|
1935
|
-
|
|
1934
|
+
if (Array.isArray(subject)) {
|
|
1935
|
+
const index = pointer.shift();
|
|
1936
|
+
const clonedSubject = [...subject];
|
|
1937
|
+
clonedSubject[index] = _set(pointer, applySegment(subject, index, cursor), value, append(index, cursor));
|
|
1938
|
+
return clonedSubject;
|
|
1939
|
+
} else {
|
|
1940
|
+
const segment = pointer.shift();
|
|
1941
|
+
return { ...subject, [segment]: _set(pointer, applySegment(subject, segment, cursor), value, append(segment, cursor)) };
|
|
1942
|
+
}
|
|
1936
1943
|
} else if (Array.isArray(subject)) {
|
|
1937
1944
|
const clonedSubject = [...subject];
|
|
1938
1945
|
const segment = computeSegment(subject, pointer[0]);
|
|
@@ -1946,8 +1953,8 @@ define(['exports'], (function (exports) { 'use strict';
|
|
|
1946
1953
|
};
|
|
1947
1954
|
|
|
1948
1955
|
const assign = (pointer, subject = undefined, value = undefined) => {
|
|
1949
|
-
const ptr = compile$
|
|
1950
|
-
const fn = curry$
|
|
1956
|
+
const ptr = compile$N(pointer);
|
|
1957
|
+
const fn = curry$a((subject, value) => _assign(ptr, subject, value, nil$2));
|
|
1951
1958
|
return subject === undefined ? fn : fn(subject, value);
|
|
1952
1959
|
};
|
|
1953
1960
|
|
|
@@ -1964,7 +1971,7 @@ define(['exports'], (function (exports) { 'use strict';
|
|
|
1964
1971
|
};
|
|
1965
1972
|
|
|
1966
1973
|
const unset = (pointer, subject = undefined) => {
|
|
1967
|
-
const ptr = compile$
|
|
1974
|
+
const ptr = compile$N(pointer);
|
|
1968
1975
|
const fn = (subject) => _unset(ptr, subject, nil$2);
|
|
1969
1976
|
return subject === undefined ? fn : fn(subject);
|
|
1970
1977
|
};
|
|
@@ -1988,7 +1995,7 @@ define(['exports'], (function (exports) { 'use strict';
|
|
|
1988
1995
|
};
|
|
1989
1996
|
|
|
1990
1997
|
const remove = (pointer, subject = undefined) => {
|
|
1991
|
-
const ptr = compile$
|
|
1998
|
+
const ptr = compile$N(pointer);
|
|
1992
1999
|
const fn = (subject) => _remove(ptr, subject, nil$2);
|
|
1993
2000
|
return subject === undefined ? fn : fn(subject);
|
|
1994
2001
|
};
|
|
@@ -2009,7 +2016,7 @@ define(['exports'], (function (exports) { 'use strict';
|
|
|
2009
2016
|
}
|
|
2010
2017
|
};
|
|
2011
2018
|
|
|
2012
|
-
const append = curry$
|
|
2019
|
+
const append = curry$a((segment, pointer) => pointer + "/" + escape(segment));
|
|
2013
2020
|
|
|
2014
2021
|
const escape = (segment) => segment.toString().replace(/~/g, "~0").replace(/\//g, "~1");
|
|
2015
2022
|
const unescape = (segment) => segment.toString().replace(/~1/g, "/").replace(/~0/g, "~");
|
|
@@ -2030,7 +2037,7 @@ define(['exports'], (function (exports) { 'use strict';
|
|
|
2030
2037
|
|
|
2031
2038
|
const isScalar = (value) => value === null || typeof value !== "object";
|
|
2032
2039
|
|
|
2033
|
-
var lib$3 = { nil: nil$2, append, get: get$
|
|
2040
|
+
var lib$3 = { nil: nil$2, append, get: get$2, set, assign, unset, remove };
|
|
2034
2041
|
|
|
2035
2042
|
const $__value = Symbol("$__value");
|
|
2036
2043
|
const $__href = Symbol("$__href");
|
|
@@ -2047,17 +2054,26 @@ define(['exports'], (function (exports) { 'use strict';
|
|
|
2047
2054
|
var reference = { cons: cons$1, isReference, href, value: value$2 };
|
|
2048
2055
|
|
|
2049
2056
|
const JsonPointer$1 = lib$3;
|
|
2050
|
-
const curry$
|
|
2057
|
+
const curry$9 = justCurryIt$1;
|
|
2051
2058
|
const { resolveUrl: resolveUrl$2, jsonTypeOf: jsonTypeOf$1 } = common$1;
|
|
2052
2059
|
const Reference$2 = reference;
|
|
2053
2060
|
|
|
2054
2061
|
|
|
2055
2062
|
const nil$1 = Object.freeze({ id: "", pointer: "", instance: undefined, value: undefined });
|
|
2056
2063
|
const cons = (instance, id = "") => Object.freeze({ ...nil$1, id: resolveUrl$2(id, ""), instance, value: instance });
|
|
2064
|
+
|
|
2065
|
+
const get$1 = (url, instance = nil$1) => {
|
|
2066
|
+
if (!url.startsWith("#")) {
|
|
2067
|
+
throw Error(`No JSON document found at '${url.split("#")[0]}'`);
|
|
2068
|
+
}
|
|
2069
|
+
|
|
2070
|
+
return Object.freeze({ ...instance, pointer: url.substr(1) });
|
|
2071
|
+
};
|
|
2072
|
+
|
|
2057
2073
|
const uri$1 = (doc) => `${doc.id}#${encodeURI(doc.pointer)}`;
|
|
2058
2074
|
const value$1 = (doc) => Reference$2.isReference(doc.value) ? Reference$2.value(doc.value) : doc.value;
|
|
2059
2075
|
const has$1 = (key, doc) => key in value$1(doc);
|
|
2060
|
-
const typeOf$1 = curry$
|
|
2076
|
+
const typeOf$1 = curry$9((doc, type) => jsonTypeOf$1(value$1(doc), type));
|
|
2061
2077
|
|
|
2062
2078
|
const step$1 = (key, doc) => Object.freeze({
|
|
2063
2079
|
...doc,
|
|
@@ -2070,28 +2086,75 @@ define(['exports'], (function (exports) { 'use strict';
|
|
|
2070
2086
|
|
|
2071
2087
|
const keys$1 = (doc) => Object.keys(value$1(doc));
|
|
2072
2088
|
|
|
2073
|
-
const map$4 = curry$
|
|
2089
|
+
const map$4 = curry$9((fn, doc) => value$1(doc)
|
|
2074
2090
|
.map((item, ndx, array, thisArg) => fn(step$1(ndx, doc), ndx, array, thisArg)));
|
|
2075
2091
|
|
|
2076
|
-
const
|
|
2092
|
+
const forEach = curry$9((fn, doc) => value$1(doc)
|
|
2093
|
+
.forEach((item, ndx, array, thisArg) => fn(step$1(ndx, doc), ndx, array, thisArg)));
|
|
2094
|
+
|
|
2095
|
+
const filter$1 = curry$9((fn, doc) => value$1(doc)
|
|
2077
2096
|
.map((item, ndx, array, thisArg) => step$1(ndx, doc))
|
|
2078
2097
|
.filter((item, ndx, array, thisArg) => fn(item, ndx, array, thisArg)));
|
|
2079
2098
|
|
|
2080
|
-
const reduce$3 = curry$
|
|
2099
|
+
const reduce$3 = curry$9((fn, acc, doc) => value$1(doc)
|
|
2081
2100
|
.reduce((acc, item, ndx) => fn(acc, step$1(ndx, doc), ndx), acc));
|
|
2082
2101
|
|
|
2083
|
-
const every$1 = curry$
|
|
2102
|
+
const every$1 = curry$9((fn, doc) => value$1(doc)
|
|
2084
2103
|
.every((item, ndx, array, thisArg) => fn(step$1(ndx, doc), ndx, array, thisArg)));
|
|
2085
2104
|
|
|
2086
|
-
const some$1 = curry$
|
|
2105
|
+
const some$1 = curry$9((fn, doc) => value$1(doc)
|
|
2087
2106
|
.some((item, ndx, array, thisArg) => fn(step$1(ndx, doc), ndx, array, thisArg)));
|
|
2088
2107
|
|
|
2089
2108
|
const length$1 = (doc) => value$1(doc).length;
|
|
2090
2109
|
|
|
2091
|
-
var instance = {
|
|
2110
|
+
var instance = {
|
|
2111
|
+
nil: nil$1, cons, get: get$1, uri: uri$1, value: value$1, has: has$1, typeOf: typeOf$1, length: length$1,
|
|
2112
|
+
step: step$1, entries: entries$3, keys: keys$1, map: map$4, forEach, filter: filter$1, reduce: reduce$3, every: every$1, some: some$1
|
|
2113
|
+
};
|
|
2092
2114
|
|
|
2093
2115
|
var entries$2 = async (doc) => Object.entries(await doc);
|
|
2094
2116
|
|
|
2117
|
+
var justCurryIt = curry$8;
|
|
2118
|
+
|
|
2119
|
+
/*
|
|
2120
|
+
function add(a, b, c) {
|
|
2121
|
+
return a + b + c;
|
|
2122
|
+
}
|
|
2123
|
+
curry(add)(1)(2)(3); // 6
|
|
2124
|
+
curry(add)(1)(2)(2); // 5
|
|
2125
|
+
curry(add)(2)(4, 3); // 9
|
|
2126
|
+
|
|
2127
|
+
function add(...args) {
|
|
2128
|
+
return args.reduce((sum, n) => sum + n, 0)
|
|
2129
|
+
}
|
|
2130
|
+
var curryAdd4 = curry(add, 4)
|
|
2131
|
+
curryAdd4(1)(2, 3)(4); // 10
|
|
2132
|
+
|
|
2133
|
+
function converter(ratio, input) {
|
|
2134
|
+
return (input*ratio).toFixed(1);
|
|
2135
|
+
}
|
|
2136
|
+
const curriedConverter = curry(converter)
|
|
2137
|
+
const milesToKm = curriedConverter(1.62);
|
|
2138
|
+
milesToKm(35); // 56.7
|
|
2139
|
+
milesToKm(10); // 16.2
|
|
2140
|
+
*/
|
|
2141
|
+
|
|
2142
|
+
function curry$8(fn, arity) {
|
|
2143
|
+
return function curried() {
|
|
2144
|
+
if (arity == null) {
|
|
2145
|
+
arity = fn.length;
|
|
2146
|
+
}
|
|
2147
|
+
var args = [].slice.call(arguments);
|
|
2148
|
+
if (args.length >= arity) {
|
|
2149
|
+
return fn.apply(this, args);
|
|
2150
|
+
} else {
|
|
2151
|
+
return function() {
|
|
2152
|
+
return curried.apply(this, args.concat([].slice.call(arguments)));
|
|
2153
|
+
};
|
|
2154
|
+
}
|
|
2155
|
+
};
|
|
2156
|
+
}
|
|
2157
|
+
|
|
2095
2158
|
const curry$7 = justCurryIt;
|
|
2096
2159
|
|
|
2097
2160
|
|
|
@@ -2405,11 +2468,11 @@ define(['exports'], (function (exports) { 'use strict';
|
|
|
2405
2468
|
};
|
|
2406
2469
|
|
|
2407
2470
|
const parse = (response) => {
|
|
2408
|
-
const contentType = contentTypeParser.parse(response.headers.get("content-type"))
|
|
2409
|
-
if (!(contentType in mediaTypePlugins)) {
|
|
2410
|
-
throw Error(`${response.url} is not a schema. Found a document with media type: ${contentType}`);
|
|
2471
|
+
const contentType = contentTypeParser.parse(response.headers.get("content-type"));
|
|
2472
|
+
if (!(contentType.type in mediaTypePlugins)) {
|
|
2473
|
+
throw Error(`${response.url} is not a schema. Found a document with media type: ${contentType.type}`);
|
|
2411
2474
|
}
|
|
2412
|
-
return mediaTypePlugins[contentType].parse(response);
|
|
2475
|
+
return mediaTypePlugins[contentType.type].parse(response, contentType.parameters);
|
|
2413
2476
|
};
|
|
2414
2477
|
|
|
2415
2478
|
const getContentType = (path) => {
|
|
@@ -2424,7 +2487,7 @@ define(['exports'], (function (exports) { 'use strict';
|
|
|
2424
2487
|
|
|
2425
2488
|
var mediaTypes = { addPlugin, parse, getContentType };
|
|
2426
2489
|
|
|
2427
|
-
const curry$1 = justCurryIt;
|
|
2490
|
+
const curry$1 = justCurryIt$1;
|
|
2428
2491
|
const Pact$a = lib$2;
|
|
2429
2492
|
const JsonPointer = lib$3;
|
|
2430
2493
|
const { jsonTypeOf, resolveUrl: resolveUrl$1, urlFragment, pathRelative } = common$1;
|
|
@@ -2441,6 +2504,8 @@ define(['exports'], (function (exports) { 'use strict';
|
|
|
2441
2504
|
const dialectJsonSchemaVersion = {};
|
|
2442
2505
|
|
|
2443
2506
|
const setConfig = (jsonSchemaVersion, key, value) => {
|
|
2507
|
+
dialectJsonSchemaVersion[jsonSchemaVersion] = jsonSchemaVersion;
|
|
2508
|
+
|
|
2444
2509
|
if (!config[jsonSchemaVersion]) {
|
|
2445
2510
|
config[jsonSchemaVersion] = {};
|
|
2446
2511
|
}
|
|
@@ -2467,23 +2532,25 @@ define(['exports'], (function (exports) { 'use strict';
|
|
|
2467
2532
|
}
|
|
2468
2533
|
delete schema["$schema"];
|
|
2469
2534
|
|
|
2470
|
-
// JSON Schema version
|
|
2535
|
+
// Determine JSON Schema version
|
|
2471
2536
|
if (!(dialectId in dialectJsonSchemaVersion)) {
|
|
2472
2537
|
if (schema?.$vocabulary?.[core201909Id] === true && dialectId === getSchemaIdentifier(schema, externalId, core201909Id)[0]) {
|
|
2538
|
+
// Self describing 2019-09 meta-schema
|
|
2473
2539
|
dialectJsonSchemaVersion[dialectId] = core201909Id;
|
|
2474
2540
|
} else if (schema?.$vocabulary?.[core202012Id] === true && dialectId === getSchemaIdentifier(schema, externalId, core202012Id)[0]) {
|
|
2541
|
+
// Self describing 2020-12 meta-schema
|
|
2475
2542
|
dialectJsonSchemaVersion[dialectId] = core202012Id;
|
|
2476
|
-
} else if (dialectId === getSchemaIdentifier(schema, externalId, dialectId)[0]) {
|
|
2477
|
-
dialectJsonSchemaVersion[dialectId] = dialectId;
|
|
2478
|
-
} else if (!(dialectId in schemaStore)) {
|
|
2479
|
-
throw Error(`Couldn't determine JSON Schema version for dialect: '${dialectId}'`);
|
|
2480
2543
|
} else {
|
|
2544
|
+
// Need to look at meta-schema to determine version
|
|
2481
2545
|
const metaSchema = schemaStore[dialectId];
|
|
2482
|
-
if (metaSchema
|
|
2546
|
+
if (!metaSchema) {
|
|
2547
|
+
throw Error(`Couldn't determine JSON Schema version for dialect: '${dialectId}'`);
|
|
2548
|
+
} else if (metaSchema.vocabulary[core201909Id] === true) {
|
|
2483
2549
|
dialectJsonSchemaVersion[dialectId] = core201909Id;
|
|
2484
2550
|
} else if (metaSchema.vocabulary[core202012Id] === true) {
|
|
2485
2551
|
dialectJsonSchemaVersion[dialectId] = core202012Id;
|
|
2486
2552
|
} else {
|
|
2553
|
+
// Assume the jsonSchemaVersion is the meta-schema's dialectId (non-standard behavior)
|
|
2487
2554
|
dialectJsonSchemaVersion[dialectId] = dialectJsonSchemaVersion[metaSchema.dialectId];
|
|
2488
2555
|
}
|
|
2489
2556
|
}
|
|
@@ -2622,7 +2689,23 @@ define(['exports'], (function (exports) { 'use strict';
|
|
|
2622
2689
|
throw Error(`Failed to retrieve schema with id: ${id}`);
|
|
2623
2690
|
}
|
|
2624
2691
|
|
|
2625
|
-
|
|
2692
|
+
const [schema, defaultDialectId] = await MediaTypes$1.parse(response);
|
|
2693
|
+
|
|
2694
|
+
let dialectId;
|
|
2695
|
+
if (schema.$schema) {
|
|
2696
|
+
dialectId = resolveUrl$1(schema.$schema, "");
|
|
2697
|
+
} else if (defaultDialectId) {
|
|
2698
|
+
dialectId = resolveUrl$1(id, defaultDialectId);
|
|
2699
|
+
} else {
|
|
2700
|
+
dialectId = "";
|
|
2701
|
+
}
|
|
2702
|
+
|
|
2703
|
+
// Make sure the meta-schema is loaded if this isn't a known dialect
|
|
2704
|
+
if (dialectId && id !== dialectId && !(dialectId in dialectJsonSchemaVersion)) {
|
|
2705
|
+
await get(dialectId);
|
|
2706
|
+
}
|
|
2707
|
+
|
|
2708
|
+
add$1(schema, id, dialectId);
|
|
2626
2709
|
}
|
|
2627
2710
|
|
|
2628
2711
|
const storedSchema = getStoredSchema(id);
|
|
@@ -2706,21 +2789,16 @@ define(['exports'], (function (exports) { 'use strict';
|
|
|
2706
2789
|
const dynamicAnchorToken = getConfig(schemaDoc.dialectId, "dynamicAnchorToken");
|
|
2707
2790
|
Object.entries(schemaDoc.dynamicAnchors)
|
|
2708
2791
|
.forEach(([anchor, uri]) => {
|
|
2709
|
-
const pointer = urlFragment(uri);
|
|
2710
|
-
JsonPointer.assign(pointer, schema,
|
|
2711
|
-
[dynamicAnchorToken]: anchor,
|
|
2712
|
-
...JsonPointer.get(pointer, schema)
|
|
2713
|
-
});
|
|
2792
|
+
const pointer = JsonPointer.append(dynamicAnchorToken, urlFragment(uri));
|
|
2793
|
+
JsonPointer.assign(pointer, schema, anchor);
|
|
2714
2794
|
});
|
|
2715
2795
|
|
|
2716
2796
|
const anchorToken = getConfig(schemaDoc.dialectId, "anchorToken");
|
|
2717
2797
|
Object.entries(schemaDoc.anchors)
|
|
2718
|
-
.filter(([anchor]) => anchor !== "")
|
|
2798
|
+
.filter(([anchor]) => anchor !== "" && !(anchor in schemaDoc.dynamicAnchors))
|
|
2719
2799
|
.forEach(([anchor, pointer]) => {
|
|
2720
|
-
JsonPointer.
|
|
2721
|
-
|
|
2722
|
-
...JsonPointer.get(pointer, schema)
|
|
2723
|
-
});
|
|
2800
|
+
const anchorPointer = JsonPointer.append(anchorToken, pointer);
|
|
2801
|
+
JsonPointer.assign(anchorPointer, schema, anchor);
|
|
2724
2802
|
});
|
|
2725
2803
|
|
|
2726
2804
|
const baseToken = getConfig(schemaDoc.dialectId, "baseToken");
|
|
@@ -2759,19 +2837,19 @@ define(['exports'], (function (exports) { 'use strict';
|
|
|
2759
2837
|
|
|
2760
2838
|
var invalidSchemaError = InvalidSchemaError$3;
|
|
2761
2839
|
|
|
2762
|
-
const Schema$
|
|
2840
|
+
const Schema$P = schema$5;
|
|
2763
2841
|
|
|
2764
2842
|
|
|
2765
|
-
const compile$
|
|
2766
|
-
const interpret$
|
|
2843
|
+
const compile$M = (schema) => Schema$P.value(schema);
|
|
2844
|
+
const interpret$M = () => true;
|
|
2767
2845
|
|
|
2768
|
-
var metaData$4 = { compile: compile$
|
|
2846
|
+
var metaData$4 = { compile: compile$M, interpret: interpret$M };
|
|
2769
2847
|
|
|
2770
|
-
const curry = justCurryIt;
|
|
2848
|
+
const curry = justCurryIt$1;
|
|
2771
2849
|
const PubSub$1 = pubsub.exports;
|
|
2772
2850
|
const { resolveUrl } = common$1;
|
|
2773
|
-
const Instance$
|
|
2774
|
-
const Schema$
|
|
2851
|
+
const Instance$C = instance;
|
|
2852
|
+
const Schema$O = schema$5;
|
|
2775
2853
|
const InvalidSchemaError$2 = invalidSchemaError;
|
|
2776
2854
|
const MediaTypes = mediaTypes;
|
|
2777
2855
|
const metaData$3 = metaData$4;
|
|
@@ -2783,24 +2861,27 @@ define(['exports'], (function (exports) { 'use strict';
|
|
|
2783
2861
|
let shouldMetaValidate = true;
|
|
2784
2862
|
|
|
2785
2863
|
MediaTypes.addPlugin("application/schema+json", {
|
|
2786
|
-
parse: async (response) =>
|
|
2864
|
+
parse: async (response, contentTypeParameters) => [
|
|
2865
|
+
await response.json(),
|
|
2866
|
+
contentTypeParameters.schema || contentTypeParameters.profile
|
|
2867
|
+
],
|
|
2787
2868
|
matcher: (path) => path.endsWith(".schema.json")
|
|
2788
2869
|
});
|
|
2789
2870
|
|
|
2790
2871
|
const validate$2 = async (schema, value = undefined, outputFormat = undefined) => {
|
|
2791
|
-
const compiled = await compile$
|
|
2792
|
-
const interpretAst = (value, outputFormat) => interpret$
|
|
2872
|
+
const compiled = await compile$L(schema);
|
|
2873
|
+
const interpretAst = (value, outputFormat) => interpret$L(compiled, Instance$C.cons(value), outputFormat);
|
|
2793
2874
|
|
|
2794
2875
|
return value === undefined ? interpretAst : interpretAst(value, outputFormat);
|
|
2795
2876
|
};
|
|
2796
2877
|
|
|
2797
|
-
const compile$
|
|
2878
|
+
const compile$L = async (schema) => {
|
|
2798
2879
|
const ast = { metaData: {} };
|
|
2799
2880
|
const schemaUri = await compileSchema(schema, ast);
|
|
2800
2881
|
return { ast, schemaUri };
|
|
2801
2882
|
};
|
|
2802
2883
|
|
|
2803
|
-
const interpret$
|
|
2884
|
+
const interpret$L = curry(({ ast, schemaUri }, value, outputFormat = FLAG) => {
|
|
2804
2885
|
if (![FLAG, BASIC, DETAILED, VERBOSE].includes(outputFormat)) {
|
|
2805
2886
|
throw Error(`The '${outputFormat}' error format is not supported`);
|
|
2806
2887
|
}
|
|
@@ -2875,10 +2956,10 @@ define(['exports'], (function (exports) { 'use strict';
|
|
|
2875
2956
|
|
|
2876
2957
|
// Vocabularies
|
|
2877
2958
|
if (!hasKeyword(`${schema.dialectId}#validate`)) {
|
|
2878
|
-
const metaSchema = await Schema$
|
|
2959
|
+
const metaSchema = await Schema$O.get(schema.dialectId);
|
|
2879
2960
|
|
|
2880
2961
|
// Check for mandatory vocabularies
|
|
2881
|
-
const mandatoryVocabularies = Schema$
|
|
2962
|
+
const mandatoryVocabularies = Schema$O.getConfig(metaSchema.id, "mandatoryVocabularies") || [];
|
|
2882
2963
|
mandatoryVocabularies.forEach((vocabularyId) => {
|
|
2883
2964
|
if (!metaSchema.vocabulary[vocabularyId]) {
|
|
2884
2965
|
throw Error(`Vocabulary '${vocabularyId}' must be explicitly declared and required`);
|
|
@@ -2901,17 +2982,17 @@ define(['exports'], (function (exports) { 'use strict';
|
|
|
2901
2982
|
|
|
2902
2983
|
// Meta validation
|
|
2903
2984
|
if (shouldMetaValidate && !schema.validated) {
|
|
2904
|
-
Schema$
|
|
2985
|
+
Schema$O.markValidated(schema.id);
|
|
2905
2986
|
|
|
2906
2987
|
// Compile
|
|
2907
2988
|
if (!(schema.dialectId in metaValidators)) {
|
|
2908
|
-
const metaSchema = await Schema$
|
|
2909
|
-
const compiledSchema = await compile$
|
|
2910
|
-
metaValidators[metaSchema.id] = interpret$
|
|
2989
|
+
const metaSchema = await Schema$O.get(schema.dialectId);
|
|
2990
|
+
const compiledSchema = await compile$L(metaSchema);
|
|
2991
|
+
metaValidators[metaSchema.id] = interpret$L(compiledSchema);
|
|
2911
2992
|
}
|
|
2912
2993
|
|
|
2913
2994
|
// Interpret
|
|
2914
|
-
const schemaInstance = Instance$
|
|
2995
|
+
const schemaInstance = Instance$C.cons(schema.schema, schema.id);
|
|
2915
2996
|
const metaResults = metaValidators[schema.dialectId](schemaInstance, metaOutputFormat);
|
|
2916
2997
|
if (!metaResults.valid) {
|
|
2917
2998
|
throw new InvalidSchemaError$2(metaResults);
|
|
@@ -2930,7 +3011,7 @@ define(['exports'], (function (exports) { 'use strict';
|
|
|
2930
3011
|
};
|
|
2931
3012
|
|
|
2932
3013
|
const followReferences = async (doc) => {
|
|
2933
|
-
return Schema$
|
|
3014
|
+
return Schema$O.typeOf(doc, "string") ? followReferences(await Schema$O.get(Schema$O.value(doc), doc)) : doc;
|
|
2934
3015
|
};
|
|
2935
3016
|
|
|
2936
3017
|
const interpretSchema = (schemaUri, instance, ast, dynamicAnchors) => {
|
|
@@ -2958,12 +3039,12 @@ define(['exports'], (function (exports) { 'use strict';
|
|
|
2958
3039
|
};
|
|
2959
3040
|
|
|
2960
3041
|
const add = (schema, url = "", defaultSchemaVersion = "") => {
|
|
2961
|
-
const id = Schema$
|
|
3042
|
+
const id = Schema$O.add(schema, url, defaultSchemaVersion);
|
|
2962
3043
|
delete metaValidators[id];
|
|
2963
3044
|
};
|
|
2964
3045
|
|
|
2965
3046
|
var core$2 = {
|
|
2966
|
-
validate: validate$2, compile: compile$
|
|
3047
|
+
validate: validate$2, compile: compile$L, interpret: interpret$L,
|
|
2967
3048
|
setMetaOutputFormat, setShouldMetaValidate, FLAG, BASIC, DETAILED, VERBOSE,
|
|
2968
3049
|
add, getKeyword, hasKeyword, defineVocabulary,
|
|
2969
3050
|
compileSchema, interpretSchema, collectEvaluatedProperties: collectEvaluatedProperties$e, collectEvaluatedItems: collectEvaluatedItems$f,
|
|
@@ -2973,30 +3054,30 @@ define(['exports'], (function (exports) { 'use strict';
|
|
|
2973
3054
|
const Pact$9 = lib$2;
|
|
2974
3055
|
const PubSub = pubsub.exports;
|
|
2975
3056
|
const Core$x = core$2;
|
|
2976
|
-
const Instance$
|
|
2977
|
-
const Schema$
|
|
3057
|
+
const Instance$B = instance;
|
|
3058
|
+
const Schema$N = schema$5;
|
|
2978
3059
|
|
|
2979
3060
|
|
|
2980
|
-
const compile$
|
|
2981
|
-
const url = Schema$
|
|
3061
|
+
const compile$K = async (schema, ast) => {
|
|
3062
|
+
const url = Schema$N.uri(schema);
|
|
2982
3063
|
if (!(url in ast)) {
|
|
2983
3064
|
ast[url] = false; // Place dummy entry in ast to avoid recursive loops
|
|
2984
3065
|
|
|
2985
|
-
const schemaValue = Schema$
|
|
3066
|
+
const schemaValue = Schema$N.value(schema);
|
|
2986
3067
|
if (!["object", "boolean"].includes(typeof schemaValue)) {
|
|
2987
|
-
throw Error(`No schema found at '${Schema$
|
|
3068
|
+
throw Error(`No schema found at '${Schema$N.uri(schema)}'`);
|
|
2988
3069
|
}
|
|
2989
3070
|
|
|
2990
3071
|
ast[url] = [
|
|
2991
3072
|
`${schema.dialectId}#validate`,
|
|
2992
|
-
Schema$
|
|
3073
|
+
Schema$N.uri(schema),
|
|
2993
3074
|
typeof schemaValue === "boolean" ? schemaValue : await Pact$9.pipeline([
|
|
2994
|
-
Schema$
|
|
3075
|
+
Schema$N.entries,
|
|
2995
3076
|
Pact$9.map(([keyword, keywordSchema]) => [`${schema.dialectId}#${keyword}`, keywordSchema]),
|
|
2996
3077
|
Pact$9.filter(([keywordId]) => keywordId !== `${schema.dialectId}#validate`),
|
|
2997
3078
|
Pact$9.map(async ([keywordId, keywordSchema]) => {
|
|
2998
3079
|
const keywordAst = await Core$x.getKeyword(keywordId).compile(keywordSchema, ast, schema);
|
|
2999
|
-
return [keywordId, Schema$
|
|
3080
|
+
return [keywordId, Schema$N.uri(keywordSchema), keywordAst];
|
|
3000
3081
|
}),
|
|
3001
3082
|
Pact$9.all
|
|
3002
3083
|
], schema)
|
|
@@ -3006,7 +3087,7 @@ define(['exports'], (function (exports) { 'use strict';
|
|
|
3006
3087
|
return url;
|
|
3007
3088
|
};
|
|
3008
3089
|
|
|
3009
|
-
const interpret$
|
|
3090
|
+
const interpret$K = (uri, instance, ast, dynamicAnchors) => {
|
|
3010
3091
|
const [keywordId, schemaUrl, nodes] = ast[uri];
|
|
3011
3092
|
|
|
3012
3093
|
PubSub.publishSync("result.start");
|
|
@@ -3018,7 +3099,7 @@ define(['exports'], (function (exports) { 'use strict';
|
|
|
3018
3099
|
PubSub.publishSync("result", {
|
|
3019
3100
|
keyword: keywordId,
|
|
3020
3101
|
absoluteKeywordLocation: schemaUrl,
|
|
3021
|
-
instanceLocation: Instance$
|
|
3102
|
+
instanceLocation: Instance$B.uri(instance),
|
|
3022
3103
|
valid: isValid,
|
|
3023
3104
|
ast: keywordValue
|
|
3024
3105
|
});
|
|
@@ -3029,7 +3110,7 @@ define(['exports'], (function (exports) { 'use strict';
|
|
|
3029
3110
|
PubSub.publishSync("result", {
|
|
3030
3111
|
keyword: keywordId,
|
|
3031
3112
|
absoluteKeywordLocation: schemaUrl,
|
|
3032
|
-
instanceLocation: Instance$
|
|
3113
|
+
instanceLocation: Instance$B.uri(instance),
|
|
3033
3114
|
valid: isValid,
|
|
3034
3115
|
ast: uri
|
|
3035
3116
|
});
|
|
@@ -3067,7 +3148,7 @@ define(['exports'], (function (exports) { 'use strict';
|
|
|
3067
3148
|
}, new Set());
|
|
3068
3149
|
};
|
|
3069
3150
|
|
|
3070
|
-
var validate$1 = { compile: compile$
|
|
3151
|
+
var validate$1 = { compile: compile$K, interpret: interpret$K, collectEvaluatedProperties: collectEvaluatedProperties$d, collectEvaluatedItems: collectEvaluatedItems$e };
|
|
3071
3152
|
|
|
3072
3153
|
const metaData$2 = metaData$4;
|
|
3073
3154
|
const validate = validate$1;
|
|
@@ -3076,90 +3157,90 @@ define(['exports'], (function (exports) { 'use strict';
|
|
|
3076
3157
|
var keywords$6 = { metaData: metaData$2, validate };
|
|
3077
3158
|
|
|
3078
3159
|
const Core$w = core$2;
|
|
3079
|
-
const Schema$
|
|
3080
|
-
const Instance$
|
|
3160
|
+
const Schema$M = schema$5;
|
|
3161
|
+
const Instance$A = instance;
|
|
3081
3162
|
const Reference = reference;
|
|
3082
3163
|
const Keywords$2 = keywords$6;
|
|
3083
3164
|
const InvalidSchemaError$1 = invalidSchemaError;
|
|
3084
3165
|
|
|
3085
3166
|
|
|
3086
|
-
var lib$1 = { Core: Core$w, Schema: Schema$
|
|
3167
|
+
var lib$1 = { Core: Core$w, Schema: Schema$M, Instance: Instance$A, Reference, Keywords: Keywords$2, InvalidSchemaError: InvalidSchemaError$1 };
|
|
3087
3168
|
|
|
3088
|
-
const { Core: Core$v, Schema: Schema$
|
|
3169
|
+
const { Core: Core$v, Schema: Schema$L, Instance: Instance$z } = lib$1;
|
|
3089
3170
|
|
|
3090
3171
|
|
|
3091
|
-
const compile$
|
|
3092
|
-
const items = await Schema$
|
|
3093
|
-
const numberOfItems = Schema$
|
|
3172
|
+
const compile$J = async (schema, ast, parentSchema) => {
|
|
3173
|
+
const items = await Schema$L.step("items", parentSchema);
|
|
3174
|
+
const numberOfItems = Schema$L.typeOf(items, "array") ? Schema$L.length(items) : Number.MAX_SAFE_INTEGER;
|
|
3094
3175
|
|
|
3095
|
-
if (Schema$
|
|
3096
|
-
return [numberOfItems, Schema$
|
|
3176
|
+
if (Schema$L.typeOf(schema, "boolean")) {
|
|
3177
|
+
return [numberOfItems, Schema$L.value(schema)];
|
|
3097
3178
|
} else {
|
|
3098
3179
|
return [numberOfItems, await Core$v.compileSchema(schema, ast)];
|
|
3099
3180
|
}
|
|
3100
3181
|
};
|
|
3101
3182
|
|
|
3102
|
-
const interpret$
|
|
3103
|
-
if (!Instance$
|
|
3183
|
+
const interpret$J = ([numberOfItems, additionalItems], instance, ast, dynamicAnchors) => {
|
|
3184
|
+
if (!Instance$z.typeOf(instance, "array")) {
|
|
3104
3185
|
return true;
|
|
3105
3186
|
}
|
|
3106
3187
|
|
|
3107
3188
|
if (typeof additionalItems === "string") {
|
|
3108
|
-
return Instance$
|
|
3189
|
+
return Instance$z.every((item, ndx) => ndx < numberOfItems || Core$v.interpretSchema(additionalItems, item, ast, dynamicAnchors), instance);
|
|
3109
3190
|
} else {
|
|
3110
|
-
return Instance$
|
|
3191
|
+
return Instance$z.every((item, ndx) => ndx < numberOfItems ? true : additionalItems, instance);
|
|
3111
3192
|
}
|
|
3112
3193
|
};
|
|
3113
3194
|
|
|
3114
|
-
var additionalItems = { compile: compile$
|
|
3195
|
+
var additionalItems = { compile: compile$J, interpret: interpret$J };
|
|
3115
3196
|
|
|
3116
|
-
const { Core: Core$u, Schema: Schema$
|
|
3197
|
+
const { Core: Core$u, Schema: Schema$K, Instance: Instance$y } = lib$1;
|
|
3117
3198
|
|
|
3118
3199
|
|
|
3119
|
-
const compile$
|
|
3120
|
-
const items = await Schema$
|
|
3121
|
-
const numberOfItems = Schema$
|
|
3200
|
+
const compile$I = async (schema, ast, parentSchema) => {
|
|
3201
|
+
const items = await Schema$K.step("items", parentSchema);
|
|
3202
|
+
const numberOfItems = Schema$K.typeOf(items, "array") ? Schema$K.length(items) : Number.MAX_SAFE_INTEGER;
|
|
3122
3203
|
|
|
3123
3204
|
return [numberOfItems, await Core$u.compileSchema(schema, ast)];
|
|
3124
3205
|
};
|
|
3125
3206
|
|
|
3126
|
-
const interpret$
|
|
3127
|
-
if (!Instance$
|
|
3207
|
+
const interpret$I = ([numberOfItems, additionalItems], instance, ast, dynamicAnchors) => {
|
|
3208
|
+
if (!Instance$y.typeOf(instance, "array")) {
|
|
3128
3209
|
return true;
|
|
3129
3210
|
}
|
|
3130
3211
|
|
|
3131
|
-
return Instance$
|
|
3212
|
+
return Instance$y.every((item, ndx) => ndx < numberOfItems || Core$u.interpretSchema(additionalItems, item, ast, dynamicAnchors), instance);
|
|
3132
3213
|
};
|
|
3133
3214
|
|
|
3134
3215
|
const collectEvaluatedItems$d = (keywordValue, instance, ast, dynamicAnchors) => {
|
|
3135
|
-
return interpret$
|
|
3216
|
+
return interpret$I(keywordValue, instance, ast, dynamicAnchors) && new Set(Instance$y.map((item, ndx) => ndx, instance));
|
|
3136
3217
|
};
|
|
3137
3218
|
|
|
3138
|
-
var additionalItems6 = { compile: compile$
|
|
3219
|
+
var additionalItems6 = { compile: compile$I, interpret: interpret$I, collectEvaluatedItems: collectEvaluatedItems$d };
|
|
3139
3220
|
|
|
3140
|
-
const { Core: Core$t, Schema: Schema$
|
|
3221
|
+
const { Core: Core$t, Schema: Schema$J, Instance: Instance$x } = lib$1;
|
|
3141
3222
|
|
|
3142
3223
|
|
|
3143
|
-
const compile$
|
|
3144
|
-
const properties = await Schema$
|
|
3145
|
-
const propertyNames = Schema$
|
|
3224
|
+
const compile$H = async (schema, ast, parentSchema) => {
|
|
3225
|
+
const properties = await Schema$J.step("properties", parentSchema);
|
|
3226
|
+
const propertyNames = Schema$J.typeOf(properties, "object") ? Schema$J.keys(properties) : [];
|
|
3146
3227
|
|
|
3147
|
-
const patternProperties = await Schema$
|
|
3148
|
-
const propertyNamePatterns = Schema$
|
|
3228
|
+
const patternProperties = await Schema$J.step("patternProperties", parentSchema);
|
|
3229
|
+
const propertyNamePatterns = Schema$J.typeOf(patternProperties, "object") ? Schema$J.keys(patternProperties).map((pattern) => new RegExp(pattern)) : [];
|
|
3149
3230
|
|
|
3150
|
-
if (Schema$
|
|
3151
|
-
return [propertyNames, propertyNamePatterns, Schema$
|
|
3231
|
+
if (Schema$J.typeOf(schema, "boolean")) {
|
|
3232
|
+
return [propertyNames, propertyNamePatterns, Schema$J.value(schema)];
|
|
3152
3233
|
} else {
|
|
3153
3234
|
return [propertyNames, propertyNamePatterns, await Core$t.compileSchema(schema, ast)];
|
|
3154
3235
|
}
|
|
3155
3236
|
};
|
|
3156
3237
|
|
|
3157
|
-
const interpret$
|
|
3158
|
-
if (!Instance$
|
|
3238
|
+
const interpret$H = ([propertyNames, propertyNamePatterns, additionalProperties], instance, ast, dynamicAnchors) => {
|
|
3239
|
+
if (!Instance$x.typeOf(instance, "object")) {
|
|
3159
3240
|
return true;
|
|
3160
3241
|
}
|
|
3161
3242
|
|
|
3162
|
-
const properties = Instance$
|
|
3243
|
+
const properties = Instance$x.entries(instance)
|
|
3163
3244
|
.filter(([propertyName]) => !propertyNames.includes(propertyName) && !propertyNamePatterns.some((pattern) => pattern.test(propertyName)));
|
|
3164
3245
|
|
|
3165
3246
|
if (typeof additionalProperties === "string") {
|
|
@@ -3169,47 +3250,47 @@ define(['exports'], (function (exports) { 'use strict';
|
|
|
3169
3250
|
}
|
|
3170
3251
|
};
|
|
3171
3252
|
|
|
3172
|
-
var additionalProperties = { compile: compile$
|
|
3253
|
+
var additionalProperties = { compile: compile$H, interpret: interpret$H };
|
|
3173
3254
|
|
|
3174
|
-
const { Core: Core$s, Schema: Schema$
|
|
3255
|
+
const { Core: Core$s, Schema: Schema$I, Instance: Instance$w } = lib$1;
|
|
3175
3256
|
|
|
3176
3257
|
|
|
3177
|
-
const compile$
|
|
3178
|
-
const propertiesSchema = await Schema$
|
|
3179
|
-
const propertyNames = Schema$
|
|
3258
|
+
const compile$G = async (schema, ast, parentSchema) => {
|
|
3259
|
+
const propertiesSchema = await Schema$I.step("properties", parentSchema);
|
|
3260
|
+
const propertyNames = Schema$I.typeOf(propertiesSchema, "object") ? Schema$I.keys(propertiesSchema) : [];
|
|
3180
3261
|
|
|
3181
|
-
const patternProperties = await Schema$
|
|
3182
|
-
const propertyNamePatterns = Schema$
|
|
3262
|
+
const patternProperties = await Schema$I.step("patternProperties", parentSchema);
|
|
3263
|
+
const propertyNamePatterns = Schema$I.typeOf(patternProperties, "object") ? Schema$I.keys(patternProperties).map((pattern) => new RegExp(pattern)) : [];
|
|
3183
3264
|
|
|
3184
3265
|
return [propertyNames, propertyNamePatterns, await Core$s.compileSchema(schema, ast)];
|
|
3185
3266
|
};
|
|
3186
3267
|
|
|
3187
|
-
const interpret$
|
|
3188
|
-
if (!Instance$
|
|
3268
|
+
const interpret$G = ([propertyNames, propertyNamePatterns, additionalProperties], instance, ast, dynamicAnchors) => {
|
|
3269
|
+
if (!Instance$w.typeOf(instance, "object")) {
|
|
3189
3270
|
return true;
|
|
3190
3271
|
}
|
|
3191
3272
|
|
|
3192
|
-
return Instance$
|
|
3273
|
+
return Instance$w.entries(instance)
|
|
3193
3274
|
.filter(([propertyName]) => !propertyNames.includes(propertyName) && !propertyNamePatterns.some((pattern) => pattern.test(propertyName)))
|
|
3194
3275
|
.every(([, property]) => Core$s.interpretSchema(additionalProperties, property, ast, dynamicAnchors));
|
|
3195
3276
|
};
|
|
3196
3277
|
|
|
3197
3278
|
const collectEvaluatedProperties$c = (keywordValue, instance, ast, dynamicAnchors) => {
|
|
3198
|
-
return interpret$
|
|
3279
|
+
return interpret$G(keywordValue, instance, ast, dynamicAnchors) && [new RegExp("")];
|
|
3199
3280
|
};
|
|
3200
3281
|
|
|
3201
|
-
var additionalProperties6 = { compile: compile$
|
|
3282
|
+
var additionalProperties6 = { compile: compile$G, interpret: interpret$G, collectEvaluatedProperties: collectEvaluatedProperties$c };
|
|
3202
3283
|
|
|
3203
|
-
const { Core: Core$r, Schema: Schema$
|
|
3284
|
+
const { Core: Core$r, Schema: Schema$H } = lib$1;
|
|
3204
3285
|
const Pact$8 = lib$2;
|
|
3205
3286
|
|
|
3206
3287
|
|
|
3207
|
-
const compile$
|
|
3208
|
-
Schema$
|
|
3288
|
+
const compile$F = (schema, ast) => Pact$8.pipeline([
|
|
3289
|
+
Schema$H.map(async (itemSchema) => Core$r.compileSchema(await itemSchema, ast)),
|
|
3209
3290
|
Pact$8.all
|
|
3210
3291
|
], schema);
|
|
3211
3292
|
|
|
3212
|
-
const interpret$
|
|
3293
|
+
const interpret$F = (allOf, instance, ast, dynamicAnchors) => {
|
|
3213
3294
|
return allOf.every((schemaUrl) => Core$r.interpretSchema(schemaUrl, instance, ast, dynamicAnchors));
|
|
3214
3295
|
};
|
|
3215
3296
|
|
|
@@ -3227,18 +3308,18 @@ define(['exports'], (function (exports) { 'use strict';
|
|
|
3227
3308
|
}, new Set());
|
|
3228
3309
|
};
|
|
3229
3310
|
|
|
3230
|
-
var allOf = { compile: compile$
|
|
3311
|
+
var allOf = { compile: compile$F, interpret: interpret$F, collectEvaluatedProperties: collectEvaluatedProperties$b, collectEvaluatedItems: collectEvaluatedItems$c };
|
|
3231
3312
|
|
|
3232
|
-
const { Core: Core$q, Schema: Schema$
|
|
3313
|
+
const { Core: Core$q, Schema: Schema$G } = lib$1;
|
|
3233
3314
|
const Pact$7 = lib$2;
|
|
3234
3315
|
|
|
3235
3316
|
|
|
3236
|
-
const compile$
|
|
3237
|
-
Schema$
|
|
3317
|
+
const compile$E = (schema, ast) => Pact$7.pipeline([
|
|
3318
|
+
Schema$G.map(async (itemSchema) => Core$q.compileSchema(await itemSchema, ast)),
|
|
3238
3319
|
Pact$7.all
|
|
3239
3320
|
], schema);
|
|
3240
3321
|
|
|
3241
|
-
const interpret$
|
|
3322
|
+
const interpret$E = (anyOf, instance, ast, dynamicAnchors) => {
|
|
3242
3323
|
const matches = anyOf.filter((schemaUrl) => Core$q.interpretSchema(schemaUrl, instance, ast, dynamicAnchors));
|
|
3243
3324
|
return matches.length > 0;
|
|
3244
3325
|
};
|
|
@@ -3257,7 +3338,7 @@ define(['exports'], (function (exports) { 'use strict';
|
|
|
3257
3338
|
}, false);
|
|
3258
3339
|
};
|
|
3259
3340
|
|
|
3260
|
-
var anyOf = { compile: compile$
|
|
3341
|
+
var anyOf = { compile: compile$E, interpret: interpret$E, collectEvaluatedProperties: collectEvaluatedProperties$a, collectEvaluatedItems: collectEvaluatedItems$b };
|
|
3261
3342
|
|
|
3262
3343
|
var keyList = Object.keys;
|
|
3263
3344
|
var native_stringify = JSON.stringify;
|
|
@@ -3318,92 +3399,92 @@ define(['exports'], (function (exports) { 'use strict';
|
|
|
3318
3399
|
|
|
3319
3400
|
var fastestStableStringify = function(obj) { return '' + stringify(obj, false); };
|
|
3320
3401
|
|
|
3321
|
-
const { Schema: Schema$
|
|
3402
|
+
const { Schema: Schema$F, Instance: Instance$v } = lib$1;
|
|
3322
3403
|
const jsonStringify$2 = fastestStableStringify;
|
|
3323
3404
|
|
|
3324
3405
|
|
|
3325
|
-
const compile$
|
|
3326
|
-
const interpret$
|
|
3406
|
+
const compile$D = (schema) => jsonStringify$2(Schema$F.value(schema));
|
|
3407
|
+
const interpret$D = (const_, instance) => jsonStringify$2(Instance$v.value(instance)) === const_;
|
|
3327
3408
|
|
|
3328
|
-
var _const = { compile: compile$
|
|
3409
|
+
var _const = { compile: compile$D, interpret: interpret$D };
|
|
3329
3410
|
|
|
3330
|
-
const { Core: Core$p, Instance: Instance$
|
|
3411
|
+
const { Core: Core$p, Instance: Instance$u } = lib$1;
|
|
3331
3412
|
|
|
3332
3413
|
|
|
3333
|
-
const compile$
|
|
3414
|
+
const compile$C = (schema, ast) => Core$p.compileSchema(schema, ast);
|
|
3334
3415
|
|
|
3335
|
-
const interpret$
|
|
3336
|
-
return !Instance$
|
|
3416
|
+
const interpret$C = (contains, instance, ast, dynamicAnchors) => {
|
|
3417
|
+
return !Instance$u.typeOf(instance, "array") || Instance$u.some((item) => Core$p.interpretSchema(contains, item, ast, dynamicAnchors), instance);
|
|
3337
3418
|
};
|
|
3338
3419
|
|
|
3339
|
-
var contains = { compile: compile$
|
|
3420
|
+
var contains = { compile: compile$C, interpret: interpret$C };
|
|
3340
3421
|
|
|
3341
|
-
const { Core: Core$o, Schema: Schema$
|
|
3422
|
+
const { Core: Core$o, Schema: Schema$E, Instance: Instance$t } = lib$1;
|
|
3342
3423
|
|
|
3343
3424
|
|
|
3344
|
-
const compile$
|
|
3425
|
+
const compile$B = async (schema, ast, parentSchema) => {
|
|
3345
3426
|
const contains = await Core$o.compileSchema(schema, ast);
|
|
3346
3427
|
|
|
3347
|
-
const minContainsSchema = await Schema$
|
|
3348
|
-
const minContains = Schema$
|
|
3428
|
+
const minContainsSchema = await Schema$E.step("minContains", parentSchema);
|
|
3429
|
+
const minContains = Schema$E.typeOf(minContainsSchema, "number") ? Schema$E.value(minContainsSchema) : 1;
|
|
3349
3430
|
|
|
3350
|
-
const maxContainsSchema = await Schema$
|
|
3351
|
-
const maxContains = Schema$
|
|
3431
|
+
const maxContainsSchema = await Schema$E.step("maxContains", parentSchema);
|
|
3432
|
+
const maxContains = Schema$E.typeOf(maxContainsSchema, "number") ? Schema$E.value(maxContainsSchema) : Number.MAX_SAFE_INTEGER;
|
|
3352
3433
|
|
|
3353
3434
|
return { contains, minContains, maxContains };
|
|
3354
3435
|
};
|
|
3355
3436
|
|
|
3356
|
-
const interpret$
|
|
3357
|
-
if (!Instance$
|
|
3437
|
+
const interpret$B = ({ contains, minContains, maxContains }, instance, ast, dynamicAnchors) => {
|
|
3438
|
+
if (!Instance$t.typeOf(instance, "array")) {
|
|
3358
3439
|
return true;
|
|
3359
3440
|
}
|
|
3360
3441
|
|
|
3361
|
-
const matches = Instance$
|
|
3442
|
+
const matches = Instance$t.reduce((matches, item) => {
|
|
3362
3443
|
return Core$o.interpretSchema(contains, item, ast, dynamicAnchors) ? matches + 1 : matches;
|
|
3363
3444
|
}, 0, instance);
|
|
3364
3445
|
return matches >= minContains && matches <= maxContains;
|
|
3365
3446
|
};
|
|
3366
3447
|
|
|
3367
3448
|
const collectEvaluatedItems$a = (keywordValue, instance, ast, dynamicAnchors) => {
|
|
3368
|
-
return interpret$
|
|
3449
|
+
return interpret$B(keywordValue, instance, ast, dynamicAnchors) && Instance$t.reduce((matchedIndexes, item, itemIndex) => {
|
|
3369
3450
|
return Core$o.interpretSchema(keywordValue.contains, item, ast, dynamicAnchors) ? matchedIndexes.add(itemIndex) : matchedIndexes;
|
|
3370
3451
|
}, new Set(), instance);
|
|
3371
3452
|
};
|
|
3372
3453
|
|
|
3373
|
-
var containsMinContainsMaxContains = { compile: compile$
|
|
3454
|
+
var containsMinContainsMaxContains = { compile: compile$B, interpret: interpret$B, collectEvaluatedItems: collectEvaluatedItems$a };
|
|
3374
3455
|
|
|
3375
|
-
const { Core: Core$n, Schema: Schema$
|
|
3456
|
+
const { Core: Core$n, Schema: Schema$D } = lib$1;
|
|
3376
3457
|
const Pact$6 = lib$2;
|
|
3377
3458
|
|
|
3378
3459
|
|
|
3379
|
-
const compile$
|
|
3460
|
+
const compile$A = async (schema, ast) => {
|
|
3380
3461
|
await Pact$6.pipeline([
|
|
3381
|
-
Schema$
|
|
3462
|
+
Schema$D.entries,
|
|
3382
3463
|
Pact$6.map(([, definitionSchema]) => Core$n.compileSchema(definitionSchema, ast)),
|
|
3383
3464
|
Pact$6.all
|
|
3384
3465
|
], schema);
|
|
3385
3466
|
};
|
|
3386
3467
|
|
|
3387
|
-
const interpret$
|
|
3468
|
+
const interpret$A = () => true;
|
|
3388
3469
|
|
|
3389
|
-
var definitions = { compile: compile$
|
|
3470
|
+
var definitions = { compile: compile$A, interpret: interpret$A };
|
|
3390
3471
|
|
|
3391
|
-
const { Core: Core$m, Schema: Schema$
|
|
3472
|
+
const { Core: Core$m, Schema: Schema$C, Instance: Instance$s } = lib$1;
|
|
3392
3473
|
const Pact$5 = lib$2;
|
|
3393
3474
|
|
|
3394
3475
|
|
|
3395
|
-
const compile$
|
|
3396
|
-
Schema$
|
|
3476
|
+
const compile$z = (schema, ast) => Pact$5.pipeline([
|
|
3477
|
+
Schema$C.entries,
|
|
3397
3478
|
Pact$5.map(async ([key, dependency]) => {
|
|
3398
|
-
return [key, Schema$
|
|
3479
|
+
return [key, Schema$C.typeOf(dependency, "array") ? Schema$C.value(dependency) : await Core$m.compileSchema(dependency, ast)];
|
|
3399
3480
|
}),
|
|
3400
3481
|
Pact$5.all
|
|
3401
3482
|
], schema);
|
|
3402
3483
|
|
|
3403
|
-
const interpret$
|
|
3404
|
-
const value = Instance$
|
|
3484
|
+
const interpret$z = (dependencies, instance, ast, dynamicAnchors) => {
|
|
3485
|
+
const value = Instance$s.value(instance);
|
|
3405
3486
|
|
|
3406
|
-
return !Instance$
|
|
3487
|
+
return !Instance$s.typeOf(instance, "object") || dependencies.every(([propertyName, dependency]) => {
|
|
3407
3488
|
if (!(propertyName in value)) {
|
|
3408
3489
|
return true;
|
|
3409
3490
|
}
|
|
@@ -3416,49 +3497,49 @@ define(['exports'], (function (exports) { 'use strict';
|
|
|
3416
3497
|
});
|
|
3417
3498
|
};
|
|
3418
3499
|
|
|
3419
|
-
var dependencies = { compile: compile$
|
|
3500
|
+
var dependencies = { compile: compile$z, interpret: interpret$z };
|
|
3420
3501
|
|
|
3421
|
-
const { Schema: Schema$
|
|
3502
|
+
const { Schema: Schema$B, Instance: Instance$r } = lib$1;
|
|
3422
3503
|
const Pact$4 = lib$2;
|
|
3423
3504
|
|
|
3424
3505
|
|
|
3425
|
-
const compile$
|
|
3426
|
-
Schema$
|
|
3427
|
-
Pact$4.map(([key, dependentRequired]) => [key, Schema$
|
|
3506
|
+
const compile$y = (schema) => Pact$4.pipeline([
|
|
3507
|
+
Schema$B.entries,
|
|
3508
|
+
Pact$4.map(([key, dependentRequired]) => [key, Schema$B.value(dependentRequired)]),
|
|
3428
3509
|
Pact$4.all
|
|
3429
3510
|
], schema);
|
|
3430
3511
|
|
|
3431
|
-
const interpret$
|
|
3432
|
-
const value = Instance$
|
|
3512
|
+
const interpret$y = (dependentRequired, instance) => {
|
|
3513
|
+
const value = Instance$r.value(instance);
|
|
3433
3514
|
|
|
3434
|
-
return !Instance$
|
|
3515
|
+
return !Instance$r.typeOf(instance, "object") || dependentRequired.every(([propertyName, required]) => {
|
|
3435
3516
|
return !(propertyName in value) || required.every((key) => key in value);
|
|
3436
3517
|
});
|
|
3437
3518
|
};
|
|
3438
3519
|
|
|
3439
|
-
var dependentRequired = { compile: compile$
|
|
3520
|
+
var dependentRequired = { compile: compile$y, interpret: interpret$y };
|
|
3440
3521
|
|
|
3441
|
-
const { Core: Core$l, Schema: Schema$
|
|
3522
|
+
const { Core: Core$l, Schema: Schema$A, Instance: Instance$q } = lib$1;
|
|
3442
3523
|
const Pact$3 = lib$2;
|
|
3443
3524
|
|
|
3444
3525
|
|
|
3445
|
-
const compile$
|
|
3446
|
-
Schema$
|
|
3526
|
+
const compile$x = (schema, ast) => Pact$3.pipeline([
|
|
3527
|
+
Schema$A.entries,
|
|
3447
3528
|
Pact$3.map(async ([key, dependentSchema]) => [key, await Core$l.compileSchema(dependentSchema, ast)]),
|
|
3448
3529
|
Pact$3.all
|
|
3449
3530
|
], schema);
|
|
3450
3531
|
|
|
3451
|
-
const interpret$
|
|
3452
|
-
const value = Instance$
|
|
3532
|
+
const interpret$x = (dependentSchemas, instance, ast, dynamicAnchors) => {
|
|
3533
|
+
const value = Instance$q.value(instance);
|
|
3453
3534
|
|
|
3454
|
-
return !Instance$
|
|
3535
|
+
return !Instance$q.typeOf(instance, "object") || dependentSchemas.every(([propertyName, dependentSchema]) => {
|
|
3455
3536
|
return !(propertyName in value) || Core$l.interpretSchema(dependentSchema, instance, ast, dynamicAnchors);
|
|
3456
3537
|
});
|
|
3457
3538
|
};
|
|
3458
3539
|
|
|
3459
3540
|
const collectEvaluatedProperties$9 = (dependentSchemas, instance, ast, dynamicAnchors) => {
|
|
3460
3541
|
return dependentSchemas.reduce((acc, [propertyName, dependentSchema]) => {
|
|
3461
|
-
if (!acc || !Instance$
|
|
3542
|
+
if (!acc || !Instance$q.has(propertyName, instance)) {
|
|
3462
3543
|
return acc;
|
|
3463
3544
|
}
|
|
3464
3545
|
|
|
@@ -3467,39 +3548,39 @@ define(['exports'], (function (exports) { 'use strict';
|
|
|
3467
3548
|
}, []);
|
|
3468
3549
|
};
|
|
3469
3550
|
|
|
3470
|
-
var dependentSchemas = { compile: compile$
|
|
3551
|
+
var dependentSchemas = { compile: compile$x, interpret: interpret$x, collectEvaluatedProperties: collectEvaluatedProperties$9 };
|
|
3471
3552
|
|
|
3472
|
-
const { Schema: Schema$
|
|
3553
|
+
const { Schema: Schema$z, Instance: Instance$p } = lib$1;
|
|
3473
3554
|
const jsonStringify$1 = fastestStableStringify;
|
|
3474
3555
|
|
|
3475
3556
|
|
|
3476
|
-
const compile$
|
|
3477
|
-
const interpret$
|
|
3557
|
+
const compile$w = (schema) => Schema$z.value(schema).map(jsonStringify$1);
|
|
3558
|
+
const interpret$w = (enum_, instance) => enum_.some((enumValue) => jsonStringify$1(Instance$p.value(instance)) === enumValue);
|
|
3478
3559
|
|
|
3479
|
-
var _enum = { compile: compile$
|
|
3560
|
+
var _enum = { compile: compile$w, interpret: interpret$w };
|
|
3480
3561
|
|
|
3481
|
-
const { Schema: Schema$
|
|
3562
|
+
const { Schema: Schema$y, Instance: Instance$o } = lib$1;
|
|
3482
3563
|
|
|
3483
3564
|
|
|
3484
|
-
const compile$
|
|
3485
|
-
const interpret$
|
|
3565
|
+
const compile$v = async (schema) => Schema$y.value(schema);
|
|
3566
|
+
const interpret$v = (exclusiveMaximum, instance) => !Instance$o.typeOf(instance, "number") || Instance$o.value(instance) < exclusiveMaximum;
|
|
3486
3567
|
|
|
3487
|
-
var exclusiveMaximum = { compile: compile$
|
|
3568
|
+
var exclusiveMaximum = { compile: compile$v, interpret: interpret$v };
|
|
3488
3569
|
|
|
3489
|
-
const { Schema: Schema$
|
|
3570
|
+
const { Schema: Schema$x, Instance: Instance$n } = lib$1;
|
|
3490
3571
|
|
|
3491
3572
|
|
|
3492
|
-
const compile$
|
|
3493
|
-
const interpret$
|
|
3573
|
+
const compile$u = async (schema) => Schema$x.value(schema);
|
|
3574
|
+
const interpret$u = (exclusiveMinimum, instance) => !Instance$n.typeOf(instance, "number") || Instance$n.value(instance) > exclusiveMinimum;
|
|
3494
3575
|
|
|
3495
|
-
var exclusiveMinimum = { compile: compile$
|
|
3576
|
+
var exclusiveMinimum = { compile: compile$u, interpret: interpret$u };
|
|
3496
3577
|
|
|
3497
3578
|
const { Core: Core$k } = lib$1;
|
|
3498
3579
|
|
|
3499
3580
|
|
|
3500
|
-
const compile$
|
|
3581
|
+
const compile$t = (schema, ast) => Core$k.compileSchema(schema, ast);
|
|
3501
3582
|
|
|
3502
|
-
const interpret$
|
|
3583
|
+
const interpret$t = (ifSchema, instance, ast, dynamicAnchors) => {
|
|
3503
3584
|
Core$k.interpretSchema(ifSchema, instance, ast, dynamicAnchors);
|
|
3504
3585
|
return true;
|
|
3505
3586
|
};
|
|
@@ -3512,21 +3593,21 @@ define(['exports'], (function (exports) { 'use strict';
|
|
|
3512
3593
|
return Core$k.collectEvaluatedItems(ifSchema, instance, ast, dynamicAnchors) || new Set();
|
|
3513
3594
|
};
|
|
3514
3595
|
|
|
3515
|
-
var _if = { compile: compile$
|
|
3596
|
+
var _if = { compile: compile$t, interpret: interpret$t, collectEvaluatedProperties: collectEvaluatedProperties$8, collectEvaluatedItems: collectEvaluatedItems$9 };
|
|
3516
3597
|
|
|
3517
|
-
const { Core: Core$j, Schema: Schema$
|
|
3598
|
+
const { Core: Core$j, Schema: Schema$w } = lib$1;
|
|
3518
3599
|
|
|
3519
3600
|
|
|
3520
|
-
const compile$
|
|
3521
|
-
if (Schema$
|
|
3522
|
-
const ifSchema = await Schema$
|
|
3601
|
+
const compile$s = async (schema, ast, parentSchema) => {
|
|
3602
|
+
if (Schema$w.has("if", parentSchema)) {
|
|
3603
|
+
const ifSchema = await Schema$w.step("if", parentSchema);
|
|
3523
3604
|
return [await Core$j.compileSchema(ifSchema, ast), await Core$j.compileSchema(schema, ast)];
|
|
3524
3605
|
} else {
|
|
3525
3606
|
return [];
|
|
3526
3607
|
}
|
|
3527
3608
|
};
|
|
3528
3609
|
|
|
3529
|
-
const interpret$
|
|
3610
|
+
const interpret$s = ([guard, block], instance, ast, dynamicAnchors) => {
|
|
3530
3611
|
return guard === undefined || !quietInterpretSchema$1(guard, instance, ast, dynamicAnchors) || Core$j.interpretSchema(block, instance, ast, dynamicAnchors);
|
|
3531
3612
|
};
|
|
3532
3613
|
|
|
@@ -3556,21 +3637,21 @@ define(['exports'], (function (exports) { 'use strict';
|
|
|
3556
3637
|
return Core$j.collectEvaluatedItems(block, instance, ast, dynamicAnchors);
|
|
3557
3638
|
};
|
|
3558
3639
|
|
|
3559
|
-
var then = { compile: compile$
|
|
3640
|
+
var then = { compile: compile$s, interpret: interpret$s, collectEvaluatedProperties: collectEvaluatedProperties$7, collectEvaluatedItems: collectEvaluatedItems$8 };
|
|
3560
3641
|
|
|
3561
|
-
const { Core: Core$i, Schema: Schema$
|
|
3642
|
+
const { Core: Core$i, Schema: Schema$v } = lib$1;
|
|
3562
3643
|
|
|
3563
3644
|
|
|
3564
|
-
const compile$
|
|
3565
|
-
if (Schema$
|
|
3566
|
-
const ifSchema = await Schema$
|
|
3645
|
+
const compile$r = async (schema, ast, parentSchema) => {
|
|
3646
|
+
if (Schema$v.has("if", parentSchema)) {
|
|
3647
|
+
const ifSchema = await Schema$v.step("if", parentSchema);
|
|
3567
3648
|
return [await Core$i.compileSchema(ifSchema, ast), await Core$i.compileSchema(schema, ast)];
|
|
3568
3649
|
} else {
|
|
3569
3650
|
return [];
|
|
3570
3651
|
}
|
|
3571
3652
|
};
|
|
3572
3653
|
|
|
3573
|
-
const interpret$
|
|
3654
|
+
const interpret$r = ([guard, block], instance, ast, dynamicAnchors) => {
|
|
3574
3655
|
return guard === undefined || quietInterpretSchema(guard, instance, ast, dynamicAnchors) || Core$i.interpretSchema(block, instance, ast, dynamicAnchors);
|
|
3575
3656
|
};
|
|
3576
3657
|
|
|
@@ -3600,140 +3681,124 @@ define(['exports'], (function (exports) { 'use strict';
|
|
|
3600
3681
|
return Core$i.collectEvaluatedItems(block, instance, ast, dynamicAnchors);
|
|
3601
3682
|
};
|
|
3602
3683
|
|
|
3603
|
-
var _else = { compile: compile$
|
|
3684
|
+
var _else = { compile: compile$r, interpret: interpret$r, collectEvaluatedProperties: collectEvaluatedProperties$6, collectEvaluatedItems: collectEvaluatedItems$7 };
|
|
3604
3685
|
|
|
3605
|
-
const { Core: Core$h, Schema: Schema$
|
|
3686
|
+
const { Core: Core$h, Schema: Schema$u, Instance: Instance$m } = lib$1;
|
|
3606
3687
|
|
|
3607
3688
|
|
|
3608
|
-
const compile$
|
|
3609
|
-
if (Schema$
|
|
3610
|
-
const tupleItems = await Schema$
|
|
3689
|
+
const compile$q = async (schema, ast) => {
|
|
3690
|
+
if (Schema$u.typeOf(schema, "array")) {
|
|
3691
|
+
const tupleItems = await Schema$u.map((itemSchema) => Core$h.compileSchema(itemSchema, ast), schema);
|
|
3611
3692
|
return Promise.all(tupleItems);
|
|
3612
3693
|
} else {
|
|
3613
3694
|
return Core$h.compileSchema(schema, ast);
|
|
3614
3695
|
}
|
|
3615
3696
|
};
|
|
3616
3697
|
|
|
3617
|
-
const interpret$
|
|
3618
|
-
if (!Instance$
|
|
3698
|
+
const interpret$q = (items, instance, ast, dynamicAnchors) => {
|
|
3699
|
+
if (!Instance$m.typeOf(instance, "array")) {
|
|
3619
3700
|
return true;
|
|
3620
3701
|
}
|
|
3621
3702
|
|
|
3622
3703
|
if (typeof items === "string") {
|
|
3623
|
-
return Instance$
|
|
3704
|
+
return Instance$m.every((itemValue) => Core$h.interpretSchema(items, itemValue, ast, dynamicAnchors), instance);
|
|
3624
3705
|
} else {
|
|
3625
|
-
return Instance$
|
|
3706
|
+
return Instance$m.every((item, ndx) => !(ndx in items) || Core$h.interpretSchema(items[ndx], item, ast, dynamicAnchors), instance);
|
|
3626
3707
|
}
|
|
3627
3708
|
};
|
|
3628
3709
|
|
|
3629
3710
|
const collectEvaluatedItems$6 = (items, instance, ast, dynamicAnchors) => {
|
|
3630
|
-
return interpret$
|
|
3631
|
-
? new Set(Instance$
|
|
3711
|
+
return interpret$q(items, instance, ast, dynamicAnchors) && (typeof items === "string"
|
|
3712
|
+
? new Set(Instance$m.map((item, itemIndex) => itemIndex, instance))
|
|
3632
3713
|
: new Set(items.map((item, itemIndex) => itemIndex)));
|
|
3633
3714
|
};
|
|
3634
3715
|
|
|
3635
|
-
var items = { compile: compile$
|
|
3716
|
+
var items = { compile: compile$q, interpret: interpret$q, collectEvaluatedItems: collectEvaluatedItems$6 };
|
|
3636
3717
|
|
|
3637
|
-
const { Core: Core$g, Schema: Schema$
|
|
3718
|
+
const { Core: Core$g, Schema: Schema$t, Instance: Instance$l } = lib$1;
|
|
3638
3719
|
|
|
3639
3720
|
|
|
3640
|
-
const compile$
|
|
3641
|
-
const items = await Schema$
|
|
3642
|
-
const numberOfPrefixItems = Schema$
|
|
3721
|
+
const compile$p = async (schema, ast, parentSchema) => {
|
|
3722
|
+
const items = await Schema$t.step("prefixItems", parentSchema);
|
|
3723
|
+
const numberOfPrefixItems = Schema$t.typeOf(items, "array") ? Schema$t.length(items) : 0;
|
|
3643
3724
|
|
|
3644
3725
|
return [numberOfPrefixItems, await Core$g.compileSchema(schema, ast)];
|
|
3645
3726
|
};
|
|
3646
3727
|
|
|
3647
|
-
const interpret$
|
|
3648
|
-
if (!Instance$
|
|
3728
|
+
const interpret$p = ([numberOfPrefixItems, items], instance, ast, dynamicAnchors) => {
|
|
3729
|
+
if (!Instance$l.typeOf(instance, "array")) {
|
|
3649
3730
|
return true;
|
|
3650
3731
|
}
|
|
3651
3732
|
|
|
3652
|
-
return Instance$
|
|
3733
|
+
return Instance$l.every((item, ndx) => ndx < numberOfPrefixItems || Core$g.interpretSchema(items, item, ast, dynamicAnchors), instance);
|
|
3653
3734
|
};
|
|
3654
3735
|
|
|
3655
3736
|
const collectEvaluatedItems$5 = (keywordValue, instance, ast, dynamicAnchors) => {
|
|
3656
|
-
return interpret$
|
|
3737
|
+
return interpret$p(keywordValue, instance, ast, dynamicAnchors) && new Set(Instance$l.map((item, ndx) => ndx, instance));
|
|
3657
3738
|
};
|
|
3658
3739
|
|
|
3659
|
-
var items202012 = { compile: compile$
|
|
3660
|
-
|
|
3661
|
-
const { Schema: Schema$u, Instance: Instance$m } = lib$1;
|
|
3662
|
-
|
|
3663
|
-
|
|
3664
|
-
const compile$q = (schema) => Schema$u.value(schema);
|
|
3665
|
-
const interpret$q = (maxItems, instance) => !Instance$m.typeOf(instance, "array") || Instance$m.length(instance) <= maxItems;
|
|
3666
|
-
|
|
3667
|
-
var maxItems = { compile: compile$q, interpret: interpret$q };
|
|
3668
|
-
|
|
3669
|
-
const { Schema: Schema$t, Instance: Instance$l } = lib$1;
|
|
3670
|
-
|
|
3671
|
-
|
|
3672
|
-
const compile$p = (schema) => Schema$t.value(schema);
|
|
3673
|
-
const interpret$p = (maxLength, instance) => !Instance$l.typeOf(instance, "string") || Instance$l.length(instance) <= maxLength;
|
|
3674
|
-
|
|
3675
|
-
var maxLength = { compile: compile$p, interpret: interpret$p };
|
|
3740
|
+
var items202012 = { compile: compile$p, interpret: interpret$p, collectEvaluatedItems: collectEvaluatedItems$5 };
|
|
3676
3741
|
|
|
3677
3742
|
const { Schema: Schema$s, Instance: Instance$k } = lib$1;
|
|
3678
3743
|
|
|
3679
3744
|
|
|
3680
3745
|
const compile$o = (schema) => Schema$s.value(schema);
|
|
3681
|
-
const interpret$o = (
|
|
3746
|
+
const interpret$o = (maxItems, instance) => !Instance$k.typeOf(instance, "array") || Instance$k.length(instance) <= maxItems;
|
|
3682
3747
|
|
|
3683
|
-
var
|
|
3748
|
+
var maxItems = { compile: compile$o, interpret: interpret$o };
|
|
3684
3749
|
|
|
3685
3750
|
const { Schema: Schema$r, Instance: Instance$j } = lib$1;
|
|
3686
3751
|
|
|
3687
3752
|
|
|
3688
3753
|
const compile$n = (schema) => Schema$r.value(schema);
|
|
3689
|
-
const interpret$n = (
|
|
3754
|
+
const interpret$n = (maxLength, instance) => !Instance$j.typeOf(instance, "string") || [...Instance$j.value(instance)].length <= maxLength;
|
|
3690
3755
|
|
|
3691
|
-
var
|
|
3756
|
+
var maxLength = { compile: compile$n, interpret: interpret$n };
|
|
3692
3757
|
|
|
3693
3758
|
const { Schema: Schema$q, Instance: Instance$i } = lib$1;
|
|
3694
3759
|
|
|
3695
3760
|
|
|
3696
|
-
const compile$m =
|
|
3697
|
-
|
|
3698
|
-
|
|
3761
|
+
const compile$m = (schema) => Schema$q.value(schema);
|
|
3762
|
+
const interpret$m = (maxProperties, instance) => !Instance$i.typeOf(instance, "object") || Instance$i.keys(instance).length <= maxProperties;
|
|
3763
|
+
|
|
3764
|
+
var maxProperties = { compile: compile$m, interpret: interpret$m };
|
|
3765
|
+
|
|
3766
|
+
const { Schema: Schema$p, Instance: Instance$h } = lib$1;
|
|
3767
|
+
|
|
3768
|
+
|
|
3769
|
+
const compile$l = async (schema, ast, parentSchema) => {
|
|
3770
|
+
const exclusiveMaximum = await Schema$p.step("exclusiveMaximum", parentSchema);
|
|
3771
|
+
const isExclusive = Schema$p.value(exclusiveMaximum);
|
|
3699
3772
|
|
|
3700
|
-
return [Schema$
|
|
3773
|
+
return [Schema$p.value(schema), isExclusive];
|
|
3701
3774
|
};
|
|
3702
3775
|
|
|
3703
|
-
const interpret$
|
|
3704
|
-
if (!Instance$
|
|
3776
|
+
const interpret$l = ([maximum, isExclusive], instance) => {
|
|
3777
|
+
if (!Instance$h.typeOf(instance, "number")) {
|
|
3705
3778
|
return true;
|
|
3706
3779
|
}
|
|
3707
3780
|
|
|
3708
|
-
const value = Instance$
|
|
3781
|
+
const value = Instance$h.value(instance);
|
|
3709
3782
|
return isExclusive ? value < maximum : value <= maximum;
|
|
3710
3783
|
};
|
|
3711
3784
|
|
|
3712
|
-
var maximumExclusiveMaximum = { compile: compile$
|
|
3713
|
-
|
|
3714
|
-
const { Schema: Schema$p, Instance: Instance$h } = lib$1;
|
|
3715
|
-
|
|
3716
|
-
|
|
3717
|
-
const compile$l = async (schema) => Schema$p.value(schema);
|
|
3718
|
-
const interpret$l = (maximum, instance) => !Instance$h.typeOf(instance, "number") || Instance$h.value(instance) <= maximum;
|
|
3719
|
-
|
|
3720
|
-
var maximum = { compile: compile$l, interpret: interpret$l };
|
|
3785
|
+
var maximumExclusiveMaximum = { compile: compile$l, interpret: interpret$l };
|
|
3721
3786
|
|
|
3722
3787
|
const { Schema: Schema$o, Instance: Instance$g } = lib$1;
|
|
3723
3788
|
|
|
3724
3789
|
|
|
3725
|
-
const compile$k = (schema) => Schema$o.value(schema);
|
|
3726
|
-
const interpret$k = (
|
|
3790
|
+
const compile$k = async (schema) => Schema$o.value(schema);
|
|
3791
|
+
const interpret$k = (maximum, instance) => !Instance$g.typeOf(instance, "number") || Instance$g.value(instance) <= maximum;
|
|
3727
3792
|
|
|
3728
|
-
var
|
|
3793
|
+
var maximum = { compile: compile$k, interpret: interpret$k };
|
|
3729
3794
|
|
|
3730
3795
|
const { Schema: Schema$n, Instance: Instance$f } = lib$1;
|
|
3731
3796
|
|
|
3732
3797
|
|
|
3733
3798
|
const compile$j = (schema) => Schema$n.value(schema);
|
|
3734
|
-
const interpret$j = (
|
|
3799
|
+
const interpret$j = (minItems, instance) => !Instance$f.typeOf(instance, "array") || Instance$f.length(instance) >= minItems;
|
|
3735
3800
|
|
|
3736
|
-
var
|
|
3801
|
+
var minItems = { compile: compile$j, interpret: interpret$j };
|
|
3737
3802
|
|
|
3738
3803
|
const { Schema: Schema$m, Instance: Instance$e } = lib$1;
|
|
3739
3804
|
|
|
@@ -3741,7 +3806,7 @@ define(['exports'], (function (exports) { 'use strict';
|
|
|
3741
3806
|
const compile$i = (schema) => Schema$m.value(schema);
|
|
3742
3807
|
const interpret$i = (minLength, instance) => !Instance$e.typeOf(instance, "string") || [...Instance$e.value(instance)].length >= minLength;
|
|
3743
3808
|
|
|
3744
|
-
var
|
|
3809
|
+
var minLength = { compile: compile$i, interpret: interpret$i };
|
|
3745
3810
|
|
|
3746
3811
|
const { Schema: Schema$l, Instance: Instance$d } = lib$1;
|
|
3747
3812
|
|
|
@@ -4115,14 +4180,12 @@ define(['exports'], (function (exports) { 'use strict';
|
|
|
4115
4180
|
items202012: items202012,
|
|
4116
4181
|
maxItems: maxItems,
|
|
4117
4182
|
maxLength: maxLength,
|
|
4118
|
-
maxLength6: maxLength6,
|
|
4119
4183
|
maxProperties: maxProperties,
|
|
4120
4184
|
maximumExclusiveMaximum: maximumExclusiveMaximum,
|
|
4121
4185
|
maximum: maximum,
|
|
4122
4186
|
metaData: Keywords$1.metaData,
|
|
4123
4187
|
minItems: minItems,
|
|
4124
4188
|
minLength: minLength,
|
|
4125
|
-
minLength6: minLength6,
|
|
4126
4189
|
minProperties: minProperties,
|
|
4127
4190
|
minimumExclusiveMinimum: minimumExclusiveMinimum,
|
|
4128
4191
|
minimum: minimum,
|
|
@@ -4528,11 +4591,11 @@ define(['exports'], (function (exports) { 'use strict';
|
|
|
4528
4591
|
"format": keywords$3.metaData,
|
|
4529
4592
|
"items": keywords$3.items,
|
|
4530
4593
|
"maxItems": keywords$3.maxItems,
|
|
4531
|
-
"maxLength": keywords$3.
|
|
4594
|
+
"maxLength": keywords$3.maxLength,
|
|
4532
4595
|
"maxProperties": keywords$3.maxProperties,
|
|
4533
4596
|
"maximum": keywords$3.maximum,
|
|
4534
4597
|
"minItems": keywords$3.minItems,
|
|
4535
|
-
"minLength": keywords$3.
|
|
4598
|
+
"minLength": keywords$3.minLength,
|
|
4536
4599
|
"minProperties": keywords$3.minProperties,
|
|
4537
4600
|
"minimum": keywords$3.minimum,
|
|
4538
4601
|
"multipleOf": keywords$3.multipleOf,
|
|
@@ -4755,11 +4818,11 @@ define(['exports'], (function (exports) { 'use strict';
|
|
|
4755
4818
|
"else": keywords$2.else,
|
|
4756
4819
|
"items": keywords$2.items,
|
|
4757
4820
|
"maxItems": keywords$2.maxItems,
|
|
4758
|
-
"maxLength": keywords$2.
|
|
4821
|
+
"maxLength": keywords$2.maxLength,
|
|
4759
4822
|
"maxProperties": keywords$2.maxProperties,
|
|
4760
4823
|
"maximum": keywords$2.maximum,
|
|
4761
4824
|
"minItems": keywords$2.minItems,
|
|
4762
|
-
"minLength": keywords$2.
|
|
4825
|
+
"minLength": keywords$2.minLength,
|
|
4763
4826
|
"minProperties": keywords$2.minProperties,
|
|
4764
4827
|
"minimum": keywords$2.minimum,
|
|
4765
4828
|
"multipleOf": keywords$2.multipleOf,
|
|
@@ -5163,11 +5226,11 @@ define(['exports'], (function (exports) { 'use strict';
|
|
|
5163
5226
|
"exclusiveMaximum": keywords$1.exclusiveMaximum,
|
|
5164
5227
|
"exclusiveMinimum": keywords$1.exclusiveMinimum,
|
|
5165
5228
|
"maxItems": keywords$1.maxItems,
|
|
5166
|
-
"maxLength": keywords$1.
|
|
5229
|
+
"maxLength": keywords$1.maxLength,
|
|
5167
5230
|
"maxProperties": keywords$1.maxProperties,
|
|
5168
5231
|
"maximum": keywords$1.maximum,
|
|
5169
5232
|
"minItems": keywords$1.minItems,
|
|
5170
|
-
"minLength": keywords$1.
|
|
5233
|
+
"minLength": keywords$1.minLength,
|
|
5171
5234
|
"minProperties": keywords$1.minProperties,
|
|
5172
5235
|
"minimum": keywords$1.minimum,
|
|
5173
5236
|
"multipleOf": keywords$1.multipleOf,
|
|
@@ -5610,11 +5673,11 @@ define(['exports'], (function (exports) { 'use strict';
|
|
|
5610
5673
|
"exclusiveMaximum": keywords.exclusiveMaximum,
|
|
5611
5674
|
"exclusiveMinimum": keywords.exclusiveMinimum,
|
|
5612
5675
|
"maxItems": keywords.maxItems,
|
|
5613
|
-
"maxLength": keywords.
|
|
5676
|
+
"maxLength": keywords.maxLength,
|
|
5614
5677
|
"maxProperties": keywords.maxProperties,
|
|
5615
5678
|
"maximum": keywords.maximum,
|
|
5616
5679
|
"minItems": keywords.minItems,
|
|
5617
|
-
"minLength": keywords.
|
|
5680
|
+
"minLength": keywords.minLength,
|
|
5618
5681
|
"minProperties": keywords.minProperties,
|
|
5619
5682
|
"minimum": keywords.minimum,
|
|
5620
5683
|
"multipleOf": keywords.multipleOf,
|