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