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