@hyperjump/json-schema 0.23.1 → 0.23.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/json-schema-amd.js +495 -762
- package/dist/json-schema-amd.js.map +1 -1
- package/dist/json-schema-amd.min.js +1 -1
- package/dist/json-schema-amd.min.js.map +1 -1
- package/dist/json-schema-cjs.js +495 -762
- package/dist/json-schema-cjs.js.map +1 -1
- package/dist/json-schema-cjs.min.js +1 -1
- package/dist/json-schema-cjs.min.js.map +1 -1
- package/dist/json-schema-esm.js +495 -762
- package/dist/json-schema-esm.js.map +1 -1
- package/dist/json-schema-esm.min.js +1 -1
- package/dist/json-schema-esm.min.js.map +1 -1
- package/dist/json-schema-iife.js +495 -762
- package/dist/json-schema-iife.js.map +1 -1
- package/dist/json-schema-iife.min.js +1 -1
- package/dist/json-schema-iife.min.js.map +1 -1
- package/dist/json-schema-system.js +495 -762
- package/dist/json-schema-system.js.map +1 -1
- package/dist/json-schema-system.min.js +1 -1
- package/dist/json-schema-system.min.js.map +1 -1
- package/dist/json-schema-umd.js +495 -762
- 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/common.d.ts +1 -0
- package/lib/draft-04.d.ts +3 -2
- package/lib/draft-06.d.ts +3 -2
- package/lib/draft-06.js +2 -2
- package/lib/draft-07.d.ts +3 -2
- package/lib/draft-07.js +2 -2
- package/lib/draft-2019-09.d.ts +3 -2
- package/lib/draft-2019-09.js +2 -2
- package/lib/draft-2020-12.d.ts +3 -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 +1 -1
- package/lib/keywords/maxLength6.js +0 -7
- package/lib/keywords/minLength6.js +0 -7
package/dist/json-schema-cjs.js
CHANGED
|
@@ -4,7 +4,7 @@ Object.defineProperty(exports, '__esModule', { value: true });
|
|
|
4
4
|
|
|
5
5
|
var commonjsGlobal = typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {};
|
|
6
6
|
|
|
7
|
-
var justCurryIt$
|
|
7
|
+
var justCurryIt$1 = curry$b;
|
|
8
8
|
|
|
9
9
|
/*
|
|
10
10
|
function add(a, b, c) {
|
|
@@ -29,7 +29,7 @@ var justCurryIt$2 = curry$j;
|
|
|
29
29
|
milesToKm(10); // 16.2
|
|
30
30
|
*/
|
|
31
31
|
|
|
32
|
-
function curry$
|
|
32
|
+
function curry$b(fn, arity) {
|
|
33
33
|
return function curried() {
|
|
34
34
|
if (arity == null) {
|
|
35
35
|
arity = fn.length;
|
|
@@ -1900,84 +1900,91 @@ const pathRelative$1 = (from, to) => {
|
|
|
1900
1900
|
|
|
1901
1901
|
var common$1 = { jsonTypeOf: jsonTypeOf$2, resolveUrl: resolveUrl$3, urlFragment: urlFragment$1, pathRelative: pathRelative$1 };
|
|
1902
1902
|
|
|
1903
|
-
const curry$
|
|
1903
|
+
const curry$a = justCurryIt$1;
|
|
1904
1904
|
|
|
1905
1905
|
|
|
1906
|
-
const nil$
|
|
1906
|
+
const nil$2 = "";
|
|
1907
1907
|
|
|
1908
|
-
const compile$
|
|
1908
|
+
const compile$N = (pointer) => {
|
|
1909
1909
|
if (pointer.length > 0 && pointer[0] !== "/") {
|
|
1910
1910
|
throw Error("Invalid JSON Pointer");
|
|
1911
1911
|
}
|
|
1912
1912
|
|
|
1913
|
-
return pointer.split("/").slice(1).map(unescape
|
|
1913
|
+
return pointer.split("/").slice(1).map(unescape);
|
|
1914
1914
|
};
|
|
1915
1915
|
|
|
1916
|
-
const get$
|
|
1917
|
-
const ptr = compile$
|
|
1916
|
+
const get$2 = (pointer, value = undefined) => {
|
|
1917
|
+
const ptr = compile$N(pointer);
|
|
1918
1918
|
|
|
1919
1919
|
const fn = (value) => ptr.reduce(([value, pointer], segment) => {
|
|
1920
|
-
return [applySegment
|
|
1920
|
+
return [applySegment(value, segment, pointer), append(segment, pointer)];
|
|
1921
1921
|
}, [value, ""])[0];
|
|
1922
1922
|
|
|
1923
1923
|
return value === undefined ? fn : fn(value);
|
|
1924
1924
|
};
|
|
1925
1925
|
|
|
1926
|
-
const set
|
|
1927
|
-
const ptr = compile$
|
|
1928
|
-
const fn = curry$
|
|
1926
|
+
const set = (pointer, subject = undefined, value = undefined) => {
|
|
1927
|
+
const ptr = compile$N(pointer);
|
|
1928
|
+
const fn = curry$a((subject, value) => _set(ptr, subject, value, nil$2));
|
|
1929
1929
|
return subject === undefined ? fn : fn(subject, value);
|
|
1930
1930
|
};
|
|
1931
1931
|
|
|
1932
|
-
const _set
|
|
1932
|
+
const _set = (pointer, subject, value, cursor) => {
|
|
1933
1933
|
if (pointer.length === 0) {
|
|
1934
1934
|
return value;
|
|
1935
1935
|
} else if (pointer.length > 1) {
|
|
1936
|
-
|
|
1937
|
-
|
|
1936
|
+
if (Array.isArray(subject)) {
|
|
1937
|
+
const index = pointer.shift();
|
|
1938
|
+
const clonedSubject = [...subject];
|
|
1939
|
+
clonedSubject[index] = _set(pointer, applySegment(subject, index, cursor), value, append(index, cursor));
|
|
1940
|
+
return clonedSubject;
|
|
1941
|
+
} else {
|
|
1942
|
+
const segment = pointer.shift();
|
|
1943
|
+
return { ...subject, [segment]: _set(pointer, applySegment(subject, segment, cursor), value, append(segment, cursor)) };
|
|
1944
|
+
}
|
|
1938
1945
|
} else if (Array.isArray(subject)) {
|
|
1939
1946
|
const clonedSubject = [...subject];
|
|
1940
|
-
const segment = computeSegment
|
|
1947
|
+
const segment = computeSegment(subject, pointer[0]);
|
|
1941
1948
|
clonedSubject[segment] = value;
|
|
1942
1949
|
return clonedSubject;
|
|
1943
1950
|
} else if (typeof subject === "object" && subject !== null) {
|
|
1944
1951
|
return { ...subject, [pointer[0]]: value };
|
|
1945
1952
|
} else {
|
|
1946
|
-
return applySegment
|
|
1953
|
+
return applySegment(subject, pointer[0], cursor);
|
|
1947
1954
|
}
|
|
1948
1955
|
};
|
|
1949
1956
|
|
|
1950
|
-
const assign
|
|
1951
|
-
const ptr = compile$
|
|
1952
|
-
const fn = curry$
|
|
1957
|
+
const assign = (pointer, subject = undefined, value = undefined) => {
|
|
1958
|
+
const ptr = compile$N(pointer);
|
|
1959
|
+
const fn = curry$a((subject, value) => _assign(ptr, subject, value, nil$2));
|
|
1953
1960
|
return subject === undefined ? fn : fn(subject, value);
|
|
1954
1961
|
};
|
|
1955
1962
|
|
|
1956
|
-
const _assign
|
|
1963
|
+
const _assign = (pointer, subject, value, cursor) => {
|
|
1957
1964
|
if (pointer.length === 0) {
|
|
1958
1965
|
return;
|
|
1959
|
-
} else if (pointer.length === 1 && !isScalar
|
|
1960
|
-
const segment = computeSegment
|
|
1966
|
+
} else if (pointer.length === 1 && !isScalar(subject)) {
|
|
1967
|
+
const segment = computeSegment(subject, pointer[0]);
|
|
1961
1968
|
subject[segment] = value;
|
|
1962
1969
|
} else {
|
|
1963
1970
|
const segment = pointer.shift();
|
|
1964
|
-
_assign
|
|
1971
|
+
_assign(pointer, applySegment(subject, segment, cursor), value, append(segment, cursor));
|
|
1965
1972
|
}
|
|
1966
1973
|
};
|
|
1967
1974
|
|
|
1968
|
-
const unset
|
|
1969
|
-
const ptr = compile$
|
|
1970
|
-
const fn = (subject) => _unset
|
|
1975
|
+
const unset = (pointer, subject = undefined) => {
|
|
1976
|
+
const ptr = compile$N(pointer);
|
|
1977
|
+
const fn = (subject) => _unset(ptr, subject, nil$2);
|
|
1971
1978
|
return subject === undefined ? fn : fn(subject);
|
|
1972
1979
|
};
|
|
1973
1980
|
|
|
1974
|
-
const _unset
|
|
1981
|
+
const _unset = (pointer, subject, cursor) => {
|
|
1975
1982
|
if (pointer.length == 0) {
|
|
1976
1983
|
return undefined;
|
|
1977
1984
|
} else if (pointer.length > 1) {
|
|
1978
1985
|
const segment = pointer.shift();
|
|
1979
|
-
const value = applySegment
|
|
1980
|
-
return { ...subject, [segment]: _unset
|
|
1986
|
+
const value = applySegment(subject, segment, cursor);
|
|
1987
|
+
return { ...subject, [segment]: _unset(pointer, value, append(segment, cursor)) };
|
|
1981
1988
|
} else if (Array.isArray(subject)) {
|
|
1982
1989
|
return subject.filter((_, ndx) => ndx != pointer[0]);
|
|
1983
1990
|
} else if (typeof subject === "object" && subject !== null) {
|
|
@@ -1985,54 +1992,54 @@ const _unset$1 = (pointer, subject, cursor) => {
|
|
|
1985
1992
|
const { [pointer[0]]: _, ...result } = subject;
|
|
1986
1993
|
return result;
|
|
1987
1994
|
} else {
|
|
1988
|
-
return applySegment
|
|
1995
|
+
return applySegment(subject, pointer[0], cursor);
|
|
1989
1996
|
}
|
|
1990
1997
|
};
|
|
1991
1998
|
|
|
1992
|
-
const remove
|
|
1993
|
-
const ptr = compile$
|
|
1994
|
-
const fn = (subject) => _remove
|
|
1999
|
+
const remove = (pointer, subject = undefined) => {
|
|
2000
|
+
const ptr = compile$N(pointer);
|
|
2001
|
+
const fn = (subject) => _remove(ptr, subject, nil$2);
|
|
1995
2002
|
return subject === undefined ? fn : fn(subject);
|
|
1996
2003
|
};
|
|
1997
2004
|
|
|
1998
|
-
const _remove
|
|
2005
|
+
const _remove = (pointer, subject, cursor) => {
|
|
1999
2006
|
if (pointer.length === 0) {
|
|
2000
2007
|
return;
|
|
2001
2008
|
} else if (pointer.length > 1) {
|
|
2002
2009
|
const segment = pointer.shift();
|
|
2003
|
-
const value = applySegment
|
|
2004
|
-
_remove
|
|
2010
|
+
const value = applySegment(subject, segment, cursor);
|
|
2011
|
+
_remove(pointer, value, append(segment, cursor));
|
|
2005
2012
|
} else if (Array.isArray(subject)) {
|
|
2006
2013
|
subject.splice(pointer[0], 1);
|
|
2007
2014
|
} else if (typeof subject === "object" && subject !== null) {
|
|
2008
2015
|
delete subject[pointer[0]];
|
|
2009
2016
|
} else {
|
|
2010
|
-
applySegment
|
|
2017
|
+
applySegment(subject, pointer[0], cursor);
|
|
2011
2018
|
}
|
|
2012
2019
|
};
|
|
2013
2020
|
|
|
2014
|
-
const append
|
|
2021
|
+
const append = curry$a((segment, pointer) => pointer + "/" + escape$1(segment));
|
|
2015
2022
|
|
|
2016
|
-
const escape$
|
|
2017
|
-
const unescape
|
|
2018
|
-
const computeSegment
|
|
2023
|
+
const escape$1 = (segment) => segment.toString().replace(/~/g, "~0").replace(/\//g, "~1");
|
|
2024
|
+
const unescape = (segment) => segment.toString().replace(/~1/g, "/").replace(/~0/g, "~");
|
|
2025
|
+
const computeSegment = (value, segment) => Array.isArray(value) && segment === "-" ? value.length : segment;
|
|
2019
2026
|
|
|
2020
|
-
const applySegment
|
|
2027
|
+
const applySegment = (value, segment, cursor = "") => {
|
|
2021
2028
|
if (value === undefined) {
|
|
2022
2029
|
throw TypeError(`Value at '${cursor}' is undefined and does not have property '${segment}'`);
|
|
2023
2030
|
} else if (value === null) {
|
|
2024
2031
|
throw TypeError(`Value at '${cursor}' is null and does not have property '${segment}'`);
|
|
2025
|
-
} else if (isScalar
|
|
2032
|
+
} else if (isScalar(value)) {
|
|
2026
2033
|
throw TypeError(`Value at '${cursor}' is a ${typeof value} and does not have property '${segment}'`);
|
|
2027
2034
|
} else {
|
|
2028
|
-
const computedSegment = computeSegment
|
|
2035
|
+
const computedSegment = computeSegment(value, segment);
|
|
2029
2036
|
return value[computedSegment];
|
|
2030
2037
|
}
|
|
2031
2038
|
};
|
|
2032
2039
|
|
|
2033
|
-
const isScalar
|
|
2040
|
+
const isScalar = (value) => value === null || typeof value !== "object";
|
|
2034
2041
|
|
|
2035
|
-
var lib$
|
|
2042
|
+
var lib$4 = { nil: nil$2, append, get: get$2, set, assign, unset, remove };
|
|
2036
2043
|
|
|
2037
2044
|
const $__value = Symbol("$__value");
|
|
2038
2045
|
const $__href = Symbol("$__href");
|
|
@@ -2048,16 +2055,16 @@ const value$2 = (ref) => ref[$__value];
|
|
|
2048
2055
|
|
|
2049
2056
|
var reference = { cons: cons$1, isReference, href, value: value$2 };
|
|
2050
2057
|
|
|
2051
|
-
const JsonPointer$3 = lib$
|
|
2052
|
-
const curry$
|
|
2058
|
+
const JsonPointer$3 = lib$4;
|
|
2059
|
+
const curry$9 = justCurryIt$1;
|
|
2053
2060
|
const { resolveUrl: resolveUrl$2, jsonTypeOf: jsonTypeOf$1 } = common$1;
|
|
2054
2061
|
const Reference$2 = reference;
|
|
2055
2062
|
|
|
2056
2063
|
|
|
2057
|
-
const nil$
|
|
2058
|
-
const cons = (instance, id = "") => Object.freeze({ ...nil$
|
|
2064
|
+
const nil$1 = Object.freeze({ id: "", pointer: "", instance: undefined, value: undefined });
|
|
2065
|
+
const cons = (instance, id = "") => Object.freeze({ ...nil$1, id: resolveUrl$2(id, ""), instance, value: instance });
|
|
2059
2066
|
|
|
2060
|
-
const get$
|
|
2067
|
+
const get$1 = (url, instance = nil$1) => {
|
|
2061
2068
|
if (!url.startsWith("#")) {
|
|
2062
2069
|
throw Error(`No JSON document found at '${url.split("#")[0]}'`);
|
|
2063
2070
|
}
|
|
@@ -2068,7 +2075,7 @@ const get$2 = (url, instance = nil$2) => {
|
|
|
2068
2075
|
const uri$1 = (doc) => `${doc.id}#${encodeURI(doc.pointer)}`;
|
|
2069
2076
|
const value$1 = (doc) => Reference$2.isReference(doc.value) ? Reference$2.value(doc.value) : doc.value;
|
|
2070
2077
|
const has$1 = (key, doc) => key in value$1(doc);
|
|
2071
|
-
const typeOf$1 = curry$
|
|
2078
|
+
const typeOf$1 = curry$9((doc, type) => jsonTypeOf$1(value$1(doc), type));
|
|
2072
2079
|
|
|
2073
2080
|
const step$1 = (key, doc) => Object.freeze({
|
|
2074
2081
|
...doc,
|
|
@@ -2076,118 +2083,40 @@ const step$1 = (key, doc) => Object.freeze({
|
|
|
2076
2083
|
value: value$1(doc)[key]
|
|
2077
2084
|
});
|
|
2078
2085
|
|
|
2079
|
-
const entries$
|
|
2086
|
+
const entries$3 = (doc) => Object.keys(value$1(doc))
|
|
2080
2087
|
.map((key) => [key, step$1(key, doc)]);
|
|
2081
2088
|
|
|
2082
2089
|
const keys$1 = (doc) => Object.keys(value$1(doc));
|
|
2083
2090
|
|
|
2084
|
-
const map$
|
|
2091
|
+
const map$4 = curry$9((fn, doc) => value$1(doc)
|
|
2085
2092
|
.map((item, ndx, array, thisArg) => fn(step$1(ndx, doc), ndx, array, thisArg)));
|
|
2086
2093
|
|
|
2087
|
-
const forEach = curry$
|
|
2094
|
+
const forEach = curry$9((fn, doc) => value$1(doc)
|
|
2088
2095
|
.forEach((item, ndx, array, thisArg) => fn(step$1(ndx, doc), ndx, array, thisArg)));
|
|
2089
2096
|
|
|
2090
|
-
const filter$
|
|
2097
|
+
const filter$1 = curry$9((fn, doc) => value$1(doc)
|
|
2091
2098
|
.map((item, ndx, array, thisArg) => step$1(ndx, doc))
|
|
2092
2099
|
.filter((item, ndx, array, thisArg) => fn(item, ndx, array, thisArg)));
|
|
2093
2100
|
|
|
2094
|
-
const reduce$
|
|
2101
|
+
const reduce$3 = curry$9((fn, acc, doc) => value$1(doc)
|
|
2095
2102
|
.reduce((acc, item, ndx) => fn(acc, step$1(ndx, doc), ndx), acc));
|
|
2096
2103
|
|
|
2097
|
-
const every$
|
|
2104
|
+
const every$1 = curry$9((fn, doc) => value$1(doc)
|
|
2098
2105
|
.every((item, ndx, array, thisArg) => fn(step$1(ndx, doc), ndx, array, thisArg)));
|
|
2099
2106
|
|
|
2100
|
-
const some$
|
|
2107
|
+
const some$1 = curry$9((fn, doc) => value$1(doc)
|
|
2101
2108
|
.some((item, ndx, array, thisArg) => fn(step$1(ndx, doc), ndx, array, thisArg)));
|
|
2102
2109
|
|
|
2103
2110
|
const length$1 = (doc) => value$1(doc).length;
|
|
2104
2111
|
|
|
2105
2112
|
var instance = {
|
|
2106
|
-
nil: nil$
|
|
2107
|
-
step: step$1, entries: entries$
|
|
2113
|
+
nil: nil$1, cons, get: get$1, uri: uri$1, value: value$1, has: has$1, typeOf: typeOf$1, length: length$1,
|
|
2114
|
+
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
|
|
2108
2115
|
};
|
|
2109
2116
|
|
|
2110
|
-
var entries$
|
|
2111
|
-
|
|
2112
|
-
const curry$g = justCurryIt$2;
|
|
2113
|
-
|
|
2114
|
-
|
|
2115
|
-
var map$6 = curry$g(async (fn, doc) => (await doc).map(fn));
|
|
2117
|
+
var entries$2 = async (doc) => Object.entries(await doc);
|
|
2116
2118
|
|
|
2117
|
-
|
|
2118
|
-
|
|
2119
|
-
|
|
2120
|
-
var reduce$5 = curry$f(async (fn, acc, doc) => {
|
|
2121
|
-
return (await doc).reduce(async (acc, item) => fn(await acc, item), acc);
|
|
2122
|
-
});
|
|
2123
|
-
|
|
2124
|
-
const curry$e = justCurryIt$2;
|
|
2125
|
-
const reduce$4 = reduce$5;
|
|
2126
|
-
|
|
2127
|
-
|
|
2128
|
-
var filter$1 = curry$e(async (fn, doc, options = {}) => {
|
|
2129
|
-
return reduce$4(async (acc, item) => {
|
|
2130
|
-
return (await fn(item)) ? acc.concat([item]) : acc;
|
|
2131
|
-
}, [], doc, options);
|
|
2132
|
-
});
|
|
2133
|
-
|
|
2134
|
-
const curry$d = justCurryIt$2;
|
|
2135
|
-
const map$5 = map$6;
|
|
2136
|
-
|
|
2137
|
-
|
|
2138
|
-
var some$1 = curry$d(async (fn, doc) => {
|
|
2139
|
-
const results = await map$5(fn, doc);
|
|
2140
|
-
return (await Promise.all(results))
|
|
2141
|
-
.some((a) => a);
|
|
2142
|
-
});
|
|
2143
|
-
|
|
2144
|
-
const curry$c = justCurryIt$2;
|
|
2145
|
-
const map$4 = map$6;
|
|
2146
|
-
|
|
2147
|
-
|
|
2148
|
-
var every$1 = curry$c(async (fn, doc) => {
|
|
2149
|
-
const results = await map$4(fn, doc);
|
|
2150
|
-
return (await Promise.all(results))
|
|
2151
|
-
.every((a) => a);
|
|
2152
|
-
});
|
|
2153
|
-
|
|
2154
|
-
const curry$b = justCurryIt$2;
|
|
2155
|
-
|
|
2156
|
-
|
|
2157
|
-
var pipeline$3 = curry$b((fns, doc) => {
|
|
2158
|
-
return fns.reduce(async (acc, fn) => fn(await acc), doc);
|
|
2159
|
-
});
|
|
2160
|
-
|
|
2161
|
-
var all$1 = (doc) => Promise.all(doc);
|
|
2162
|
-
|
|
2163
|
-
const pipeline$2 = pipeline$3;
|
|
2164
|
-
const entries$3 = entries$4;
|
|
2165
|
-
const reduce$3 = reduce$5;
|
|
2166
|
-
|
|
2167
|
-
|
|
2168
|
-
var allValues$1 = (doc) => {
|
|
2169
|
-
return pipeline$2([
|
|
2170
|
-
entries$3,
|
|
2171
|
-
reduce$3(async (acc, [propertyName, propertyValue]) => {
|
|
2172
|
-
acc[propertyName] = await propertyValue;
|
|
2173
|
-
return acc;
|
|
2174
|
-
}, {})
|
|
2175
|
-
], doc);
|
|
2176
|
-
};
|
|
2177
|
-
|
|
2178
|
-
var lib$5 = {
|
|
2179
|
-
entries: entries$4,
|
|
2180
|
-
map: map$6,
|
|
2181
|
-
filter: filter$1,
|
|
2182
|
-
reduce: reduce$5,
|
|
2183
|
-
some: some$1,
|
|
2184
|
-
every: every$1,
|
|
2185
|
-
pipeline: pipeline$3,
|
|
2186
|
-
all: all$1,
|
|
2187
|
-
allValues: allValues$1
|
|
2188
|
-
};
|
|
2189
|
-
|
|
2190
|
-
var justCurryIt$1 = curry$a;
|
|
2119
|
+
var justCurryIt = curry$8;
|
|
2191
2120
|
|
|
2192
2121
|
/*
|
|
2193
2122
|
function add(a, b, c) {
|
|
@@ -2212,7 +2141,7 @@ var justCurryIt$1 = curry$a;
|
|
|
2212
2141
|
milesToKm(10); // 16.2
|
|
2213
2142
|
*/
|
|
2214
2143
|
|
|
2215
|
-
function curry$
|
|
2144
|
+
function curry$8(fn, arity) {
|
|
2216
2145
|
return function curried() {
|
|
2217
2146
|
if (arity == null) {
|
|
2218
2147
|
arity = fn.length;
|
|
@@ -2228,146 +2157,83 @@ function curry$a(fn, arity) {
|
|
|
2228
2157
|
};
|
|
2229
2158
|
}
|
|
2230
2159
|
|
|
2231
|
-
const curry$
|
|
2160
|
+
const curry$7 = justCurryIt;
|
|
2232
2161
|
|
|
2233
2162
|
|
|
2234
|
-
|
|
2163
|
+
var map$3 = curry$7(async (fn, doc) => (await doc).map(fn));
|
|
2235
2164
|
|
|
2236
|
-
const
|
|
2237
|
-
if (pointer.length > 0 && pointer[0] !== "/") {
|
|
2238
|
-
throw Error("Invalid JSON Pointer");
|
|
2239
|
-
}
|
|
2165
|
+
const curry$6 = justCurryIt;
|
|
2240
2166
|
|
|
2241
|
-
return pointer.split("/").slice(1).map(unescape);
|
|
2242
|
-
};
|
|
2243
2167
|
|
|
2244
|
-
|
|
2245
|
-
|
|
2168
|
+
var reduce$2 = curry$6(async (fn, acc, doc) => {
|
|
2169
|
+
return (await doc).reduce(async (acc, item) => fn(await acc, item), acc);
|
|
2170
|
+
});
|
|
2246
2171
|
|
|
2247
|
-
|
|
2248
|
-
|
|
2249
|
-
}, [value, ""])[0];
|
|
2172
|
+
const curry$5 = justCurryIt;
|
|
2173
|
+
const reduce$1 = reduce$2;
|
|
2250
2174
|
|
|
2251
|
-
return value === undefined ? fn : fn(value);
|
|
2252
|
-
};
|
|
2253
2175
|
|
|
2254
|
-
|
|
2255
|
-
|
|
2256
|
-
|
|
2257
|
-
|
|
2258
|
-
};
|
|
2176
|
+
var filter = curry$5(async (fn, doc, options = {}) => {
|
|
2177
|
+
return reduce$1(async (acc, item) => {
|
|
2178
|
+
return (await fn(item)) ? acc.concat([item]) : acc;
|
|
2179
|
+
}, [], doc, options);
|
|
2180
|
+
});
|
|
2259
2181
|
|
|
2260
|
-
const
|
|
2261
|
-
|
|
2262
|
-
return value;
|
|
2263
|
-
} else if (pointer.length > 1) {
|
|
2264
|
-
if (Array.isArray(subject)) {
|
|
2265
|
-
const index = pointer.shift();
|
|
2266
|
-
const clonedSubject = [...subject];
|
|
2267
|
-
clonedSubject[index] = _set(pointer, applySegment(subject, index, cursor), value, append(index, cursor));
|
|
2268
|
-
return clonedSubject;
|
|
2269
|
-
} else {
|
|
2270
|
-
const segment = pointer.shift();
|
|
2271
|
-
return { ...subject, [segment]: _set(pointer, applySegment(subject, segment, cursor), value, append(segment, cursor)) };
|
|
2272
|
-
}
|
|
2273
|
-
} else if (Array.isArray(subject)) {
|
|
2274
|
-
const clonedSubject = [...subject];
|
|
2275
|
-
const segment = computeSegment(subject, pointer[0]);
|
|
2276
|
-
clonedSubject[segment] = value;
|
|
2277
|
-
return clonedSubject;
|
|
2278
|
-
} else if (typeof subject === "object" && subject !== null) {
|
|
2279
|
-
return { ...subject, [pointer[0]]: value };
|
|
2280
|
-
} else {
|
|
2281
|
-
return applySegment(subject, pointer[0], cursor);
|
|
2282
|
-
}
|
|
2283
|
-
};
|
|
2182
|
+
const curry$4 = justCurryIt;
|
|
2183
|
+
const map$2 = map$3;
|
|
2284
2184
|
|
|
2285
|
-
const assign = (pointer, subject = undefined, value = undefined) => {
|
|
2286
|
-
const ptr = compile$P(pointer);
|
|
2287
|
-
const fn = curry$9((subject, value) => _assign(ptr, subject, value, nil$1));
|
|
2288
|
-
return subject === undefined ? fn : fn(subject, value);
|
|
2289
|
-
};
|
|
2290
2185
|
|
|
2291
|
-
|
|
2292
|
-
|
|
2293
|
-
|
|
2294
|
-
|
|
2295
|
-
|
|
2296
|
-
subject[segment] = value;
|
|
2297
|
-
} else {
|
|
2298
|
-
const segment = pointer.shift();
|
|
2299
|
-
_assign(pointer, applySegment(subject, segment, cursor), value, append(segment, cursor));
|
|
2300
|
-
}
|
|
2301
|
-
};
|
|
2186
|
+
var some = curry$4(async (fn, doc) => {
|
|
2187
|
+
const results = await map$2(fn, doc);
|
|
2188
|
+
return (await Promise.all(results))
|
|
2189
|
+
.some((a) => a);
|
|
2190
|
+
});
|
|
2302
2191
|
|
|
2303
|
-
const
|
|
2304
|
-
|
|
2305
|
-
const fn = (subject) => _unset(ptr, subject, nil$1);
|
|
2306
|
-
return subject === undefined ? fn : fn(subject);
|
|
2307
|
-
};
|
|
2192
|
+
const curry$3 = justCurryIt;
|
|
2193
|
+
const map$1 = map$3;
|
|
2308
2194
|
|
|
2309
|
-
const _unset = (pointer, subject, cursor) => {
|
|
2310
|
-
if (pointer.length == 0) {
|
|
2311
|
-
return undefined;
|
|
2312
|
-
} else if (pointer.length > 1) {
|
|
2313
|
-
const segment = pointer.shift();
|
|
2314
|
-
const value = applySegment(subject, segment, cursor);
|
|
2315
|
-
return { ...subject, [segment]: _unset(pointer, value, append(segment, cursor)) };
|
|
2316
|
-
} else if (Array.isArray(subject)) {
|
|
2317
|
-
return subject.filter((_, ndx) => ndx != pointer[0]);
|
|
2318
|
-
} else if (typeof subject === "object" && subject !== null) {
|
|
2319
|
-
// eslint-disable-next-line no-unused-vars
|
|
2320
|
-
const { [pointer[0]]: _, ...result } = subject;
|
|
2321
|
-
return result;
|
|
2322
|
-
} else {
|
|
2323
|
-
return applySegment(subject, pointer[0], cursor);
|
|
2324
|
-
}
|
|
2325
|
-
};
|
|
2326
2195
|
|
|
2327
|
-
|
|
2328
|
-
const
|
|
2329
|
-
|
|
2330
|
-
|
|
2331
|
-
};
|
|
2196
|
+
var every = curry$3(async (fn, doc) => {
|
|
2197
|
+
const results = await map$1(fn, doc);
|
|
2198
|
+
return (await Promise.all(results))
|
|
2199
|
+
.every((a) => a);
|
|
2200
|
+
});
|
|
2332
2201
|
|
|
2333
|
-
const
|
|
2334
|
-
if (pointer.length === 0) {
|
|
2335
|
-
return;
|
|
2336
|
-
} else if (pointer.length > 1) {
|
|
2337
|
-
const segment = pointer.shift();
|
|
2338
|
-
const value = applySegment(subject, segment, cursor);
|
|
2339
|
-
_remove(pointer, value, append(segment, cursor));
|
|
2340
|
-
} else if (Array.isArray(subject)) {
|
|
2341
|
-
subject.splice(pointer[0], 1);
|
|
2342
|
-
} else if (typeof subject === "object" && subject !== null) {
|
|
2343
|
-
delete subject[pointer[0]];
|
|
2344
|
-
} else {
|
|
2345
|
-
applySegment(subject, pointer[0], cursor);
|
|
2346
|
-
}
|
|
2347
|
-
};
|
|
2202
|
+
const curry$2 = justCurryIt;
|
|
2348
2203
|
|
|
2349
|
-
const append = curry$9((segment, pointer) => pointer + "/" + escape$1(segment));
|
|
2350
2204
|
|
|
2351
|
-
|
|
2352
|
-
|
|
2353
|
-
|
|
2205
|
+
var pipeline$1 = curry$2((fns, doc) => {
|
|
2206
|
+
return fns.reduce(async (acc, fn) => fn(await acc), doc);
|
|
2207
|
+
});
|
|
2354
2208
|
|
|
2355
|
-
|
|
2356
|
-
if (value === undefined) {
|
|
2357
|
-
throw TypeError(`Value at '${cursor}' is undefined and does not have property '${segment}'`);
|
|
2358
|
-
} else if (value === null) {
|
|
2359
|
-
throw TypeError(`Value at '${cursor}' is null and does not have property '${segment}'`);
|
|
2360
|
-
} else if (isScalar(value)) {
|
|
2361
|
-
throw TypeError(`Value at '${cursor}' is a ${typeof value} and does not have property '${segment}'`);
|
|
2362
|
-
} else {
|
|
2363
|
-
const computedSegment = computeSegment(value, segment);
|
|
2364
|
-
return value[computedSegment];
|
|
2365
|
-
}
|
|
2366
|
-
};
|
|
2209
|
+
var all = (doc) => Promise.all(doc);
|
|
2367
2210
|
|
|
2368
|
-
const
|
|
2211
|
+
const pipeline = pipeline$1;
|
|
2212
|
+
const entries$1 = entries$2;
|
|
2213
|
+
const reduce = reduce$2;
|
|
2369
2214
|
|
|
2370
|
-
|
|
2215
|
+
|
|
2216
|
+
var allValues = (doc) => {
|
|
2217
|
+
return pipeline([
|
|
2218
|
+
entries$1,
|
|
2219
|
+
reduce(async (acc, [propertyName, propertyValue]) => {
|
|
2220
|
+
acc[propertyName] = await propertyValue;
|
|
2221
|
+
return acc;
|
|
2222
|
+
}, {})
|
|
2223
|
+
], doc);
|
|
2224
|
+
};
|
|
2225
|
+
|
|
2226
|
+
var lib$3 = {
|
|
2227
|
+
entries: entries$2,
|
|
2228
|
+
map: map$3,
|
|
2229
|
+
filter: filter,
|
|
2230
|
+
reduce: reduce$2,
|
|
2231
|
+
some: some,
|
|
2232
|
+
every: every,
|
|
2233
|
+
pipeline: pipeline$1,
|
|
2234
|
+
all: all,
|
|
2235
|
+
allValues: allValues
|
|
2236
|
+
};
|
|
2371
2237
|
|
|
2372
2238
|
var moo$1 = {exports: {}};
|
|
2373
2239
|
|
|
@@ -3208,7 +3074,7 @@ const parse$2 = parse_1;
|
|
|
3208
3074
|
const stringify$1 = stringify_1;
|
|
3209
3075
|
|
|
3210
3076
|
|
|
3211
|
-
var lib$
|
|
3077
|
+
var lib$2 = { parse: parse$2, stringify: stringify$1 };
|
|
3212
3078
|
|
|
3213
3079
|
var fetch_browser = fetch;
|
|
3214
3080
|
|
|
@@ -3464,10 +3330,10 @@ const getContentType = (path) => {
|
|
|
3464
3330
|
|
|
3465
3331
|
var mediaTypes = { addPlugin, parse, getContentType };
|
|
3466
3332
|
|
|
3467
|
-
const curry$
|
|
3468
|
-
const Pact$a = lib$
|
|
3469
|
-
const Json = lib$
|
|
3470
|
-
const JsonPointer = lib$
|
|
3333
|
+
const curry$1 = justCurryIt$1;
|
|
3334
|
+
const Pact$a = lib$3;
|
|
3335
|
+
const Json = lib$2;
|
|
3336
|
+
const JsonPointer = lib$4;
|
|
3471
3337
|
const { jsonTypeOf, resolveUrl: resolveUrl$1, urlFragment, pathRelative } = common$1;
|
|
3472
3338
|
const fetch$1 = fetch_browser;
|
|
3473
3339
|
const Reference$1 = reference;
|
|
@@ -3498,61 +3364,64 @@ const getConfig = (dialectId, key) => {
|
|
|
3498
3364
|
// Schema Management
|
|
3499
3365
|
const schemaStore = {};
|
|
3500
3366
|
const schemaStoreAlias = {};
|
|
3501
|
-
const add$1 = (schema, retrievalUri = "", defaultDialectId = "") => {
|
|
3502
|
-
const dialectId = getDialectId(schema, retrievalUri, defaultDialectId);
|
|
3503
|
-
|
|
3504
|
-
const id = getBaseUri(schema, retrievalUri, dialectJsonSchemaVersion[dialectId]);
|
|
3505
|
-
|
|
3506
|
-
// Extract embedded schemas and collect anchors
|
|
3507
|
-
const embeddedToken = getConfig(dialectId, "embeddedToken");
|
|
3508
|
-
const baseToken = getConfig(dialectId, "baseToken");
|
|
3509
|
-
const anchorToken = getConfig(dialectId, "anchorToken");
|
|
3510
|
-
const dynamicAnchorToken = getConfig(dialectId, "dynamicAnchorToken");
|
|
3511
|
-
const jrefToken = getConfig(dialectId, "jrefToken");
|
|
3512
|
-
|
|
3513
|
-
const dynamicAnchors = {};
|
|
3514
|
-
const anchors = { "": "" };
|
|
3515
|
-
|
|
3516
|
-
schema = Json.parse(JSON.stringify(schema), (key, value, pointer) => {
|
|
3517
|
-
if (jsonTypeOf(value, "object")) {
|
|
3518
|
-
// Embedded Schema
|
|
3519
|
-
const embeddedSchemaDialectId = typeof value.$schema === "string" ? resolveUrl$1(value.$schema, "") : dialectId;
|
|
3520
|
-
const embeddedEmbeddedToken = getConfig(embeddedSchemaDialectId, "embeddedToken");
|
|
3521
|
-
const embeddedAnchorToken = getConfig(embeddedSchemaDialectId, "anchorToken");
|
|
3522
|
-
if (typeof value[embeddedEmbeddedToken] === "string" && (embeddedEmbeddedToken !== embeddedAnchorToken || value[embeddedEmbeddedToken][0] !== "#") && pointer !== "") {
|
|
3523
|
-
const embeddedRetrievalUri = resolveUrl$1(id, value[embeddedEmbeddedToken]);
|
|
3524
|
-
add$1(value, embeddedRetrievalUri, dialectId);
|
|
3525
|
-
return Reference$1.cons(value[embeddedEmbeddedToken], value);
|
|
3526
|
-
}
|
|
3527
3367
|
|
|
3528
|
-
|
|
3529
|
-
|
|
3530
|
-
|
|
3368
|
+
const add$1 = (schema, url = "", defaultSchemaVersion = "") => {
|
|
3369
|
+
schema = JSON.parse(JSON.stringify(schema));
|
|
3370
|
+
const externalId = resolveUrl$1(url, "");
|
|
3531
3371
|
|
|
3532
|
-
|
|
3533
|
-
|
|
3534
|
-
|
|
3535
|
-
|
|
3536
|
-
|
|
3372
|
+
// Dialect / JSON Schema Version
|
|
3373
|
+
const dialectId = resolveUrl$1(schema["$schema"] || defaultSchemaVersion, "");
|
|
3374
|
+
if (!dialectId) {
|
|
3375
|
+
throw Error("Couldn't determine schema dialect");
|
|
3376
|
+
}
|
|
3377
|
+
delete schema["$schema"];
|
|
3537
3378
|
|
|
3538
|
-
|
|
3539
|
-
|
|
3540
|
-
|
|
3541
|
-
|
|
3379
|
+
// Determine JSON Schema version
|
|
3380
|
+
if (!(dialectId in dialectJsonSchemaVersion)) {
|
|
3381
|
+
if (schema?.$vocabulary?.[core201909Id] === true && dialectId === getSchemaIdentifier(schema, externalId, core201909Id)[0]) {
|
|
3382
|
+
// Self describing 2019-09 meta-schema
|
|
3383
|
+
dialectJsonSchemaVersion[dialectId] = core201909Id;
|
|
3384
|
+
} else if (schema?.$vocabulary?.[core202012Id] === true && dialectId === getSchemaIdentifier(schema, externalId, core202012Id)[0]) {
|
|
3385
|
+
// Self describing 2020-12 meta-schema
|
|
3386
|
+
dialectJsonSchemaVersion[dialectId] = core202012Id;
|
|
3387
|
+
} else {
|
|
3388
|
+
// Need to look at meta-schema to determine version
|
|
3389
|
+
const metaSchema = schemaStore[dialectId];
|
|
3390
|
+
if (!metaSchema) {
|
|
3391
|
+
throw Error(`Couldn't determine JSON Schema version for dialect: '${dialectId}'`);
|
|
3392
|
+
} else if (metaSchema.vocabulary[core201909Id] === true) {
|
|
3393
|
+
dialectJsonSchemaVersion[dialectId] = core201909Id;
|
|
3394
|
+
} else if (metaSchema.vocabulary[core202012Id] === true) {
|
|
3395
|
+
dialectJsonSchemaVersion[dialectId] = core202012Id;
|
|
3396
|
+
} else {
|
|
3397
|
+
// Assume the jsonSchemaVersion is the meta-schema's dialectId (non-standard behavior)
|
|
3398
|
+
dialectJsonSchemaVersion[dialectId] = dialectJsonSchemaVersion[metaSchema.dialectId];
|
|
3542
3399
|
}
|
|
3543
3400
|
}
|
|
3401
|
+
}
|
|
3544
3402
|
|
|
3545
|
-
|
|
3546
|
-
|
|
3547
|
-
|
|
3548
|
-
|
|
3549
|
-
|
|
3403
|
+
// Internal Identifier
|
|
3404
|
+
const [id, fragment] = getSchemaIdentifier(schema, externalId, dialectJsonSchemaVersion[dialectId]);
|
|
3405
|
+
if (!id) {
|
|
3406
|
+
throw Error("Couldn't determine an identifier for the schema");
|
|
3407
|
+
}
|
|
3408
|
+
const baseToken = getConfig(dialectId, "baseToken");
|
|
3550
3409
|
delete schema[baseToken];
|
|
3410
|
+
if (externalId) {
|
|
3411
|
+
schemaStoreAlias[externalId] = id;
|
|
3412
|
+
}
|
|
3413
|
+
|
|
3414
|
+
const anchorToken = getConfig(dialectId, "anchorToken");
|
|
3415
|
+
if (fragment && baseToken === anchorToken) {
|
|
3416
|
+
schema[anchorToken] = anchorToken !== baseToken ? encodeURI(fragment) : `#${encodeURI(fragment)}`;
|
|
3417
|
+
}
|
|
3551
3418
|
|
|
3552
3419
|
// recursiveAnchor
|
|
3420
|
+
const dynamicAnchors = {};
|
|
3553
3421
|
const recursiveAnchorToken = getConfig(dialectId, "recursiveAnchorToken");
|
|
3554
3422
|
if (schema[recursiveAnchorToken] === true) {
|
|
3555
3423
|
dynamicAnchors[""] = `${id}#`;
|
|
3424
|
+
schema[anchorToken] = "";
|
|
3556
3425
|
delete schema[recursiveAnchorToken];
|
|
3557
3426
|
}
|
|
3558
3427
|
|
|
@@ -3567,66 +3436,69 @@ const add$1 = (schema, retrievalUri = "", defaultDialectId = "") => {
|
|
|
3567
3436
|
}
|
|
3568
3437
|
|
|
3569
3438
|
// Store Schema
|
|
3439
|
+
const anchors = { "": "" };
|
|
3570
3440
|
schemaStore[id] = {
|
|
3571
|
-
id,
|
|
3572
|
-
dialectId,
|
|
3573
|
-
schema,
|
|
3574
|
-
anchors,
|
|
3575
|
-
dynamicAnchors,
|
|
3576
|
-
vocabulary,
|
|
3441
|
+
id: id,
|
|
3442
|
+
dialectId: dialectId,
|
|
3443
|
+
schema: processSchema(schema, id, dialectId, JsonPointer.nil, anchors, dynamicAnchors),
|
|
3444
|
+
anchors: anchors,
|
|
3445
|
+
dynamicAnchors: dynamicAnchors,
|
|
3446
|
+
vocabulary: vocabulary,
|
|
3577
3447
|
validated: false
|
|
3578
3448
|
};
|
|
3579
|
-
if (id === "https://example.com/schema/root") {
|
|
3580
|
-
console.log(Object.keys(schemaStore).filter((id) => !/json-schema\.org/.test(id)));
|
|
3581
|
-
}
|
|
3582
3449
|
|
|
3583
|
-
|
|
3584
|
-
schemaStoreAlias[resolveUrl$1(retrievalUri, "")] = id;
|
|
3585
|
-
}
|
|
3450
|
+
return id;
|
|
3586
3451
|
};
|
|
3587
3452
|
|
|
3588
|
-
const
|
|
3589
|
-
const
|
|
3590
|
-
|
|
3591
|
-
|
|
3592
|
-
|
|
3453
|
+
const getSchemaIdentifier = (schema, externalId, jsonSchemaVersion) => {
|
|
3454
|
+
const baseToken = config[jsonSchemaVersion]?.["baseToken"];
|
|
3455
|
+
const internalUrl = resolveUrl$1(externalId, schema[baseToken] || "");
|
|
3456
|
+
return [resolveUrl$1(internalUrl, ""), urlFragment(internalUrl)];
|
|
3457
|
+
};
|
|
3458
|
+
|
|
3459
|
+
const processSchema = (subject, id, dialectId, pointer, anchors, dynamicAnchors) => {
|
|
3460
|
+
if (jsonTypeOf(subject, "object")) {
|
|
3461
|
+
const embeddedSchemaDialectId = typeof subject.$schema === "string" ? resolveUrl$1(subject.$schema, "") : dialectId;
|
|
3462
|
+
const embeddedEmbeddedToken = getConfig(embeddedSchemaDialectId, "embeddedToken");
|
|
3463
|
+
const embeddedAnchorToken = getConfig(embeddedSchemaDialectId, "anchorToken");
|
|
3464
|
+
if (typeof subject[embeddedEmbeddedToken] === "string" && (embeddedEmbeddedToken !== embeddedAnchorToken || subject[embeddedEmbeddedToken][0] !== "#")) {
|
|
3465
|
+
const ref = resolveUrl$1(id, subject[embeddedEmbeddedToken]);
|
|
3466
|
+
const embeddedBaseToken = getConfig(embeddedSchemaDialectId, "baseToken");
|
|
3467
|
+
subject[embeddedBaseToken] = ref;
|
|
3468
|
+
add$1(subject, ref, dialectId);
|
|
3469
|
+
return Reference$1.cons(subject[embeddedEmbeddedToken], subject);
|
|
3470
|
+
}
|
|
3593
3471
|
|
|
3594
|
-
|
|
3595
|
-
|
|
3596
|
-
if (
|
|
3597
|
-
|
|
3598
|
-
|
|
3599
|
-
|
|
3600
|
-
// Self describing 2020-12 meta-schema
|
|
3601
|
-
dialectJsonSchemaVersion[dialectId] = core202012Id;
|
|
3602
|
-
} else {
|
|
3603
|
-
// Need to look at meta-schema to determine version
|
|
3604
|
-
const metaSchema = schemaStore[dialectId];
|
|
3605
|
-
if (!metaSchema) {
|
|
3606
|
-
throw Error(`Couldn't determine JSON Schema version for dialect: '${dialectId}'`);
|
|
3607
|
-
} else if (metaSchema.vocabulary[core201909Id] === true) {
|
|
3608
|
-
dialectJsonSchemaVersion[dialectId] = core201909Id;
|
|
3609
|
-
} else if (metaSchema.vocabulary[core202012Id] === true) {
|
|
3610
|
-
dialectJsonSchemaVersion[dialectId] = core202012Id;
|
|
3611
|
-
} else {
|
|
3612
|
-
// Assume the jsonSchemaVersion is the meta-schema's dialectId (non-standard behavior)
|
|
3613
|
-
dialectJsonSchemaVersion[dialectId] = dialectJsonSchemaVersion[metaSchema.dialectId];
|
|
3614
|
-
}
|
|
3472
|
+
const anchorToken = getConfig(dialectId, "anchorToken");
|
|
3473
|
+
const dynamicAnchorToken = getConfig(dialectId, "dynamicAnchorToken");
|
|
3474
|
+
if (typeof subject[dynamicAnchorToken] === "string") {
|
|
3475
|
+
dynamicAnchors[subject[dynamicAnchorToken]] = `${id}#${encodeURI(pointer)}`;
|
|
3476
|
+
anchors[subject[dynamicAnchorToken]] = pointer;
|
|
3477
|
+
delete subject[dynamicAnchorToken];
|
|
3615
3478
|
}
|
|
3616
|
-
}
|
|
3617
3479
|
|
|
3618
|
-
|
|
3619
|
-
|
|
3480
|
+
const embeddedToken = getConfig(dialectId, "embeddedToken");
|
|
3481
|
+
if (typeof subject[anchorToken] === "string") {
|
|
3482
|
+
const anchor = anchorToken !== embeddedToken ? subject[anchorToken] : subject[anchorToken].slice(1);
|
|
3483
|
+
anchors[anchor] = pointer;
|
|
3484
|
+
delete subject[anchorToken];
|
|
3485
|
+
}
|
|
3620
3486
|
|
|
3621
|
-
const
|
|
3622
|
-
|
|
3623
|
-
|
|
3624
|
-
|
|
3625
|
-
if (!baseUri) {
|
|
3626
|
-
throw Error("Couldn't determine an identifier for the schema");
|
|
3627
|
-
}
|
|
3487
|
+
const jrefToken = getConfig(dialectId, "jrefToken");
|
|
3488
|
+
if (typeof subject[jrefToken] === "string") {
|
|
3489
|
+
return Reference$1.cons(subject[jrefToken], subject);
|
|
3490
|
+
}
|
|
3628
3491
|
|
|
3629
|
-
|
|
3492
|
+
for (const key in subject) {
|
|
3493
|
+
subject[key] = processSchema(subject[key], id, dialectId, JsonPointer.append(key, pointer), anchors, dynamicAnchors);
|
|
3494
|
+
}
|
|
3495
|
+
|
|
3496
|
+
return subject;
|
|
3497
|
+
} else if (Array.isArray(subject)) {
|
|
3498
|
+
return subject.map((item, ndx) => processSchema(item, id, dialectId, JsonPointer.append(ndx, pointer), anchors, dynamicAnchors));
|
|
3499
|
+
} else {
|
|
3500
|
+
return subject;
|
|
3501
|
+
}
|
|
3630
3502
|
};
|
|
3631
3503
|
|
|
3632
3504
|
const hasStoredSchema = (id) => id in schemaStore || id in schemaStoreAlias;
|
|
@@ -3720,14 +3592,14 @@ const step = (key, doc) => {
|
|
|
3720
3592
|
|
|
3721
3593
|
const keys = (doc) => Object.keys(value(doc));
|
|
3722
3594
|
|
|
3723
|
-
const entries
|
|
3595
|
+
const entries = (doc) => Pact$a.pipeline([
|
|
3724
3596
|
value,
|
|
3725
3597
|
Object.keys,
|
|
3726
3598
|
Pact$a.map(async (key) => [key, await step(key, doc)]),
|
|
3727
3599
|
Pact$a.all
|
|
3728
3600
|
], doc);
|
|
3729
3601
|
|
|
3730
|
-
const map
|
|
3602
|
+
const map = curry$1((fn, doc) => Pact$a.pipeline([
|
|
3731
3603
|
value,
|
|
3732
3604
|
Pact$a.map(async (item, ndx) => fn(await step(ndx, doc), ndx)),
|
|
3733
3605
|
Pact$a.all
|
|
@@ -3802,7 +3674,7 @@ const relativeUri = (from, to) => {
|
|
|
3802
3674
|
var schema$5 = {
|
|
3803
3675
|
setConfig, getConfig,
|
|
3804
3676
|
add: add$1, get, markValidated,
|
|
3805
|
-
uri, value, getAnchorPointer, typeOf, has, step, keys, entries
|
|
3677
|
+
uri, value, getAnchorPointer, typeOf, has, step, keys, entries, map, length,
|
|
3806
3678
|
toSchema
|
|
3807
3679
|
};
|
|
3808
3680
|
|
|
@@ -3816,19 +3688,19 @@ class InvalidSchemaError$3 extends Error {
|
|
|
3816
3688
|
|
|
3817
3689
|
var invalidSchemaError = InvalidSchemaError$3;
|
|
3818
3690
|
|
|
3819
|
-
const Schema$
|
|
3691
|
+
const Schema$P = schema$5;
|
|
3820
3692
|
|
|
3821
3693
|
|
|
3822
|
-
const compile$
|
|
3823
|
-
const interpret$
|
|
3694
|
+
const compile$M = (schema) => Schema$P.value(schema);
|
|
3695
|
+
const interpret$M = () => true;
|
|
3824
3696
|
|
|
3825
|
-
var metaData$4 = { compile: compile$
|
|
3697
|
+
var metaData$4 = { compile: compile$M, interpret: interpret$M };
|
|
3826
3698
|
|
|
3827
|
-
const curry
|
|
3699
|
+
const curry = justCurryIt$1;
|
|
3828
3700
|
const PubSub$1 = pubsub.exports;
|
|
3829
3701
|
const { resolveUrl } = common$1;
|
|
3830
|
-
const Instance$
|
|
3831
|
-
const Schema$
|
|
3702
|
+
const Instance$C = instance;
|
|
3703
|
+
const Schema$O = schema$5;
|
|
3832
3704
|
const InvalidSchemaError$2 = invalidSchemaError;
|
|
3833
3705
|
const MediaTypes = mediaTypes;
|
|
3834
3706
|
const metaData$3 = metaData$4;
|
|
@@ -3848,19 +3720,19 @@ MediaTypes.addPlugin("application/schema+json", {
|
|
|
3848
3720
|
});
|
|
3849
3721
|
|
|
3850
3722
|
const validate$2 = async (schema, value = undefined, outputFormat = undefined) => {
|
|
3851
|
-
const compiled = await compile$
|
|
3852
|
-
const interpretAst = (value, outputFormat) => interpret$
|
|
3723
|
+
const compiled = await compile$L(schema);
|
|
3724
|
+
const interpretAst = (value, outputFormat) => interpret$L(compiled, Instance$C.cons(value), outputFormat);
|
|
3853
3725
|
|
|
3854
3726
|
return value === undefined ? interpretAst : interpretAst(value, outputFormat);
|
|
3855
3727
|
};
|
|
3856
3728
|
|
|
3857
|
-
const compile$
|
|
3729
|
+
const compile$L = async (schema) => {
|
|
3858
3730
|
const ast = { metaData: {} };
|
|
3859
3731
|
const schemaUri = await compileSchema(schema, ast);
|
|
3860
3732
|
return { ast, schemaUri };
|
|
3861
3733
|
};
|
|
3862
3734
|
|
|
3863
|
-
const interpret$
|
|
3735
|
+
const interpret$L = curry(({ ast, schemaUri }, value, outputFormat = FLAG) => {
|
|
3864
3736
|
if (![FLAG, BASIC, DETAILED, VERBOSE].includes(outputFormat)) {
|
|
3865
3737
|
throw Error(`The '${outputFormat}' error format is not supported`);
|
|
3866
3738
|
}
|
|
@@ -3935,10 +3807,10 @@ const compileSchema = async (schema, ast) => {
|
|
|
3935
3807
|
|
|
3936
3808
|
// Vocabularies
|
|
3937
3809
|
if (!hasKeyword(`${schema.dialectId}#validate`)) {
|
|
3938
|
-
const metaSchema = await Schema$
|
|
3810
|
+
const metaSchema = await Schema$O.get(schema.dialectId);
|
|
3939
3811
|
|
|
3940
3812
|
// Check for mandatory vocabularies
|
|
3941
|
-
const mandatoryVocabularies = Schema$
|
|
3813
|
+
const mandatoryVocabularies = Schema$O.getConfig(metaSchema.id, "mandatoryVocabularies") || [];
|
|
3942
3814
|
mandatoryVocabularies.forEach((vocabularyId) => {
|
|
3943
3815
|
if (!metaSchema.vocabulary[vocabularyId]) {
|
|
3944
3816
|
throw Error(`Vocabulary '${vocabularyId}' must be explicitly declared and required`);
|
|
@@ -3961,17 +3833,17 @@ const compileSchema = async (schema, ast) => {
|
|
|
3961
3833
|
|
|
3962
3834
|
// Meta validation
|
|
3963
3835
|
if (shouldMetaValidate && !schema.validated) {
|
|
3964
|
-
Schema$
|
|
3836
|
+
Schema$O.markValidated(schema.id);
|
|
3965
3837
|
|
|
3966
3838
|
// Compile
|
|
3967
3839
|
if (!(schema.dialectId in metaValidators)) {
|
|
3968
|
-
const metaSchema = await Schema$
|
|
3969
|
-
const compiledSchema = await compile$
|
|
3970
|
-
metaValidators[metaSchema.id] = interpret$
|
|
3840
|
+
const metaSchema = await Schema$O.get(schema.dialectId);
|
|
3841
|
+
const compiledSchema = await compile$L(metaSchema);
|
|
3842
|
+
metaValidators[metaSchema.id] = interpret$L(compiledSchema);
|
|
3971
3843
|
}
|
|
3972
3844
|
|
|
3973
3845
|
// Interpret
|
|
3974
|
-
const schemaInstance = Instance$
|
|
3846
|
+
const schemaInstance = Instance$C.cons(schema.schema, schema.id);
|
|
3975
3847
|
const metaResults = metaValidators[schema.dialectId](schemaInstance, metaOutputFormat);
|
|
3976
3848
|
if (!metaResults.valid) {
|
|
3977
3849
|
throw new InvalidSchemaError$2(metaResults);
|
|
@@ -3990,7 +3862,7 @@ const compileSchema = async (schema, ast) => {
|
|
|
3990
3862
|
};
|
|
3991
3863
|
|
|
3992
3864
|
const followReferences = async (doc) => {
|
|
3993
|
-
return Schema$
|
|
3865
|
+
return Schema$O.typeOf(doc, "string") ? followReferences(await Schema$O.get(Schema$O.value(doc), doc)) : doc;
|
|
3994
3866
|
};
|
|
3995
3867
|
|
|
3996
3868
|
const interpretSchema = (schemaUri, instance, ast, dynamicAnchors) => {
|
|
@@ -4018,45 +3890,45 @@ const getKeywordId = (schemaUri, ast) => {
|
|
|
4018
3890
|
};
|
|
4019
3891
|
|
|
4020
3892
|
const add = (schema, url = "", defaultSchemaVersion = "") => {
|
|
4021
|
-
const id = Schema$
|
|
3893
|
+
const id = Schema$O.add(schema, url, defaultSchemaVersion);
|
|
4022
3894
|
delete metaValidators[id];
|
|
4023
3895
|
};
|
|
4024
3896
|
|
|
4025
3897
|
var core$2 = {
|
|
4026
|
-
validate: validate$2, compile: compile$
|
|
3898
|
+
validate: validate$2, compile: compile$L, interpret: interpret$L,
|
|
4027
3899
|
setMetaOutputFormat, setShouldMetaValidate, FLAG, BASIC, DETAILED, VERBOSE,
|
|
4028
3900
|
add, getKeyword, hasKeyword, defineVocabulary,
|
|
4029
3901
|
compileSchema, interpretSchema, collectEvaluatedProperties: collectEvaluatedProperties$e, collectEvaluatedItems: collectEvaluatedItems$f,
|
|
4030
3902
|
addMediaTypePlugin: MediaTypes.addPlugin
|
|
4031
3903
|
};
|
|
4032
3904
|
|
|
4033
|
-
const Pact$9 = lib$
|
|
3905
|
+
const Pact$9 = lib$3;
|
|
4034
3906
|
const PubSub = pubsub.exports;
|
|
4035
3907
|
const Core$x = core$2;
|
|
4036
|
-
const Instance$
|
|
4037
|
-
const Schema$
|
|
3908
|
+
const Instance$B = instance;
|
|
3909
|
+
const Schema$N = schema$5;
|
|
4038
3910
|
|
|
4039
3911
|
|
|
4040
|
-
const compile$
|
|
4041
|
-
const url = Schema$
|
|
3912
|
+
const compile$K = async (schema, ast) => {
|
|
3913
|
+
const url = Schema$N.uri(schema);
|
|
4042
3914
|
if (!(url in ast)) {
|
|
4043
3915
|
ast[url] = false; // Place dummy entry in ast to avoid recursive loops
|
|
4044
3916
|
|
|
4045
|
-
const schemaValue = Schema$
|
|
3917
|
+
const schemaValue = Schema$N.value(schema);
|
|
4046
3918
|
if (!["object", "boolean"].includes(typeof schemaValue)) {
|
|
4047
|
-
throw Error(`No schema found at '${Schema$
|
|
3919
|
+
throw Error(`No schema found at '${Schema$N.uri(schema)}'`);
|
|
4048
3920
|
}
|
|
4049
3921
|
|
|
4050
3922
|
ast[url] = [
|
|
4051
3923
|
`${schema.dialectId}#validate`,
|
|
4052
|
-
Schema$
|
|
3924
|
+
Schema$N.uri(schema),
|
|
4053
3925
|
typeof schemaValue === "boolean" ? schemaValue : await Pact$9.pipeline([
|
|
4054
|
-
Schema$
|
|
3926
|
+
Schema$N.entries,
|
|
4055
3927
|
Pact$9.map(([keyword, keywordSchema]) => [`${schema.dialectId}#${keyword}`, keywordSchema]),
|
|
4056
3928
|
Pact$9.filter(([keywordId]) => keywordId !== `${schema.dialectId}#validate`),
|
|
4057
3929
|
Pact$9.map(async ([keywordId, keywordSchema]) => {
|
|
4058
3930
|
const keywordAst = await Core$x.getKeyword(keywordId).compile(keywordSchema, ast, schema);
|
|
4059
|
-
return [keywordId, Schema$
|
|
3931
|
+
return [keywordId, Schema$N.uri(keywordSchema), keywordAst];
|
|
4060
3932
|
}),
|
|
4061
3933
|
Pact$9.all
|
|
4062
3934
|
], schema)
|
|
@@ -4066,7 +3938,7 @@ const compile$M = async (schema, ast) => {
|
|
|
4066
3938
|
return url;
|
|
4067
3939
|
};
|
|
4068
3940
|
|
|
4069
|
-
const interpret$
|
|
3941
|
+
const interpret$K = (uri, instance, ast, dynamicAnchors) => {
|
|
4070
3942
|
const [keywordId, schemaUrl, nodes] = ast[uri];
|
|
4071
3943
|
|
|
4072
3944
|
PubSub.publishSync("result.start");
|
|
@@ -4078,7 +3950,7 @@ const interpret$M = (uri, instance, ast, dynamicAnchors) => {
|
|
|
4078
3950
|
PubSub.publishSync("result", {
|
|
4079
3951
|
keyword: keywordId,
|
|
4080
3952
|
absoluteKeywordLocation: schemaUrl,
|
|
4081
|
-
instanceLocation: Instance$
|
|
3953
|
+
instanceLocation: Instance$B.uri(instance),
|
|
4082
3954
|
valid: isValid,
|
|
4083
3955
|
ast: keywordValue
|
|
4084
3956
|
});
|
|
@@ -4089,7 +3961,7 @@ const interpret$M = (uri, instance, ast, dynamicAnchors) => {
|
|
|
4089
3961
|
PubSub.publishSync("result", {
|
|
4090
3962
|
keyword: keywordId,
|
|
4091
3963
|
absoluteKeywordLocation: schemaUrl,
|
|
4092
|
-
instanceLocation: Instance$
|
|
3964
|
+
instanceLocation: Instance$B.uri(instance),
|
|
4093
3965
|
valid: isValid,
|
|
4094
3966
|
ast: uri
|
|
4095
3967
|
});
|
|
@@ -4127,7 +3999,7 @@ const collectEvaluatedItems$e = (uri, instance, ast, dynamicAnchors, isTop = fal
|
|
|
4127
3999
|
}, new Set());
|
|
4128
4000
|
};
|
|
4129
4001
|
|
|
4130
|
-
var validate$1 = { compile: compile$
|
|
4002
|
+
var validate$1 = { compile: compile$K, interpret: interpret$K, collectEvaluatedProperties: collectEvaluatedProperties$d, collectEvaluatedItems: collectEvaluatedItems$e };
|
|
4131
4003
|
|
|
4132
4004
|
const metaData$2 = metaData$4;
|
|
4133
4005
|
const validate = validate$1;
|
|
@@ -4136,90 +4008,90 @@ const validate = validate$1;
|
|
|
4136
4008
|
var keywords$6 = { metaData: metaData$2, validate };
|
|
4137
4009
|
|
|
4138
4010
|
const Core$w = core$2;
|
|
4139
|
-
const Schema$
|
|
4140
|
-
const Instance$
|
|
4011
|
+
const Schema$M = schema$5;
|
|
4012
|
+
const Instance$A = instance;
|
|
4141
4013
|
const Reference = reference;
|
|
4142
4014
|
const Keywords$2 = keywords$6;
|
|
4143
4015
|
const InvalidSchemaError$1 = invalidSchemaError;
|
|
4144
4016
|
|
|
4145
4017
|
|
|
4146
|
-
var lib$
|
|
4018
|
+
var lib$1 = { Core: Core$w, Schema: Schema$M, Instance: Instance$A, Reference, Keywords: Keywords$2, InvalidSchemaError: InvalidSchemaError$1 };
|
|
4147
4019
|
|
|
4148
|
-
const { Core: Core$v, Schema: Schema$
|
|
4020
|
+
const { Core: Core$v, Schema: Schema$L, Instance: Instance$z } = lib$1;
|
|
4149
4021
|
|
|
4150
4022
|
|
|
4151
|
-
const compile$
|
|
4152
|
-
const items = await Schema$
|
|
4153
|
-
const numberOfItems = Schema$
|
|
4023
|
+
const compile$J = async (schema, ast, parentSchema) => {
|
|
4024
|
+
const items = await Schema$L.step("items", parentSchema);
|
|
4025
|
+
const numberOfItems = Schema$L.typeOf(items, "array") ? Schema$L.length(items) : Number.MAX_SAFE_INTEGER;
|
|
4154
4026
|
|
|
4155
|
-
if (Schema$
|
|
4156
|
-
return [numberOfItems, Schema$
|
|
4027
|
+
if (Schema$L.typeOf(schema, "boolean")) {
|
|
4028
|
+
return [numberOfItems, Schema$L.value(schema)];
|
|
4157
4029
|
} else {
|
|
4158
4030
|
return [numberOfItems, await Core$v.compileSchema(schema, ast)];
|
|
4159
4031
|
}
|
|
4160
4032
|
};
|
|
4161
4033
|
|
|
4162
|
-
const interpret$
|
|
4163
|
-
if (!Instance$
|
|
4034
|
+
const interpret$J = ([numberOfItems, additionalItems], instance, ast, dynamicAnchors) => {
|
|
4035
|
+
if (!Instance$z.typeOf(instance, "array")) {
|
|
4164
4036
|
return true;
|
|
4165
4037
|
}
|
|
4166
4038
|
|
|
4167
4039
|
if (typeof additionalItems === "string") {
|
|
4168
|
-
return Instance$
|
|
4040
|
+
return Instance$z.every((item, ndx) => ndx < numberOfItems || Core$v.interpretSchema(additionalItems, item, ast, dynamicAnchors), instance);
|
|
4169
4041
|
} else {
|
|
4170
|
-
return Instance$
|
|
4042
|
+
return Instance$z.every((item, ndx) => ndx < numberOfItems ? true : additionalItems, instance);
|
|
4171
4043
|
}
|
|
4172
4044
|
};
|
|
4173
4045
|
|
|
4174
|
-
var additionalItems = { compile: compile$
|
|
4046
|
+
var additionalItems = { compile: compile$J, interpret: interpret$J };
|
|
4175
4047
|
|
|
4176
|
-
const { Core: Core$u, Schema: Schema$
|
|
4048
|
+
const { Core: Core$u, Schema: Schema$K, Instance: Instance$y } = lib$1;
|
|
4177
4049
|
|
|
4178
4050
|
|
|
4179
|
-
const compile$
|
|
4180
|
-
const items = await Schema$
|
|
4181
|
-
const numberOfItems = Schema$
|
|
4051
|
+
const compile$I = async (schema, ast, parentSchema) => {
|
|
4052
|
+
const items = await Schema$K.step("items", parentSchema);
|
|
4053
|
+
const numberOfItems = Schema$K.typeOf(items, "array") ? Schema$K.length(items) : Number.MAX_SAFE_INTEGER;
|
|
4182
4054
|
|
|
4183
4055
|
return [numberOfItems, await Core$u.compileSchema(schema, ast)];
|
|
4184
4056
|
};
|
|
4185
4057
|
|
|
4186
|
-
const interpret$
|
|
4187
|
-
if (!Instance$
|
|
4058
|
+
const interpret$I = ([numberOfItems, additionalItems], instance, ast, dynamicAnchors) => {
|
|
4059
|
+
if (!Instance$y.typeOf(instance, "array")) {
|
|
4188
4060
|
return true;
|
|
4189
4061
|
}
|
|
4190
4062
|
|
|
4191
|
-
return Instance$
|
|
4063
|
+
return Instance$y.every((item, ndx) => ndx < numberOfItems || Core$u.interpretSchema(additionalItems, item, ast, dynamicAnchors), instance);
|
|
4192
4064
|
};
|
|
4193
4065
|
|
|
4194
4066
|
const collectEvaluatedItems$d = (keywordValue, instance, ast, dynamicAnchors) => {
|
|
4195
|
-
return interpret$
|
|
4067
|
+
return interpret$I(keywordValue, instance, ast, dynamicAnchors) && new Set(Instance$y.map((item, ndx) => ndx, instance));
|
|
4196
4068
|
};
|
|
4197
4069
|
|
|
4198
|
-
var additionalItems6 = { compile: compile$
|
|
4070
|
+
var additionalItems6 = { compile: compile$I, interpret: interpret$I, collectEvaluatedItems: collectEvaluatedItems$d };
|
|
4199
4071
|
|
|
4200
|
-
const { Core: Core$t, Schema: Schema$
|
|
4072
|
+
const { Core: Core$t, Schema: Schema$J, Instance: Instance$x } = lib$1;
|
|
4201
4073
|
|
|
4202
4074
|
|
|
4203
|
-
const compile$
|
|
4204
|
-
const properties = await Schema$
|
|
4205
|
-
const propertyNames = Schema$
|
|
4075
|
+
const compile$H = async (schema, ast, parentSchema) => {
|
|
4076
|
+
const properties = await Schema$J.step("properties", parentSchema);
|
|
4077
|
+
const propertyNames = Schema$J.typeOf(properties, "object") ? Schema$J.keys(properties) : [];
|
|
4206
4078
|
|
|
4207
|
-
const patternProperties = await Schema$
|
|
4208
|
-
const propertyNamePatterns = Schema$
|
|
4079
|
+
const patternProperties = await Schema$J.step("patternProperties", parentSchema);
|
|
4080
|
+
const propertyNamePatterns = Schema$J.typeOf(patternProperties, "object") ? Schema$J.keys(patternProperties).map((pattern) => new RegExp(pattern)) : [];
|
|
4209
4081
|
|
|
4210
|
-
if (Schema$
|
|
4211
|
-
return [propertyNames, propertyNamePatterns, Schema$
|
|
4082
|
+
if (Schema$J.typeOf(schema, "boolean")) {
|
|
4083
|
+
return [propertyNames, propertyNamePatterns, Schema$J.value(schema)];
|
|
4212
4084
|
} else {
|
|
4213
4085
|
return [propertyNames, propertyNamePatterns, await Core$t.compileSchema(schema, ast)];
|
|
4214
4086
|
}
|
|
4215
4087
|
};
|
|
4216
4088
|
|
|
4217
|
-
const interpret$
|
|
4218
|
-
if (!Instance$
|
|
4089
|
+
const interpret$H = ([propertyNames, propertyNamePatterns, additionalProperties], instance, ast, dynamicAnchors) => {
|
|
4090
|
+
if (!Instance$x.typeOf(instance, "object")) {
|
|
4219
4091
|
return true;
|
|
4220
4092
|
}
|
|
4221
4093
|
|
|
4222
|
-
const properties = Instance$
|
|
4094
|
+
const properties = Instance$x.entries(instance)
|
|
4223
4095
|
.filter(([propertyName]) => !propertyNames.includes(propertyName) && !propertyNamePatterns.some((pattern) => pattern.test(propertyName)));
|
|
4224
4096
|
|
|
4225
4097
|
if (typeof additionalProperties === "string") {
|
|
@@ -4229,168 +4101,47 @@ const interpret$J = ([propertyNames, propertyNamePatterns, additionalProperties]
|
|
|
4229
4101
|
}
|
|
4230
4102
|
};
|
|
4231
4103
|
|
|
4232
|
-
var additionalProperties = { compile: compile$
|
|
4104
|
+
var additionalProperties = { compile: compile$H, interpret: interpret$H };
|
|
4233
4105
|
|
|
4234
|
-
const { Core: Core$s, Schema: Schema$
|
|
4106
|
+
const { Core: Core$s, Schema: Schema$I, Instance: Instance$w } = lib$1;
|
|
4235
4107
|
|
|
4236
4108
|
|
|
4237
|
-
const compile$
|
|
4238
|
-
const propertiesSchema = await Schema$
|
|
4239
|
-
const propertyNames = Schema$
|
|
4109
|
+
const compile$G = async (schema, ast, parentSchema) => {
|
|
4110
|
+
const propertiesSchema = await Schema$I.step("properties", parentSchema);
|
|
4111
|
+
const propertyNames = Schema$I.typeOf(propertiesSchema, "object") ? Schema$I.keys(propertiesSchema) : [];
|
|
4240
4112
|
|
|
4241
|
-
const patternProperties = await Schema$
|
|
4242
|
-
const propertyNamePatterns = Schema$
|
|
4113
|
+
const patternProperties = await Schema$I.step("patternProperties", parentSchema);
|
|
4114
|
+
const propertyNamePatterns = Schema$I.typeOf(patternProperties, "object") ? Schema$I.keys(patternProperties).map((pattern) => new RegExp(pattern)) : [];
|
|
4243
4115
|
|
|
4244
4116
|
return [propertyNames, propertyNamePatterns, await Core$s.compileSchema(schema, ast)];
|
|
4245
4117
|
};
|
|
4246
4118
|
|
|
4247
|
-
const interpret$
|
|
4248
|
-
if (!Instance$
|
|
4119
|
+
const interpret$G = ([propertyNames, propertyNamePatterns, additionalProperties], instance, ast, dynamicAnchors) => {
|
|
4120
|
+
if (!Instance$w.typeOf(instance, "object")) {
|
|
4249
4121
|
return true;
|
|
4250
4122
|
}
|
|
4251
4123
|
|
|
4252
|
-
return Instance$
|
|
4124
|
+
return Instance$w.entries(instance)
|
|
4253
4125
|
.filter(([propertyName]) => !propertyNames.includes(propertyName) && !propertyNamePatterns.some((pattern) => pattern.test(propertyName)))
|
|
4254
4126
|
.every(([, property]) => Core$s.interpretSchema(additionalProperties, property, ast, dynamicAnchors));
|
|
4255
4127
|
};
|
|
4256
4128
|
|
|
4257
4129
|
const collectEvaluatedProperties$c = (keywordValue, instance, ast, dynamicAnchors) => {
|
|
4258
|
-
return interpret$
|
|
4130
|
+
return interpret$G(keywordValue, instance, ast, dynamicAnchors) && [new RegExp("")];
|
|
4259
4131
|
};
|
|
4260
4132
|
|
|
4261
|
-
var additionalProperties6 = { compile: compile$
|
|
4133
|
+
var additionalProperties6 = { compile: compile$G, interpret: interpret$G, collectEvaluatedProperties: collectEvaluatedProperties$c };
|
|
4262
4134
|
|
|
4263
|
-
|
|
4135
|
+
const { Core: Core$r, Schema: Schema$H } = lib$1;
|
|
4136
|
+
const Pact$8 = lib$3;
|
|
4264
4137
|
|
|
4265
|
-
var justCurryIt = curry$6;
|
|
4266
4138
|
|
|
4267
|
-
|
|
4268
|
-
|
|
4269
|
-
return a + b + c;
|
|
4270
|
-
}
|
|
4271
|
-
curry(add)(1)(2)(3); // 6
|
|
4272
|
-
curry(add)(1)(2)(2); // 5
|
|
4273
|
-
curry(add)(2)(4, 3); // 9
|
|
4274
|
-
|
|
4275
|
-
function add(...args) {
|
|
4276
|
-
return args.reduce((sum, n) => sum + n, 0)
|
|
4277
|
-
}
|
|
4278
|
-
var curryAdd4 = curry(add, 4)
|
|
4279
|
-
curryAdd4(1)(2, 3)(4); // 10
|
|
4280
|
-
|
|
4281
|
-
function converter(ratio, input) {
|
|
4282
|
-
return (input*ratio).toFixed(1);
|
|
4283
|
-
}
|
|
4284
|
-
const curriedConverter = curry(converter)
|
|
4285
|
-
const milesToKm = curriedConverter(1.62);
|
|
4286
|
-
milesToKm(35); // 56.7
|
|
4287
|
-
milesToKm(10); // 16.2
|
|
4288
|
-
*/
|
|
4289
|
-
|
|
4290
|
-
function curry$6(fn, arity) {
|
|
4291
|
-
return function curried() {
|
|
4292
|
-
if (arity == null) {
|
|
4293
|
-
arity = fn.length;
|
|
4294
|
-
}
|
|
4295
|
-
var args = [].slice.call(arguments);
|
|
4296
|
-
if (args.length >= arity) {
|
|
4297
|
-
return fn.apply(this, args);
|
|
4298
|
-
} else {
|
|
4299
|
-
return function() {
|
|
4300
|
-
return curried.apply(this, args.concat([].slice.call(arguments)));
|
|
4301
|
-
};
|
|
4302
|
-
}
|
|
4303
|
-
};
|
|
4304
|
-
}
|
|
4305
|
-
|
|
4306
|
-
const curry$5 = justCurryIt;
|
|
4307
|
-
|
|
4308
|
-
|
|
4309
|
-
var map$2 = curry$5(async (fn, doc) => (await doc).map(fn));
|
|
4310
|
-
|
|
4311
|
-
const curry$4 = justCurryIt;
|
|
4312
|
-
|
|
4313
|
-
|
|
4314
|
-
var reduce$2 = curry$4(async (fn, acc, doc) => {
|
|
4315
|
-
return (await doc).reduce(async (acc, item) => fn(await acc, item), acc);
|
|
4316
|
-
});
|
|
4317
|
-
|
|
4318
|
-
const curry$3 = justCurryIt;
|
|
4319
|
-
const reduce$1 = reduce$2;
|
|
4320
|
-
|
|
4321
|
-
|
|
4322
|
-
var filter = curry$3(async (fn, doc, options = {}) => {
|
|
4323
|
-
return reduce$1(async (acc, item) => {
|
|
4324
|
-
return (await fn(item)) ? acc.concat([item]) : acc;
|
|
4325
|
-
}, [], doc, options);
|
|
4326
|
-
});
|
|
4327
|
-
|
|
4328
|
-
const curry$2 = justCurryIt;
|
|
4329
|
-
const map$1 = map$2;
|
|
4330
|
-
|
|
4331
|
-
|
|
4332
|
-
var some = curry$2(async (fn, doc) => {
|
|
4333
|
-
const results = await map$1(fn, doc);
|
|
4334
|
-
return (await Promise.all(results))
|
|
4335
|
-
.some((a) => a);
|
|
4336
|
-
});
|
|
4337
|
-
|
|
4338
|
-
const curry$1 = justCurryIt;
|
|
4339
|
-
const map = map$2;
|
|
4340
|
-
|
|
4341
|
-
|
|
4342
|
-
var every = curry$1(async (fn, doc) => {
|
|
4343
|
-
const results = await map(fn, doc);
|
|
4344
|
-
return (await Promise.all(results))
|
|
4345
|
-
.every((a) => a);
|
|
4346
|
-
});
|
|
4347
|
-
|
|
4348
|
-
const curry = justCurryIt;
|
|
4349
|
-
|
|
4350
|
-
|
|
4351
|
-
var pipeline$1 = curry((fns, doc) => {
|
|
4352
|
-
return fns.reduce(async (acc, fn) => fn(await acc), doc);
|
|
4353
|
-
});
|
|
4354
|
-
|
|
4355
|
-
var all = (doc) => Promise.all(doc);
|
|
4356
|
-
|
|
4357
|
-
const pipeline = pipeline$1;
|
|
4358
|
-
const entries = entries$1;
|
|
4359
|
-
const reduce = reduce$2;
|
|
4360
|
-
|
|
4361
|
-
|
|
4362
|
-
var allValues = (doc) => {
|
|
4363
|
-
return pipeline([
|
|
4364
|
-
entries,
|
|
4365
|
-
reduce(async (acc, [propertyName, propertyValue]) => {
|
|
4366
|
-
acc[propertyName] = await propertyValue;
|
|
4367
|
-
return acc;
|
|
4368
|
-
}, {})
|
|
4369
|
-
], doc);
|
|
4370
|
-
};
|
|
4371
|
-
|
|
4372
|
-
var lib$1 = {
|
|
4373
|
-
entries: entries$1,
|
|
4374
|
-
map: map$2,
|
|
4375
|
-
filter: filter,
|
|
4376
|
-
reduce: reduce$2,
|
|
4377
|
-
some: some,
|
|
4378
|
-
every: every,
|
|
4379
|
-
pipeline: pipeline$1,
|
|
4380
|
-
all: all,
|
|
4381
|
-
allValues: allValues
|
|
4382
|
-
};
|
|
4383
|
-
|
|
4384
|
-
const { Core: Core$r, Schema: Schema$J } = lib$2;
|
|
4385
|
-
const Pact$8 = lib$1;
|
|
4386
|
-
|
|
4387
|
-
|
|
4388
|
-
const compile$H = (schema, ast) => Pact$8.pipeline([
|
|
4389
|
-
Schema$J.map(async (itemSchema) => Core$r.compileSchema(await itemSchema, ast)),
|
|
4139
|
+
const compile$F = (schema, ast) => Pact$8.pipeline([
|
|
4140
|
+
Schema$H.map(async (itemSchema) => Core$r.compileSchema(await itemSchema, ast)),
|
|
4390
4141
|
Pact$8.all
|
|
4391
4142
|
], schema);
|
|
4392
4143
|
|
|
4393
|
-
const interpret$
|
|
4144
|
+
const interpret$F = (allOf, instance, ast, dynamicAnchors) => {
|
|
4394
4145
|
return allOf.every((schemaUrl) => Core$r.interpretSchema(schemaUrl, instance, ast, dynamicAnchors));
|
|
4395
4146
|
};
|
|
4396
4147
|
|
|
@@ -4408,18 +4159,18 @@ const collectEvaluatedItems$c = (allOf, instance, ast, dynamicAnchors) => {
|
|
|
4408
4159
|
}, new Set());
|
|
4409
4160
|
};
|
|
4410
4161
|
|
|
4411
|
-
var allOf = { compile: compile$
|
|
4162
|
+
var allOf = { compile: compile$F, interpret: interpret$F, collectEvaluatedProperties: collectEvaluatedProperties$b, collectEvaluatedItems: collectEvaluatedItems$c };
|
|
4412
4163
|
|
|
4413
|
-
const { Core: Core$q, Schema: Schema$
|
|
4414
|
-
const Pact$7 = lib$
|
|
4164
|
+
const { Core: Core$q, Schema: Schema$G } = lib$1;
|
|
4165
|
+
const Pact$7 = lib$3;
|
|
4415
4166
|
|
|
4416
4167
|
|
|
4417
|
-
const compile$
|
|
4418
|
-
Schema$
|
|
4168
|
+
const compile$E = (schema, ast) => Pact$7.pipeline([
|
|
4169
|
+
Schema$G.map(async (itemSchema) => Core$q.compileSchema(await itemSchema, ast)),
|
|
4419
4170
|
Pact$7.all
|
|
4420
4171
|
], schema);
|
|
4421
4172
|
|
|
4422
|
-
const interpret$
|
|
4173
|
+
const interpret$E = (anyOf, instance, ast, dynamicAnchors) => {
|
|
4423
4174
|
const matches = anyOf.filter((schemaUrl) => Core$q.interpretSchema(schemaUrl, instance, ast, dynamicAnchors));
|
|
4424
4175
|
return matches.length > 0;
|
|
4425
4176
|
};
|
|
@@ -4438,7 +4189,7 @@ const collectEvaluatedItems$b = (anyOf, instance, ast, dynamicAnchors) => {
|
|
|
4438
4189
|
}, false);
|
|
4439
4190
|
};
|
|
4440
4191
|
|
|
4441
|
-
var anyOf = { compile: compile$
|
|
4192
|
+
var anyOf = { compile: compile$E, interpret: interpret$E, collectEvaluatedProperties: collectEvaluatedProperties$a, collectEvaluatedItems: collectEvaluatedItems$b };
|
|
4442
4193
|
|
|
4443
4194
|
var keyList = Object.keys;
|
|
4444
4195
|
var native_stringify = JSON.stringify;
|
|
@@ -4499,92 +4250,92 @@ function stringify(val, allowUndefined) {
|
|
|
4499
4250
|
|
|
4500
4251
|
var fastestStableStringify = function(obj) { return '' + stringify(obj, false); };
|
|
4501
4252
|
|
|
4502
|
-
const { Schema: Schema$
|
|
4253
|
+
const { Schema: Schema$F, Instance: Instance$v } = lib$1;
|
|
4503
4254
|
const jsonStringify$2 = fastestStableStringify;
|
|
4504
4255
|
|
|
4505
4256
|
|
|
4506
|
-
const compile$
|
|
4507
|
-
const interpret$
|
|
4257
|
+
const compile$D = (schema) => jsonStringify$2(Schema$F.value(schema));
|
|
4258
|
+
const interpret$D = (const_, instance) => jsonStringify$2(Instance$v.value(instance)) === const_;
|
|
4508
4259
|
|
|
4509
|
-
var _const = { compile: compile$
|
|
4260
|
+
var _const = { compile: compile$D, interpret: interpret$D };
|
|
4510
4261
|
|
|
4511
|
-
const { Core: Core$p, Instance: Instance$
|
|
4262
|
+
const { Core: Core$p, Instance: Instance$u } = lib$1;
|
|
4512
4263
|
|
|
4513
4264
|
|
|
4514
|
-
const compile$
|
|
4265
|
+
const compile$C = (schema, ast) => Core$p.compileSchema(schema, ast);
|
|
4515
4266
|
|
|
4516
|
-
const interpret$
|
|
4517
|
-
return !Instance$
|
|
4267
|
+
const interpret$C = (contains, instance, ast, dynamicAnchors) => {
|
|
4268
|
+
return !Instance$u.typeOf(instance, "array") || Instance$u.some((item) => Core$p.interpretSchema(contains, item, ast, dynamicAnchors), instance);
|
|
4518
4269
|
};
|
|
4519
4270
|
|
|
4520
|
-
var contains = { compile: compile$
|
|
4271
|
+
var contains = { compile: compile$C, interpret: interpret$C };
|
|
4521
4272
|
|
|
4522
|
-
const { Core: Core$o, Schema: Schema$
|
|
4273
|
+
const { Core: Core$o, Schema: Schema$E, Instance: Instance$t } = lib$1;
|
|
4523
4274
|
|
|
4524
4275
|
|
|
4525
|
-
const compile$
|
|
4276
|
+
const compile$B = async (schema, ast, parentSchema) => {
|
|
4526
4277
|
const contains = await Core$o.compileSchema(schema, ast);
|
|
4527
4278
|
|
|
4528
|
-
const minContainsSchema = await Schema$
|
|
4529
|
-
const minContains = Schema$
|
|
4279
|
+
const minContainsSchema = await Schema$E.step("minContains", parentSchema);
|
|
4280
|
+
const minContains = Schema$E.typeOf(minContainsSchema, "number") ? Schema$E.value(minContainsSchema) : 1;
|
|
4530
4281
|
|
|
4531
|
-
const maxContainsSchema = await Schema$
|
|
4532
|
-
const maxContains = Schema$
|
|
4282
|
+
const maxContainsSchema = await Schema$E.step("maxContains", parentSchema);
|
|
4283
|
+
const maxContains = Schema$E.typeOf(maxContainsSchema, "number") ? Schema$E.value(maxContainsSchema) : Number.MAX_SAFE_INTEGER;
|
|
4533
4284
|
|
|
4534
4285
|
return { contains, minContains, maxContains };
|
|
4535
4286
|
};
|
|
4536
4287
|
|
|
4537
|
-
const interpret$
|
|
4538
|
-
if (!Instance$
|
|
4288
|
+
const interpret$B = ({ contains, minContains, maxContains }, instance, ast, dynamicAnchors) => {
|
|
4289
|
+
if (!Instance$t.typeOf(instance, "array")) {
|
|
4539
4290
|
return true;
|
|
4540
4291
|
}
|
|
4541
4292
|
|
|
4542
|
-
const matches = Instance$
|
|
4293
|
+
const matches = Instance$t.reduce((matches, item) => {
|
|
4543
4294
|
return Core$o.interpretSchema(contains, item, ast, dynamicAnchors) ? matches + 1 : matches;
|
|
4544
4295
|
}, 0, instance);
|
|
4545
4296
|
return matches >= minContains && matches <= maxContains;
|
|
4546
4297
|
};
|
|
4547
4298
|
|
|
4548
4299
|
const collectEvaluatedItems$a = (keywordValue, instance, ast, dynamicAnchors) => {
|
|
4549
|
-
return interpret$
|
|
4300
|
+
return interpret$B(keywordValue, instance, ast, dynamicAnchors) && Instance$t.reduce((matchedIndexes, item, itemIndex) => {
|
|
4550
4301
|
return Core$o.interpretSchema(keywordValue.contains, item, ast, dynamicAnchors) ? matchedIndexes.add(itemIndex) : matchedIndexes;
|
|
4551
4302
|
}, new Set(), instance);
|
|
4552
4303
|
};
|
|
4553
4304
|
|
|
4554
|
-
var containsMinContainsMaxContains = { compile: compile$
|
|
4305
|
+
var containsMinContainsMaxContains = { compile: compile$B, interpret: interpret$B, collectEvaluatedItems: collectEvaluatedItems$a };
|
|
4555
4306
|
|
|
4556
|
-
const { Core: Core$n, Schema: Schema$
|
|
4557
|
-
const Pact$6 = lib$
|
|
4307
|
+
const { Core: Core$n, Schema: Schema$D } = lib$1;
|
|
4308
|
+
const Pact$6 = lib$3;
|
|
4558
4309
|
|
|
4559
4310
|
|
|
4560
|
-
const compile$
|
|
4311
|
+
const compile$A = async (schema, ast) => {
|
|
4561
4312
|
await Pact$6.pipeline([
|
|
4562
|
-
Schema$
|
|
4313
|
+
Schema$D.entries,
|
|
4563
4314
|
Pact$6.map(([, definitionSchema]) => Core$n.compileSchema(definitionSchema, ast)),
|
|
4564
4315
|
Pact$6.all
|
|
4565
4316
|
], schema);
|
|
4566
4317
|
};
|
|
4567
4318
|
|
|
4568
|
-
const interpret$
|
|
4319
|
+
const interpret$A = () => true;
|
|
4569
4320
|
|
|
4570
|
-
var definitions = { compile: compile$
|
|
4321
|
+
var definitions = { compile: compile$A, interpret: interpret$A };
|
|
4571
4322
|
|
|
4572
|
-
const { Core: Core$m, Schema: Schema$
|
|
4573
|
-
const Pact$5 = lib$
|
|
4323
|
+
const { Core: Core$m, Schema: Schema$C, Instance: Instance$s } = lib$1;
|
|
4324
|
+
const Pact$5 = lib$3;
|
|
4574
4325
|
|
|
4575
4326
|
|
|
4576
|
-
const compile$
|
|
4577
|
-
Schema$
|
|
4327
|
+
const compile$z = (schema, ast) => Pact$5.pipeline([
|
|
4328
|
+
Schema$C.entries,
|
|
4578
4329
|
Pact$5.map(async ([key, dependency]) => {
|
|
4579
|
-
return [key, Schema$
|
|
4330
|
+
return [key, Schema$C.typeOf(dependency, "array") ? Schema$C.value(dependency) : await Core$m.compileSchema(dependency, ast)];
|
|
4580
4331
|
}),
|
|
4581
4332
|
Pact$5.all
|
|
4582
4333
|
], schema);
|
|
4583
4334
|
|
|
4584
|
-
const interpret$
|
|
4585
|
-
const value = Instance$
|
|
4335
|
+
const interpret$z = (dependencies, instance, ast, dynamicAnchors) => {
|
|
4336
|
+
const value = Instance$s.value(instance);
|
|
4586
4337
|
|
|
4587
|
-
return !Instance$
|
|
4338
|
+
return !Instance$s.typeOf(instance, "object") || dependencies.every(([propertyName, dependency]) => {
|
|
4588
4339
|
if (!(propertyName in value)) {
|
|
4589
4340
|
return true;
|
|
4590
4341
|
}
|
|
@@ -4597,49 +4348,49 @@ const interpret$B = (dependencies, instance, ast, dynamicAnchors) => {
|
|
|
4597
4348
|
});
|
|
4598
4349
|
};
|
|
4599
4350
|
|
|
4600
|
-
var dependencies = { compile: compile$
|
|
4351
|
+
var dependencies = { compile: compile$z, interpret: interpret$z };
|
|
4601
4352
|
|
|
4602
|
-
const { Schema: Schema$
|
|
4603
|
-
const Pact$4 = lib$
|
|
4353
|
+
const { Schema: Schema$B, Instance: Instance$r } = lib$1;
|
|
4354
|
+
const Pact$4 = lib$3;
|
|
4604
4355
|
|
|
4605
4356
|
|
|
4606
|
-
const compile$
|
|
4607
|
-
Schema$
|
|
4608
|
-
Pact$4.map(([key, dependentRequired]) => [key, Schema$
|
|
4357
|
+
const compile$y = (schema) => Pact$4.pipeline([
|
|
4358
|
+
Schema$B.entries,
|
|
4359
|
+
Pact$4.map(([key, dependentRequired]) => [key, Schema$B.value(dependentRequired)]),
|
|
4609
4360
|
Pact$4.all
|
|
4610
4361
|
], schema);
|
|
4611
4362
|
|
|
4612
|
-
const interpret$
|
|
4613
|
-
const value = Instance$
|
|
4363
|
+
const interpret$y = (dependentRequired, instance) => {
|
|
4364
|
+
const value = Instance$r.value(instance);
|
|
4614
4365
|
|
|
4615
|
-
return !Instance$
|
|
4366
|
+
return !Instance$r.typeOf(instance, "object") || dependentRequired.every(([propertyName, required]) => {
|
|
4616
4367
|
return !(propertyName in value) || required.every((key) => key in value);
|
|
4617
4368
|
});
|
|
4618
4369
|
};
|
|
4619
4370
|
|
|
4620
|
-
var dependentRequired = { compile: compile$
|
|
4371
|
+
var dependentRequired = { compile: compile$y, interpret: interpret$y };
|
|
4621
4372
|
|
|
4622
|
-
const { Core: Core$l, Schema: Schema$
|
|
4623
|
-
const Pact$3 = lib$
|
|
4373
|
+
const { Core: Core$l, Schema: Schema$A, Instance: Instance$q } = lib$1;
|
|
4374
|
+
const Pact$3 = lib$3;
|
|
4624
4375
|
|
|
4625
4376
|
|
|
4626
|
-
const compile$
|
|
4627
|
-
Schema$
|
|
4377
|
+
const compile$x = (schema, ast) => Pact$3.pipeline([
|
|
4378
|
+
Schema$A.entries,
|
|
4628
4379
|
Pact$3.map(async ([key, dependentSchema]) => [key, await Core$l.compileSchema(dependentSchema, ast)]),
|
|
4629
4380
|
Pact$3.all
|
|
4630
4381
|
], schema);
|
|
4631
4382
|
|
|
4632
|
-
const interpret$
|
|
4633
|
-
const value = Instance$
|
|
4383
|
+
const interpret$x = (dependentSchemas, instance, ast, dynamicAnchors) => {
|
|
4384
|
+
const value = Instance$q.value(instance);
|
|
4634
4385
|
|
|
4635
|
-
return !Instance$
|
|
4386
|
+
return !Instance$q.typeOf(instance, "object") || dependentSchemas.every(([propertyName, dependentSchema]) => {
|
|
4636
4387
|
return !(propertyName in value) || Core$l.interpretSchema(dependentSchema, instance, ast, dynamicAnchors);
|
|
4637
4388
|
});
|
|
4638
4389
|
};
|
|
4639
4390
|
|
|
4640
4391
|
const collectEvaluatedProperties$9 = (dependentSchemas, instance, ast, dynamicAnchors) => {
|
|
4641
4392
|
return dependentSchemas.reduce((acc, [propertyName, dependentSchema]) => {
|
|
4642
|
-
if (!acc || !Instance$
|
|
4393
|
+
if (!acc || !Instance$q.has(propertyName, instance)) {
|
|
4643
4394
|
return acc;
|
|
4644
4395
|
}
|
|
4645
4396
|
|
|
@@ -4648,39 +4399,39 @@ const collectEvaluatedProperties$9 = (dependentSchemas, instance, ast, dynamicAn
|
|
|
4648
4399
|
}, []);
|
|
4649
4400
|
};
|
|
4650
4401
|
|
|
4651
|
-
var dependentSchemas = { compile: compile$
|
|
4402
|
+
var dependentSchemas = { compile: compile$x, interpret: interpret$x, collectEvaluatedProperties: collectEvaluatedProperties$9 };
|
|
4652
4403
|
|
|
4653
|
-
const { Schema: Schema$
|
|
4404
|
+
const { Schema: Schema$z, Instance: Instance$p } = lib$1;
|
|
4654
4405
|
const jsonStringify$1 = fastestStableStringify;
|
|
4655
4406
|
|
|
4656
4407
|
|
|
4657
|
-
const compile$
|
|
4658
|
-
const interpret$
|
|
4408
|
+
const compile$w = (schema) => Schema$z.value(schema).map(jsonStringify$1);
|
|
4409
|
+
const interpret$w = (enum_, instance) => enum_.some((enumValue) => jsonStringify$1(Instance$p.value(instance)) === enumValue);
|
|
4659
4410
|
|
|
4660
|
-
var _enum = { compile: compile$
|
|
4411
|
+
var _enum = { compile: compile$w, interpret: interpret$w };
|
|
4661
4412
|
|
|
4662
|
-
const { Schema: Schema$
|
|
4413
|
+
const { Schema: Schema$y, Instance: Instance$o } = lib$1;
|
|
4663
4414
|
|
|
4664
4415
|
|
|
4665
|
-
const compile$
|
|
4666
|
-
const interpret$
|
|
4416
|
+
const compile$v = async (schema) => Schema$y.value(schema);
|
|
4417
|
+
const interpret$v = (exclusiveMaximum, instance) => !Instance$o.typeOf(instance, "number") || Instance$o.value(instance) < exclusiveMaximum;
|
|
4667
4418
|
|
|
4668
|
-
var exclusiveMaximum = { compile: compile$
|
|
4419
|
+
var exclusiveMaximum = { compile: compile$v, interpret: interpret$v };
|
|
4669
4420
|
|
|
4670
|
-
const { Schema: Schema$
|
|
4421
|
+
const { Schema: Schema$x, Instance: Instance$n } = lib$1;
|
|
4671
4422
|
|
|
4672
4423
|
|
|
4673
|
-
const compile$
|
|
4674
|
-
const interpret$
|
|
4424
|
+
const compile$u = async (schema) => Schema$x.value(schema);
|
|
4425
|
+
const interpret$u = (exclusiveMinimum, instance) => !Instance$n.typeOf(instance, "number") || Instance$n.value(instance) > exclusiveMinimum;
|
|
4675
4426
|
|
|
4676
|
-
var exclusiveMinimum = { compile: compile$
|
|
4427
|
+
var exclusiveMinimum = { compile: compile$u, interpret: interpret$u };
|
|
4677
4428
|
|
|
4678
|
-
const { Core: Core$k } = lib$
|
|
4429
|
+
const { Core: Core$k } = lib$1;
|
|
4679
4430
|
|
|
4680
4431
|
|
|
4681
|
-
const compile$
|
|
4432
|
+
const compile$t = (schema, ast) => Core$k.compileSchema(schema, ast);
|
|
4682
4433
|
|
|
4683
|
-
const interpret$
|
|
4434
|
+
const interpret$t = (ifSchema, instance, ast, dynamicAnchors) => {
|
|
4684
4435
|
Core$k.interpretSchema(ifSchema, instance, ast, dynamicAnchors);
|
|
4685
4436
|
return true;
|
|
4686
4437
|
};
|
|
@@ -4693,21 +4444,21 @@ const collectEvaluatedItems$9 = (ifSchema, instance, ast, dynamicAnchors) => {
|
|
|
4693
4444
|
return Core$k.collectEvaluatedItems(ifSchema, instance, ast, dynamicAnchors) || new Set();
|
|
4694
4445
|
};
|
|
4695
4446
|
|
|
4696
|
-
var _if = { compile: compile$
|
|
4447
|
+
var _if = { compile: compile$t, interpret: interpret$t, collectEvaluatedProperties: collectEvaluatedProperties$8, collectEvaluatedItems: collectEvaluatedItems$9 };
|
|
4697
4448
|
|
|
4698
|
-
const { Core: Core$j, Schema: Schema$
|
|
4449
|
+
const { Core: Core$j, Schema: Schema$w } = lib$1;
|
|
4699
4450
|
|
|
4700
4451
|
|
|
4701
|
-
const compile$
|
|
4702
|
-
if (Schema$
|
|
4703
|
-
const ifSchema = await Schema$
|
|
4452
|
+
const compile$s = async (schema, ast, parentSchema) => {
|
|
4453
|
+
if (Schema$w.has("if", parentSchema)) {
|
|
4454
|
+
const ifSchema = await Schema$w.step("if", parentSchema);
|
|
4704
4455
|
return [await Core$j.compileSchema(ifSchema, ast), await Core$j.compileSchema(schema, ast)];
|
|
4705
4456
|
} else {
|
|
4706
4457
|
return [];
|
|
4707
4458
|
}
|
|
4708
4459
|
};
|
|
4709
4460
|
|
|
4710
|
-
const interpret$
|
|
4461
|
+
const interpret$s = ([guard, block], instance, ast, dynamicAnchors) => {
|
|
4711
4462
|
return guard === undefined || !quietInterpretSchema$1(guard, instance, ast, dynamicAnchors) || Core$j.interpretSchema(block, instance, ast, dynamicAnchors);
|
|
4712
4463
|
};
|
|
4713
4464
|
|
|
@@ -4737,21 +4488,21 @@ const collectEvaluatedItems$8 = ([guard, block], instance, ast, dynamicAnchors)
|
|
|
4737
4488
|
return Core$j.collectEvaluatedItems(block, instance, ast, dynamicAnchors);
|
|
4738
4489
|
};
|
|
4739
4490
|
|
|
4740
|
-
var then = { compile: compile$
|
|
4491
|
+
var then = { compile: compile$s, interpret: interpret$s, collectEvaluatedProperties: collectEvaluatedProperties$7, collectEvaluatedItems: collectEvaluatedItems$8 };
|
|
4741
4492
|
|
|
4742
|
-
const { Core: Core$i, Schema: Schema$
|
|
4493
|
+
const { Core: Core$i, Schema: Schema$v } = lib$1;
|
|
4743
4494
|
|
|
4744
4495
|
|
|
4745
|
-
const compile$
|
|
4746
|
-
if (Schema$
|
|
4747
|
-
const ifSchema = await Schema$
|
|
4496
|
+
const compile$r = async (schema, ast, parentSchema) => {
|
|
4497
|
+
if (Schema$v.has("if", parentSchema)) {
|
|
4498
|
+
const ifSchema = await Schema$v.step("if", parentSchema);
|
|
4748
4499
|
return [await Core$i.compileSchema(ifSchema, ast), await Core$i.compileSchema(schema, ast)];
|
|
4749
4500
|
} else {
|
|
4750
4501
|
return [];
|
|
4751
4502
|
}
|
|
4752
4503
|
};
|
|
4753
4504
|
|
|
4754
|
-
const interpret$
|
|
4505
|
+
const interpret$r = ([guard, block], instance, ast, dynamicAnchors) => {
|
|
4755
4506
|
return guard === undefined || quietInterpretSchema(guard, instance, ast, dynamicAnchors) || Core$i.interpretSchema(block, instance, ast, dynamicAnchors);
|
|
4756
4507
|
};
|
|
4757
4508
|
|
|
@@ -4781,150 +4532,134 @@ const collectEvaluatedItems$7 = ([guard, block], instance, ast, dynamicAnchors)
|
|
|
4781
4532
|
return Core$i.collectEvaluatedItems(block, instance, ast, dynamicAnchors);
|
|
4782
4533
|
};
|
|
4783
4534
|
|
|
4784
|
-
var _else = { compile: compile$
|
|
4535
|
+
var _else = { compile: compile$r, interpret: interpret$r, collectEvaluatedProperties: collectEvaluatedProperties$6, collectEvaluatedItems: collectEvaluatedItems$7 };
|
|
4785
4536
|
|
|
4786
|
-
const { Core: Core$h, Schema: Schema$
|
|
4537
|
+
const { Core: Core$h, Schema: Schema$u, Instance: Instance$m } = lib$1;
|
|
4787
4538
|
|
|
4788
4539
|
|
|
4789
|
-
const compile$
|
|
4790
|
-
if (Schema$
|
|
4791
|
-
const tupleItems = await Schema$
|
|
4540
|
+
const compile$q = async (schema, ast) => {
|
|
4541
|
+
if (Schema$u.typeOf(schema, "array")) {
|
|
4542
|
+
const tupleItems = await Schema$u.map((itemSchema) => Core$h.compileSchema(itemSchema, ast), schema);
|
|
4792
4543
|
return Promise.all(tupleItems);
|
|
4793
4544
|
} else {
|
|
4794
4545
|
return Core$h.compileSchema(schema, ast);
|
|
4795
4546
|
}
|
|
4796
4547
|
};
|
|
4797
4548
|
|
|
4798
|
-
const interpret$
|
|
4799
|
-
if (!Instance$
|
|
4549
|
+
const interpret$q = (items, instance, ast, dynamicAnchors) => {
|
|
4550
|
+
if (!Instance$m.typeOf(instance, "array")) {
|
|
4800
4551
|
return true;
|
|
4801
4552
|
}
|
|
4802
4553
|
|
|
4803
4554
|
if (typeof items === "string") {
|
|
4804
|
-
return Instance$
|
|
4555
|
+
return Instance$m.every((itemValue) => Core$h.interpretSchema(items, itemValue, ast, dynamicAnchors), instance);
|
|
4805
4556
|
} else {
|
|
4806
|
-
return Instance$
|
|
4557
|
+
return Instance$m.every((item, ndx) => !(ndx in items) || Core$h.interpretSchema(items[ndx], item, ast, dynamicAnchors), instance);
|
|
4807
4558
|
}
|
|
4808
4559
|
};
|
|
4809
4560
|
|
|
4810
4561
|
const collectEvaluatedItems$6 = (items, instance, ast, dynamicAnchors) => {
|
|
4811
|
-
return interpret$
|
|
4812
|
-
? new Set(Instance$
|
|
4562
|
+
return interpret$q(items, instance, ast, dynamicAnchors) && (typeof items === "string"
|
|
4563
|
+
? new Set(Instance$m.map((item, itemIndex) => itemIndex, instance))
|
|
4813
4564
|
: new Set(items.map((item, itemIndex) => itemIndex)));
|
|
4814
4565
|
};
|
|
4815
4566
|
|
|
4816
|
-
var items = { compile: compile$
|
|
4567
|
+
var items = { compile: compile$q, interpret: interpret$q, collectEvaluatedItems: collectEvaluatedItems$6 };
|
|
4817
4568
|
|
|
4818
|
-
const { Core: Core$g, Schema: Schema$
|
|
4569
|
+
const { Core: Core$g, Schema: Schema$t, Instance: Instance$l } = lib$1;
|
|
4819
4570
|
|
|
4820
4571
|
|
|
4821
|
-
const compile$
|
|
4822
|
-
const items = await Schema$
|
|
4823
|
-
const numberOfPrefixItems = Schema$
|
|
4572
|
+
const compile$p = async (schema, ast, parentSchema) => {
|
|
4573
|
+
const items = await Schema$t.step("prefixItems", parentSchema);
|
|
4574
|
+
const numberOfPrefixItems = Schema$t.typeOf(items, "array") ? Schema$t.length(items) : 0;
|
|
4824
4575
|
|
|
4825
4576
|
return [numberOfPrefixItems, await Core$g.compileSchema(schema, ast)];
|
|
4826
4577
|
};
|
|
4827
4578
|
|
|
4828
|
-
const interpret$
|
|
4829
|
-
if (!Instance$
|
|
4579
|
+
const interpret$p = ([numberOfPrefixItems, items], instance, ast, dynamicAnchors) => {
|
|
4580
|
+
if (!Instance$l.typeOf(instance, "array")) {
|
|
4830
4581
|
return true;
|
|
4831
4582
|
}
|
|
4832
4583
|
|
|
4833
|
-
return Instance$
|
|
4584
|
+
return Instance$l.every((item, ndx) => ndx < numberOfPrefixItems || Core$g.interpretSchema(items, item, ast, dynamicAnchors), instance);
|
|
4834
4585
|
};
|
|
4835
4586
|
|
|
4836
4587
|
const collectEvaluatedItems$5 = (keywordValue, instance, ast, dynamicAnchors) => {
|
|
4837
|
-
return interpret$
|
|
4588
|
+
return interpret$p(keywordValue, instance, ast, dynamicAnchors) && new Set(Instance$l.map((item, ndx) => ndx, instance));
|
|
4838
4589
|
};
|
|
4839
4590
|
|
|
4840
|
-
var items202012 = { compile: compile$
|
|
4841
|
-
|
|
4842
|
-
const { Schema: Schema$u, Instance: Instance$m } = lib$2;
|
|
4843
|
-
|
|
4844
|
-
|
|
4845
|
-
const compile$q = (schema) => Schema$u.value(schema);
|
|
4846
|
-
const interpret$q = (maxItems, instance) => !Instance$m.typeOf(instance, "array") || Instance$m.length(instance) <= maxItems;
|
|
4591
|
+
var items202012 = { compile: compile$p, interpret: interpret$p, collectEvaluatedItems: collectEvaluatedItems$5 };
|
|
4847
4592
|
|
|
4848
|
-
|
|
4593
|
+
const { Schema: Schema$s, Instance: Instance$k } = lib$1;
|
|
4849
4594
|
|
|
4850
|
-
const { Schema: Schema$t, Instance: Instance$l } = lib$2;
|
|
4851
4595
|
|
|
4596
|
+
const compile$o = (schema) => Schema$s.value(schema);
|
|
4597
|
+
const interpret$o = (maxItems, instance) => !Instance$k.typeOf(instance, "array") || Instance$k.length(instance) <= maxItems;
|
|
4852
4598
|
|
|
4853
|
-
|
|
4854
|
-
const interpret$p = (maxLength, instance) => !Instance$l.typeOf(instance, "string") || Instance$l.length(instance) <= maxLength;
|
|
4855
|
-
|
|
4856
|
-
var maxLength = { compile: compile$p, interpret: interpret$p };
|
|
4599
|
+
var maxItems = { compile: compile$o, interpret: interpret$o };
|
|
4857
4600
|
|
|
4858
|
-
const { Schema: Schema$
|
|
4601
|
+
const { Schema: Schema$r, Instance: Instance$j } = lib$1;
|
|
4859
4602
|
|
|
4860
4603
|
|
|
4861
|
-
const compile$
|
|
4862
|
-
const interpret$
|
|
4604
|
+
const compile$n = (schema) => Schema$r.value(schema);
|
|
4605
|
+
const interpret$n = (maxLength, instance) => !Instance$j.typeOf(instance, "string") || [...Instance$j.value(instance)].length <= maxLength;
|
|
4863
4606
|
|
|
4864
|
-
var
|
|
4607
|
+
var maxLength = { compile: compile$n, interpret: interpret$n };
|
|
4865
4608
|
|
|
4866
|
-
const { Schema: Schema$
|
|
4609
|
+
const { Schema: Schema$q, Instance: Instance$i } = lib$1;
|
|
4867
4610
|
|
|
4868
4611
|
|
|
4869
|
-
const compile$
|
|
4870
|
-
const interpret$
|
|
4612
|
+
const compile$m = (schema) => Schema$q.value(schema);
|
|
4613
|
+
const interpret$m = (maxProperties, instance) => !Instance$i.typeOf(instance, "object") || Instance$i.keys(instance).length <= maxProperties;
|
|
4871
4614
|
|
|
4872
|
-
var maxProperties = { compile: compile$
|
|
4615
|
+
var maxProperties = { compile: compile$m, interpret: interpret$m };
|
|
4873
4616
|
|
|
4874
|
-
const { Schema: Schema$
|
|
4617
|
+
const { Schema: Schema$p, Instance: Instance$h } = lib$1;
|
|
4875
4618
|
|
|
4876
4619
|
|
|
4877
|
-
const compile$
|
|
4878
|
-
const exclusiveMaximum = await Schema$
|
|
4879
|
-
const isExclusive = Schema$
|
|
4620
|
+
const compile$l = async (schema, ast, parentSchema) => {
|
|
4621
|
+
const exclusiveMaximum = await Schema$p.step("exclusiveMaximum", parentSchema);
|
|
4622
|
+
const isExclusive = Schema$p.value(exclusiveMaximum);
|
|
4880
4623
|
|
|
4881
|
-
return [Schema$
|
|
4624
|
+
return [Schema$p.value(schema), isExclusive];
|
|
4882
4625
|
};
|
|
4883
4626
|
|
|
4884
|
-
const interpret$
|
|
4885
|
-
if (!Instance$
|
|
4627
|
+
const interpret$l = ([maximum, isExclusive], instance) => {
|
|
4628
|
+
if (!Instance$h.typeOf(instance, "number")) {
|
|
4886
4629
|
return true;
|
|
4887
4630
|
}
|
|
4888
4631
|
|
|
4889
|
-
const value = Instance$
|
|
4632
|
+
const value = Instance$h.value(instance);
|
|
4890
4633
|
return isExclusive ? value < maximum : value <= maximum;
|
|
4891
4634
|
};
|
|
4892
4635
|
|
|
4893
|
-
var maximumExclusiveMaximum = { compile: compile$
|
|
4894
|
-
|
|
4895
|
-
const { Schema: Schema$p, Instance: Instance$h } = lib$2;
|
|
4896
|
-
|
|
4897
|
-
|
|
4898
|
-
const compile$l = async (schema) => Schema$p.value(schema);
|
|
4899
|
-
const interpret$l = (maximum, instance) => !Instance$h.typeOf(instance, "number") || Instance$h.value(instance) <= maximum;
|
|
4900
|
-
|
|
4901
|
-
var maximum = { compile: compile$l, interpret: interpret$l };
|
|
4636
|
+
var maximumExclusiveMaximum = { compile: compile$l, interpret: interpret$l };
|
|
4902
4637
|
|
|
4903
|
-
const { Schema: Schema$o, Instance: Instance$g } = lib$
|
|
4638
|
+
const { Schema: Schema$o, Instance: Instance$g } = lib$1;
|
|
4904
4639
|
|
|
4905
4640
|
|
|
4906
|
-
const compile$k = (schema) => Schema$o.value(schema);
|
|
4907
|
-
const interpret$k = (
|
|
4641
|
+
const compile$k = async (schema) => Schema$o.value(schema);
|
|
4642
|
+
const interpret$k = (maximum, instance) => !Instance$g.typeOf(instance, "number") || Instance$g.value(instance) <= maximum;
|
|
4908
4643
|
|
|
4909
|
-
var
|
|
4644
|
+
var maximum = { compile: compile$k, interpret: interpret$k };
|
|
4910
4645
|
|
|
4911
|
-
const { Schema: Schema$n, Instance: Instance$f } = lib$
|
|
4646
|
+
const { Schema: Schema$n, Instance: Instance$f } = lib$1;
|
|
4912
4647
|
|
|
4913
4648
|
|
|
4914
4649
|
const compile$j = (schema) => Schema$n.value(schema);
|
|
4915
|
-
const interpret$j = (
|
|
4650
|
+
const interpret$j = (minItems, instance) => !Instance$f.typeOf(instance, "array") || Instance$f.length(instance) >= minItems;
|
|
4916
4651
|
|
|
4917
|
-
var
|
|
4652
|
+
var minItems = { compile: compile$j, interpret: interpret$j };
|
|
4918
4653
|
|
|
4919
|
-
const { Schema: Schema$m, Instance: Instance$e } = lib$
|
|
4654
|
+
const { Schema: Schema$m, Instance: Instance$e } = lib$1;
|
|
4920
4655
|
|
|
4921
4656
|
|
|
4922
4657
|
const compile$i = (schema) => Schema$m.value(schema);
|
|
4923
4658
|
const interpret$i = (minLength, instance) => !Instance$e.typeOf(instance, "string") || [...Instance$e.value(instance)].length >= minLength;
|
|
4924
4659
|
|
|
4925
|
-
var
|
|
4660
|
+
var minLength = { compile: compile$i, interpret: interpret$i };
|
|
4926
4661
|
|
|
4927
|
-
const { Schema: Schema$l, Instance: Instance$d } = lib$
|
|
4662
|
+
const { Schema: Schema$l, Instance: Instance$d } = lib$1;
|
|
4928
4663
|
|
|
4929
4664
|
|
|
4930
4665
|
const compile$h = (schema) => Schema$l.value(schema);
|
|
@@ -4932,7 +4667,7 @@ const interpret$h = (minProperties, instance) => !Instance$d.typeOf(instance, "o
|
|
|
4932
4667
|
|
|
4933
4668
|
var minProperties = { compile: compile$h, interpret: interpret$h };
|
|
4934
4669
|
|
|
4935
|
-
const { Schema: Schema$k, Instance: Instance$c } = lib$
|
|
4670
|
+
const { Schema: Schema$k, Instance: Instance$c } = lib$1;
|
|
4936
4671
|
|
|
4937
4672
|
|
|
4938
4673
|
const compile$g = async (schema, ast, parentSchema) => {
|
|
@@ -4953,7 +4688,7 @@ const interpret$g = ([minimum, isExclusive], instance) => {
|
|
|
4953
4688
|
|
|
4954
4689
|
var minimumExclusiveMinimum = { compile: compile$g, interpret: interpret$g };
|
|
4955
4690
|
|
|
4956
|
-
const { Schema: Schema$j, Instance: Instance$b } = lib$
|
|
4691
|
+
const { Schema: Schema$j, Instance: Instance$b } = lib$1;
|
|
4957
4692
|
|
|
4958
4693
|
|
|
4959
4694
|
const compile$f = async (schema) => Schema$j.value(schema);
|
|
@@ -4961,7 +4696,7 @@ const interpret$f = (minimum, instance) => !Instance$b.typeOf(instance, "number"
|
|
|
4961
4696
|
|
|
4962
4697
|
var minimum = { compile: compile$f, interpret: interpret$f };
|
|
4963
4698
|
|
|
4964
|
-
const { Schema: Schema$i, Instance: Instance$a } = lib$
|
|
4699
|
+
const { Schema: Schema$i, Instance: Instance$a } = lib$1;
|
|
4965
4700
|
|
|
4966
4701
|
|
|
4967
4702
|
const compile$e = (schema) => Schema$i.value(schema);
|
|
@@ -4979,7 +4714,7 @@ const numberEqual = (a, b) => Math.abs(a - b) < 1.19209290e-7;
|
|
|
4979
4714
|
|
|
4980
4715
|
var multipleOf = { compile: compile$e, interpret: interpret$e };
|
|
4981
4716
|
|
|
4982
|
-
const { Core: Core$f } = lib$
|
|
4717
|
+
const { Core: Core$f } = lib$1;
|
|
4983
4718
|
|
|
4984
4719
|
|
|
4985
4720
|
const compile$d = Core$f.compileSchema;
|
|
@@ -4987,7 +4722,7 @@ const interpret$d = (not, instance, ast, dynamicAnchors) => !Core$f.interpretSch
|
|
|
4987
4722
|
|
|
4988
4723
|
var not = { compile: compile$d, interpret: interpret$d };
|
|
4989
4724
|
|
|
4990
|
-
const { Core: Core$e, Schema: Schema$h } = lib$
|
|
4725
|
+
const { Core: Core$e, Schema: Schema$h } = lib$1;
|
|
4991
4726
|
|
|
4992
4727
|
|
|
4993
4728
|
const compile$c = async (schema, ast) => {
|
|
@@ -5036,7 +4771,7 @@ const collectEvaluatedItems$4 = (oneOf, instance, ast, dynamicAnchors) => {
|
|
|
5036
4771
|
|
|
5037
4772
|
var oneOf = { compile: compile$c, interpret: interpret$c, collectEvaluatedProperties: collectEvaluatedProperties$5, collectEvaluatedItems: collectEvaluatedItems$4 };
|
|
5038
4773
|
|
|
5039
|
-
const { Schema: Schema$g, Instance: Instance$9 } = lib$
|
|
4774
|
+
const { Schema: Schema$g, Instance: Instance$9 } = lib$1;
|
|
5040
4775
|
|
|
5041
4776
|
|
|
5042
4777
|
const compile$b = (schema) => new RegExp(Schema$g.value(schema), "u");
|
|
@@ -5044,8 +4779,8 @@ const interpret$b = (pattern, instance) => !Instance$9.typeOf(instance, "string"
|
|
|
5044
4779
|
|
|
5045
4780
|
var pattern = { compile: compile$b, interpret: interpret$b };
|
|
5046
4781
|
|
|
5047
|
-
const { Core: Core$d, Schema: Schema$f, Instance: Instance$8 } = lib$
|
|
5048
|
-
const Pact$2 = lib$
|
|
4782
|
+
const { Core: Core$d, Schema: Schema$f, Instance: Instance$8 } = lib$1;
|
|
4783
|
+
const Pact$2 = lib$3;
|
|
5049
4784
|
|
|
5050
4785
|
|
|
5051
4786
|
const compile$a = (schema, ast) => Pact$2.pipeline([
|
|
@@ -5082,8 +4817,8 @@ const splitUrl$1 = (url) => {
|
|
|
5082
4817
|
|
|
5083
4818
|
var common = { isObject, escapeRegExp: escapeRegExp$1, splitUrl: splitUrl$1 };
|
|
5084
4819
|
|
|
5085
|
-
const { Core: Core$c, Schema: Schema$e, Instance: Instance$7 } = lib$
|
|
5086
|
-
const Pact$1 = lib$
|
|
4820
|
+
const { Core: Core$c, Schema: Schema$e, Instance: Instance$7 } = lib$1;
|
|
4821
|
+
const Pact$1 = lib$3;
|
|
5087
4822
|
const { escapeRegExp } = common;
|
|
5088
4823
|
|
|
5089
4824
|
|
|
@@ -5108,7 +4843,7 @@ const collectEvaluatedProperties$3 = (properties, instance, ast, dynamicAnchors)
|
|
|
5108
4843
|
|
|
5109
4844
|
var properties = { compile: compile$9, interpret: interpret$9, collectEvaluatedProperties: collectEvaluatedProperties$3 };
|
|
5110
4845
|
|
|
5111
|
-
const { Core: Core$b, Instance: Instance$6 } = lib$
|
|
4846
|
+
const { Core: Core$b, Instance: Instance$6 } = lib$1;
|
|
5112
4847
|
|
|
5113
4848
|
|
|
5114
4849
|
const compile$8 = (schema, ast) => Core$b.compileSchema(schema, ast);
|
|
@@ -5120,7 +4855,7 @@ const interpret$8 = (propertyNames, instance, ast, dynamicAnchors) => {
|
|
|
5120
4855
|
|
|
5121
4856
|
var propertyNames = { compile: compile$8, interpret: interpret$8 };
|
|
5122
4857
|
|
|
5123
|
-
const { Core: Core$a, Schema: Schema$d } = lib$
|
|
4858
|
+
const { Core: Core$a, Schema: Schema$d } = lib$1;
|
|
5124
4859
|
const { splitUrl } = common;
|
|
5125
4860
|
|
|
5126
4861
|
|
|
@@ -5145,7 +4880,7 @@ const collectEvaluatedItems$3 = Core$a.collectEvaluatedItems;
|
|
|
5145
4880
|
|
|
5146
4881
|
var dynamicRef = { compile: compile$7, interpret: interpret$7, collectEvaluatedProperties: collectEvaluatedProperties$2, collectEvaluatedItems: collectEvaluatedItems$3 };
|
|
5147
4882
|
|
|
5148
|
-
const { Core: Core$9, Schema: Schema$c } = lib$
|
|
4883
|
+
const { Core: Core$9, Schema: Schema$c } = lib$1;
|
|
5149
4884
|
|
|
5150
4885
|
|
|
5151
4886
|
const compile$6 = async (ref, ast) => {
|
|
@@ -5159,7 +4894,7 @@ const collectEvaluatedItems$2 = Core$9.collectEvaluatedItems;
|
|
|
5159
4894
|
|
|
5160
4895
|
var ref = { compile: compile$6, interpret: interpret$6, collectEvaluatedProperties: collectEvaluatedProperties$1, collectEvaluatedItems: collectEvaluatedItems$2 };
|
|
5161
4896
|
|
|
5162
|
-
const { Schema: Schema$b, Instance: Instance$5 } = lib$
|
|
4897
|
+
const { Schema: Schema$b, Instance: Instance$5 } = lib$1;
|
|
5163
4898
|
|
|
5164
4899
|
|
|
5165
4900
|
const compile$5 = (schema) => Schema$b.value(schema);
|
|
@@ -5170,8 +4905,8 @@ const interpret$5 = (required, instance) => {
|
|
|
5170
4905
|
|
|
5171
4906
|
var required = { compile: compile$5, interpret: interpret$5 };
|
|
5172
4907
|
|
|
5173
|
-
const { Core: Core$8, Schema: Schema$a, Instance: Instance$4 } = lib$
|
|
5174
|
-
const Pact = lib$
|
|
4908
|
+
const { Core: Core$8, Schema: Schema$a, Instance: Instance$4 } = lib$1;
|
|
4909
|
+
const Pact = lib$3;
|
|
5175
4910
|
|
|
5176
4911
|
|
|
5177
4912
|
const compile$4 = (schema, ast) => {
|
|
@@ -5195,7 +4930,7 @@ const collectEvaluatedItems$1 = (items, instance, ast, dynamicAnchors) => {
|
|
|
5195
4930
|
|
|
5196
4931
|
var tupleItems = { compile: compile$4, interpret: interpret$4, collectEvaluatedItems: collectEvaluatedItems$1 };
|
|
5197
4932
|
|
|
5198
|
-
const { Schema: Schema$9, Instance: Instance$3 } = lib$
|
|
4933
|
+
const { Schema: Schema$9, Instance: Instance$3 } = lib$1;
|
|
5199
4934
|
|
|
5200
4935
|
|
|
5201
4936
|
const compile$3 = (schema) => Schema$9.value(schema);
|
|
@@ -5203,7 +4938,7 @@ const interpret$3 = (type, instance) => typeof type === "string" ? Instance$3.ty
|
|
|
5203
4938
|
|
|
5204
4939
|
var type = { compile: compile$3, interpret: interpret$3 };
|
|
5205
4940
|
|
|
5206
|
-
const { Core: Core$7, Schema: Schema$8, Instance: Instance$2 } = lib$
|
|
4941
|
+
const { Core: Core$7, Schema: Schema$8, Instance: Instance$2 } = lib$1;
|
|
5207
4942
|
|
|
5208
4943
|
|
|
5209
4944
|
const compile$2 = async (schema, ast, parentSchema) => {
|
|
@@ -5227,7 +4962,7 @@ const collectEvaluatedItems = (keywordValue, instance, ast, dynamicAnchors) => {
|
|
|
5227
4962
|
|
|
5228
4963
|
var unevaluatedItems = { compile: compile$2, interpret: interpret$2, collectEvaluatedItems };
|
|
5229
4964
|
|
|
5230
|
-
const { Core: Core$6, Schema: Schema$7, Instance: Instance$1 } = lib$
|
|
4965
|
+
const { Core: Core$6, Schema: Schema$7, Instance: Instance$1 } = lib$1;
|
|
5231
4966
|
|
|
5232
4967
|
|
|
5233
4968
|
const compile$1 = async (schema, ast, parentSchema) => {
|
|
@@ -5252,7 +4987,7 @@ const collectEvaluatedProperties = (keywordValue, instance, ast, dynamicAnchors)
|
|
|
5252
4987
|
|
|
5253
4988
|
var unevaluatedProperties = { compile: compile$1, interpret: interpret$1, collectEvaluatedProperties };
|
|
5254
4989
|
|
|
5255
|
-
const { Schema: Schema$6, Instance } = lib$
|
|
4990
|
+
const { Schema: Schema$6, Instance } = lib$1;
|
|
5256
4991
|
const jsonStringify = fastestStableStringify;
|
|
5257
4992
|
|
|
5258
4993
|
|
|
@@ -5269,7 +5004,7 @@ const interpret = (uniqueItems, instance) => {
|
|
|
5269
5004
|
|
|
5270
5005
|
var uniqueItems = { compile, interpret };
|
|
5271
5006
|
|
|
5272
|
-
const { Keywords: Keywords$1 } = lib$
|
|
5007
|
+
const { Keywords: Keywords$1 } = lib$1;
|
|
5273
5008
|
|
|
5274
5009
|
|
|
5275
5010
|
var keywords$5 = {
|
|
@@ -5296,14 +5031,12 @@ var keywords$5 = {
|
|
|
5296
5031
|
items202012: items202012,
|
|
5297
5032
|
maxItems: maxItems,
|
|
5298
5033
|
maxLength: maxLength,
|
|
5299
|
-
maxLength6: maxLength6,
|
|
5300
5034
|
maxProperties: maxProperties,
|
|
5301
5035
|
maximumExclusiveMaximum: maximumExclusiveMaximum,
|
|
5302
5036
|
maximum: maximum,
|
|
5303
5037
|
metaData: Keywords$1.metaData,
|
|
5304
5038
|
minItems: minItems,
|
|
5305
5039
|
minLength: minLength,
|
|
5306
|
-
minLength6: minLength6,
|
|
5307
5040
|
minProperties: minProperties,
|
|
5308
5041
|
minimumExclusiveMinimum: minimumExclusiveMinimum,
|
|
5309
5042
|
minimum: minimum,
|
|
@@ -5475,7 +5208,7 @@ var schema$4 = `{
|
|
|
5475
5208
|
"default": {}
|
|
5476
5209
|
}`;
|
|
5477
5210
|
|
|
5478
|
-
const { Core: Core$5, Schema: Schema$5 } = lib$
|
|
5211
|
+
const { Core: Core$5, Schema: Schema$5 } = lib$1;
|
|
5479
5212
|
const keywords$4 = keywords$5;
|
|
5480
5213
|
const metaSchema$4 = schema$4;
|
|
5481
5214
|
|
|
@@ -5677,7 +5410,7 @@ var schema$3 = `{
|
|
|
5677
5410
|
"default": {}
|
|
5678
5411
|
}`;
|
|
5679
5412
|
|
|
5680
|
-
const { Core: Core$4, Schema: Schema$4 } = lib$
|
|
5413
|
+
const { Core: Core$4, Schema: Schema$4 } = lib$1;
|
|
5681
5414
|
const keywords$3 = keywords$5;
|
|
5682
5415
|
const metaSchema$3 = schema$3;
|
|
5683
5416
|
|
|
@@ -5709,11 +5442,11 @@ Core$4.defineVocabulary(jsonSchemaVersion$3, {
|
|
|
5709
5442
|
"format": keywords$3.metaData,
|
|
5710
5443
|
"items": keywords$3.items,
|
|
5711
5444
|
"maxItems": keywords$3.maxItems,
|
|
5712
|
-
"maxLength": keywords$3.
|
|
5445
|
+
"maxLength": keywords$3.maxLength,
|
|
5713
5446
|
"maxProperties": keywords$3.maxProperties,
|
|
5714
5447
|
"maximum": keywords$3.maximum,
|
|
5715
5448
|
"minItems": keywords$3.minItems,
|
|
5716
|
-
"minLength": keywords$3.
|
|
5449
|
+
"minLength": keywords$3.minLength,
|
|
5717
5450
|
"minProperties": keywords$3.minProperties,
|
|
5718
5451
|
"minimum": keywords$3.minimum,
|
|
5719
5452
|
"multipleOf": keywords$3.multipleOf,
|
|
@@ -5902,7 +5635,7 @@ var schema$2 = `{
|
|
|
5902
5635
|
"default": true
|
|
5903
5636
|
}`;
|
|
5904
5637
|
|
|
5905
|
-
const { Core: Core$3, Schema: Schema$3 } = lib$
|
|
5638
|
+
const { Core: Core$3, Schema: Schema$3 } = lib$1;
|
|
5906
5639
|
const keywords$2 = keywords$5;
|
|
5907
5640
|
const metaSchema$2 = schema$2;
|
|
5908
5641
|
|
|
@@ -5936,11 +5669,11 @@ Core$3.defineVocabulary(jsonSchemaVersion$2, {
|
|
|
5936
5669
|
"else": keywords$2.else,
|
|
5937
5670
|
"items": keywords$2.items,
|
|
5938
5671
|
"maxItems": keywords$2.maxItems,
|
|
5939
|
-
"maxLength": keywords$2.
|
|
5672
|
+
"maxLength": keywords$2.maxLength,
|
|
5940
5673
|
"maxProperties": keywords$2.maxProperties,
|
|
5941
5674
|
"maximum": keywords$2.maximum,
|
|
5942
5675
|
"minItems": keywords$2.minItems,
|
|
5943
|
-
"minLength": keywords$2.
|
|
5676
|
+
"minLength": keywords$2.minLength,
|
|
5944
5677
|
"minProperties": keywords$2.minProperties,
|
|
5945
5678
|
"minimum": keywords$2.minimum,
|
|
5946
5679
|
"multipleOf": keywords$2.multipleOf,
|
|
@@ -6285,7 +6018,7 @@ var content$1 = `{
|
|
|
6285
6018
|
}
|
|
6286
6019
|
}`;
|
|
6287
6020
|
|
|
6288
|
-
const { Core: Core$2, Schema: Schema$2 } = lib$
|
|
6021
|
+
const { Core: Core$2, Schema: Schema$2 } = lib$1;
|
|
6289
6022
|
const keywords$1 = keywords$5;
|
|
6290
6023
|
const metaSchema$1 = schema$1;
|
|
6291
6024
|
const coreMetaSchema$1 = core$1;
|
|
@@ -6344,11 +6077,11 @@ Core$2.defineVocabulary("https://json-schema.org/draft/2019-09/vocab/validation"
|
|
|
6344
6077
|
"exclusiveMaximum": keywords$1.exclusiveMaximum,
|
|
6345
6078
|
"exclusiveMinimum": keywords$1.exclusiveMinimum,
|
|
6346
6079
|
"maxItems": keywords$1.maxItems,
|
|
6347
|
-
"maxLength": keywords$1.
|
|
6080
|
+
"maxLength": keywords$1.maxLength,
|
|
6348
6081
|
"maxProperties": keywords$1.maxProperties,
|
|
6349
6082
|
"maximum": keywords$1.maximum,
|
|
6350
6083
|
"minItems": keywords$1.minItems,
|
|
6351
|
-
"minLength": keywords$1.
|
|
6084
|
+
"minLength": keywords$1.minLength,
|
|
6352
6085
|
"minProperties": keywords$1.minProperties,
|
|
6353
6086
|
"minimum": keywords$1.minimum,
|
|
6354
6087
|
"multipleOf": keywords$1.multipleOf,
|
|
@@ -6732,7 +6465,7 @@ var unevaluated = `{
|
|
|
6732
6465
|
}
|
|
6733
6466
|
}`;
|
|
6734
6467
|
|
|
6735
|
-
const { Core: Core$1, Schema: Schema$1 } = lib$
|
|
6468
|
+
const { Core: Core$1, Schema: Schema$1 } = lib$1;
|
|
6736
6469
|
const keywords = keywords$5;
|
|
6737
6470
|
const metaSchema = schema;
|
|
6738
6471
|
const coreMetaSchema = core;
|
|
@@ -6791,11 +6524,11 @@ Core$1.defineVocabulary("https://json-schema.org/draft/2020-12/vocab/validation"
|
|
|
6791
6524
|
"exclusiveMaximum": keywords.exclusiveMaximum,
|
|
6792
6525
|
"exclusiveMinimum": keywords.exclusiveMinimum,
|
|
6793
6526
|
"maxItems": keywords.maxItems,
|
|
6794
|
-
"maxLength": keywords.
|
|
6527
|
+
"maxLength": keywords.maxLength,
|
|
6795
6528
|
"maxProperties": keywords.maxProperties,
|
|
6796
6529
|
"maximum": keywords.maximum,
|
|
6797
6530
|
"minItems": keywords.minItems,
|
|
6798
|
-
"minLength": keywords.
|
|
6531
|
+
"minLength": keywords.minLength,
|
|
6799
6532
|
"minProperties": keywords.minProperties,
|
|
6800
6533
|
"minimum": keywords.minimum,
|
|
6801
6534
|
"multipleOf": keywords.multipleOf,
|
|
@@ -6836,7 +6569,7 @@ Core$1.defineVocabulary("https://json-schema.org/draft/2020-12/vocab/unevaluated
|
|
|
6836
6569
|
"unevaluatedProperties": keywords.unevaluatedProperties
|
|
6837
6570
|
});
|
|
6838
6571
|
|
|
6839
|
-
const { Core, Schema, InvalidSchemaError } = lib$
|
|
6572
|
+
const { Core, Schema, InvalidSchemaError } = lib$1;
|
|
6840
6573
|
const Keywords = keywords$5;
|
|
6841
6574
|
|
|
6842
6575
|
|