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