arktype 3.0.0-beta.2 → 3.0.0-rc.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +55 -20
- package/out/_internal/regex/quantify.d.ts +17 -1
- package/out/_internal/schema/refinements/range.d.ts +2 -1
- package/out/_internal/schema/roots/domain.d.ts +1 -0
- package/out/_internal/schema/roots/root.d.ts +3 -1
- package/out/_internal/schema/roots/union.d.ts +8 -3
- package/out/_internal/schema/shared/compile.d.ts +2 -0
- package/out/_internal/schema/shared/declare.d.ts +9 -6
- package/out/_internal/schema/shared/errors.d.ts +3 -0
- package/out/_internal/schema/shared/issues.d.ts +5 -1
- package/out/_internal/schema/shared/issuesLean.d.ts +4 -0
- package/out/_internal/schema/shared/issuesNone.d.ts +1 -0
- package/out/_internal/schema/shared/issuesNoneLean.d.ts +1 -0
- package/out/_internal/schema/shared/standardFailure.d.ts +1 -0
- package/out/_internal/schema/shared/toJsonSchema.d.ts +16 -3
- package/out/_internal/schema/shared/transform.d.ts +1 -0
- package/out/_internal/sets/constraint.d.ts +2 -0
- package/out/_internal/sets/fromJsonSchema.d.ts +3 -1
- package/out/_internal/util/registry.d.ts +1 -1
- package/out/attributes.d.ts +12 -8
- package/out/chunk-2FVJ5JBN.js +161 -0
- package/out/{chunk-QBX4MEQR.js → chunk-3HZC67MT.js} +15 -15
- package/out/{chunk-5TN5JRP7.js → chunk-3KBOPH3J.js} +63 -41
- package/out/{chunk-GPNWBJL3.js → chunk-3WYMLH45.js} +17 -11
- package/out/{chunk-NIZDOWFU.js → chunk-46PLKNON.js} +2 -2
- package/out/{chunk-7JXN4WJX.js → chunk-4FTHWK63.js} +1 -1
- package/out/{chunk-EA2DNEDI.js → chunk-4HREHNIV.js} +12 -12
- package/out/{chunk-ZFB6DQWY.js → chunk-4J7H2ELX.js} +6 -11
- package/out/{chunk-7SVIUP6X.js → chunk-4MUH2MO4.js} +2 -2
- package/out/{chunk-J7CKAEDX.js → chunk-4NZCLVBD.js} +1 -1
- package/out/{chunk-RAM6G3F6.js → chunk-54U3D6OV.js} +26 -25
- package/out/{chunk-HA3POWOU.js → chunk-5FNHK7CC.js} +6 -5
- package/out/{chunk-KVQCLBJR.js → chunk-7SUZFAHZ.js} +241 -66
- package/out/{chunk-YMYPW3L5.js → chunk-AMNHRY72.js} +3 -3
- package/out/{chunk-UH6XKS3C.js → chunk-BQR65UPE.js} +30 -9
- package/out/{chunk-V4TZHFNK.js → chunk-BWKJV74G.js} +1 -1
- package/out/{chunk-7N3JEHA4.js → chunk-CXHXN7DF.js} +1 -1
- package/out/{chunk-FY4M7GE7.js → chunk-E4OQHHFS.js} +4 -4
- package/out/{chunk-CGWRW4JZ.js → chunk-ERGIJZFA.js} +4 -4
- package/out/{chunk-OA5Q2JLI.js → chunk-H44UG6HG.js} +8 -4
- package/out/{chunk-A7A6FDBS.js → chunk-I65VSWGS.js} +50 -44
- package/out/{chunk-C5JGK6GT.js → chunk-J2BFVWVY.js} +20 -3
- package/out/{chunk-W77ROLOT.js → chunk-JIILWIU4.js} +1 -1
- package/out/{chunk-5WRZ25AB.js → chunk-LMUBBBHJ.js} +4 -4
- package/out/{chunk-CQU7WIIR.js → chunk-P3HEEGB5.js} +6 -6
- package/out/{chunk-JZ4KBCMM.js → chunk-RKJNLXEQ.js} +21 -13
- package/out/{chunk-XMEK4I7J.js → chunk-TM22D5DL.js} +887 -266
- package/out/{chunk-PIFOURNM.js → chunk-TQYLOZRT.js} +11 -4
- package/out/{chunk-YN3XRJ7H.js → chunk-UJJGG4VQ.js} +1 -1
- package/out/{chunk-NIYAI7AF.js → chunk-US6BWOGJ.js} +3 -3
- package/out/{chunk-57LF5Y5P.js → chunk-W2XOI5DY.js} +1 -1
- package/out/{chunk-KDMHK4KP.js → chunk-XVLEFUSY.js} +2 -2
- package/out/{chunk-SGFGLENC.js → chunk-YPN67JMD.js} +3 -3
- package/out/cli.d.ts +5 -1
- package/out/cli.js +301 -49
- package/out/codecs.d.ts +4 -3
- package/out/codecs.js +18 -18
- package/out/config.js +8 -8
- package/out/declare.d.ts +2 -4
- package/out/errors.js +8 -8
- package/out/fn.d.ts +2 -2
- package/out/fromJsonSchema.d.ts +1 -1
- package/out/generic.d.ts +7 -4
- package/out/i18n.js +5 -5
- package/out/index.js +19 -19
- package/out/internal.js +32 -32
- package/out/island.js +18 -18
- package/out/islandDependency.js +33 -33
- package/out/jsonSchema/infer.d.ts +16 -6
- package/out/jsonSchema/validate.d.ts +16 -4
- package/out/keywords/functions.d.ts +4 -169
- package/out/keywords/keywords.d.ts +1 -1
- package/out/keywords/phrases.d.ts +3 -168
- package/out/keywords/ts.js +14 -14
- package/out/locales/de.js +6 -6
- package/out/locales/en.js +15 -15
- package/out/match.d.ts +12 -9
- package/out/mutatesInput.js +14 -14
- package/out/nary.d.ts +219 -193
- package/out/parser/definition.d.ts +2 -2
- package/out/parser/shift/operator/default.d.ts +2 -2
- package/out/parser/tupleExpressions.d.ts +2 -0
- package/out/precompiled.js +11 -11
- package/out/runtime.d.ts +1 -1
- package/out/runtime.js +5 -5
- package/out/schema.js +11 -11
- package/out/schemaInternal.js +29 -17
- package/out/schemaRuntime.js +4 -4
- package/out/schemaRuntimeLean.js +60 -36
- package/out/schemaRuntimeNone.js +52 -31
- package/out/schemaRuntimeNoneLean.js +52 -31
- package/out/type.d.ts +3 -3
- package/out/util.js +14 -11
- package/out/variants/base.d.ts +9 -8
- package/out/variants/object.d.ts +14 -6
- package/package.json +4 -4
- package/skills/arktype/SKILL.md +17 -17
- package/skills/arktype/references/migrating.md +13 -13
- package/skills/arktype/references/precompile.md +4 -4
- package/out/chunk-CSVAPWDE.js +0 -83
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
import {
|
|
2
2
|
inPlaceTransforms,
|
|
3
3
|
inputOnlyMorphs
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-LMUBBBHJ.js";
|
|
5
5
|
import {
|
|
6
6
|
parseDate,
|
|
7
7
|
parseInteger,
|
|
8
8
|
parseIsoDate,
|
|
9
9
|
parseJson,
|
|
10
10
|
parseUrl
|
|
11
|
-
} from "./chunk-
|
|
11
|
+
} from "./chunk-4HREHNIV.js";
|
|
12
12
|
import {
|
|
13
13
|
$ark
|
|
14
|
-
} from "./chunk-
|
|
14
|
+
} from "./chunk-I65VSWGS.js";
|
|
15
15
|
|
|
16
16
|
// ../schema/out/mutatesInput.js
|
|
17
17
|
$ark.inPlace = inPlaceTransforms;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
InternalTypedFn
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-4FTHWK63.js";
|
|
4
4
|
import {
|
|
5
5
|
dateGetTime,
|
|
6
6
|
getBuiltinNameOfConstructor,
|
|
@@ -11,7 +11,7 @@ import {
|
|
|
11
11
|
stringifyPath,
|
|
12
12
|
throwError,
|
|
13
13
|
throwParseError
|
|
14
|
-
} from "./chunk-
|
|
14
|
+
} from "./chunk-3HZC67MT.js";
|
|
15
15
|
|
|
16
16
|
// out/runtime.js
|
|
17
17
|
import { ArkErrors as ArkErrors2, codedIssue, describeActual, enInfo, errorsOf, failsKey, failsKeySite, failsSite, findsOnRead, FirstIssues, holdsExpression, inContext, isCustomIssue, issueAt, issuesOf, mergeIssues, runtimeConfig as runtimeConfig2, sharedMessageOf, supportedJsonSchemaTargets, throwOnDefault, ToJsonSchemaError, traversesUnions, validateStandardJsonSchemaTarget, writeFromPath, writeListed, withContextOf } from "arktype/schema/runtime";
|
|
@@ -810,7 +810,7 @@ var union = ((branches, description, issueOf, fails) => {
|
|
|
810
810
|
});
|
|
811
811
|
|
|
812
812
|
// out/runtime.js
|
|
813
|
-
var
|
|
813
|
+
var precompiledForArktype_3_0_0_rc_1 = true;
|
|
814
814
|
var assign = /* @__PURE__ */ (() => Object.assign)();
|
|
815
815
|
var is = /* @__PURE__ */ (() => Object.is)();
|
|
816
816
|
var freeze = /* @__PURE__ */ (() => Object.freeze)();
|
|
@@ -859,10 +859,25 @@ var failureMessage = {
|
|
|
859
859
|
},
|
|
860
860
|
enumerable: true
|
|
861
861
|
};
|
|
862
|
-
var
|
|
863
|
-
value
|
|
864
|
-
|
|
865
|
-
|
|
862
|
+
var failureToJson = {
|
|
863
|
+
value() {
|
|
864
|
+
return {
|
|
865
|
+
issues: this._s(true),
|
|
866
|
+
message: this._s()
|
|
867
|
+
};
|
|
868
|
+
},
|
|
869
|
+
writable: true,
|
|
870
|
+
configurable: true
|
|
871
|
+
};
|
|
872
|
+
var standardResultOf = (out) => {
|
|
873
|
+
if (!(out instanceof ArkErrors2))
|
|
874
|
+
return { value: out };
|
|
875
|
+
const issues = out.issues;
|
|
876
|
+
return Object.defineProperty(Object.defineProperty(Object.defineProperty({ issues }, "_s", {
|
|
877
|
+
value: (json) => json ? typeof out.toJSON === "function" ? out.toJSON() : issues.toJSON() : out.summary,
|
|
878
|
+
writable: true
|
|
879
|
+
}), "message", failureMessage), "toJSON", failureToJson);
|
|
880
|
+
};
|
|
866
881
|
var standardValidated = (validator, input, options) => {
|
|
867
882
|
const context = options?.libraryOptions?.context;
|
|
868
883
|
return standardResultOf(context === void 0 ? validator(input, void 0, null) : inContext(context, () => validator(input, void 0, null)));
|
|
@@ -1186,7 +1201,13 @@ var InvalidErrors = /* @__PURE__ */ (() => {
|
|
|
1186
1201
|
}
|
|
1187
1202
|
get _() {
|
|
1188
1203
|
return this._f ??= [
|
|
1189
|
-
{
|
|
1204
|
+
{
|
|
1205
|
+
code: "predicate",
|
|
1206
|
+
path: [],
|
|
1207
|
+
data: this._d,
|
|
1208
|
+
expected: "valid",
|
|
1209
|
+
message: "is invalid"
|
|
1210
|
+
}
|
|
1190
1211
|
];
|
|
1191
1212
|
}
|
|
1192
1213
|
}
|
|
@@ -1459,7 +1480,7 @@ export {
|
|
|
1459
1480
|
discriminate,
|
|
1460
1481
|
discriminateOr,
|
|
1461
1482
|
union,
|
|
1462
|
-
|
|
1483
|
+
precompiledForArktype_3_0_0_rc_1,
|
|
1463
1484
|
assign,
|
|
1464
1485
|
is,
|
|
1465
1486
|
freeze,
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import {
|
|
2
2
|
encode,
|
|
3
3
|
inverses
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-2FVJ5JBN.js";
|
|
5
5
|
import {
|
|
6
6
|
type
|
|
7
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-3WYMLH45.js";
|
|
8
8
|
import {
|
|
9
9
|
capitalizeString,
|
|
10
10
|
keepFormatted,
|
|
@@ -23,10 +23,10 @@ import {
|
|
|
23
23
|
writeEpoch,
|
|
24
24
|
writeIsoDate,
|
|
25
25
|
writeUrl
|
|
26
|
-
} from "./chunk-
|
|
26
|
+
} from "./chunk-4HREHNIV.js";
|
|
27
27
|
import {
|
|
28
28
|
$ark
|
|
29
|
-
} from "./chunk-
|
|
29
|
+
} from "./chunk-I65VSWGS.js";
|
|
30
30
|
|
|
31
31
|
// ../schema/out/codecs.js
|
|
32
32
|
$ark.encode = encode;
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import {
|
|
2
2
|
CompiledFunction
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-TQYLOZRT.js";
|
|
4
4
|
import {
|
|
5
5
|
ArkTraversal,
|
|
6
6
|
applyUnread
|
|
7
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-I65VSWGS.js";
|
|
8
8
|
import {
|
|
9
9
|
TransformErrors,
|
|
10
10
|
addMorphErrs,
|
|
@@ -12,10 +12,10 @@ import {
|
|
|
12
12
|
allowsInContext,
|
|
13
13
|
applyCyclic,
|
|
14
14
|
transformResolution
|
|
15
|
-
} from "./chunk-
|
|
15
|
+
} from "./chunk-3KBOPH3J.js";
|
|
16
16
|
import {
|
|
17
17
|
unset
|
|
18
|
-
} from "./chunk-
|
|
18
|
+
} from "./chunk-3HZC67MT.js";
|
|
19
19
|
|
|
20
20
|
// ../schema/out/shared/rootApply.js
|
|
21
21
|
var rootApplyRuntime = {
|
|
@@ -8,17 +8,19 @@ import {
|
|
|
8
8
|
unrenderedLocaleMessage,
|
|
9
9
|
unwrittenError,
|
|
10
10
|
writeActual,
|
|
11
|
+
writeInvalidLocaleObjectMessage,
|
|
11
12
|
writeKeywordExpected,
|
|
12
13
|
writeText
|
|
13
|
-
} from "./chunk-
|
|
14
|
+
} from "./chunk-I65VSWGS.js";
|
|
14
15
|
import {
|
|
15
16
|
describeActual
|
|
16
|
-
} from "./chunk-
|
|
17
|
+
} from "./chunk-3KBOPH3J.js";
|
|
17
18
|
import {
|
|
18
19
|
omit,
|
|
19
20
|
stringifyPath,
|
|
20
|
-
throwError
|
|
21
|
-
|
|
21
|
+
throwError,
|
|
22
|
+
throwParseError
|
|
23
|
+
} from "./chunk-3HZC67MT.js";
|
|
22
24
|
|
|
23
25
|
// ../schema/out/shared/render.js
|
|
24
26
|
var defaultLocale;
|
|
@@ -122,6 +124,8 @@ var isDefaultDescription = function (error, description) {
|
|
|
122
124
|
};
|
|
123
125
|
var normalizedLocales = /* @__PURE__ */ new WeakMap();
|
|
124
126
|
var normalizeLocale = function (locale) {
|
|
127
|
+
if (typeof locale !== "object" || locale === null || Array.isArray(locale))
|
|
128
|
+
throwParseError(writeInvalidLocaleObjectMessage(locale));
|
|
125
129
|
const en = defaultLocale ??= $ark.defaultConfig.locale;
|
|
126
130
|
if (locale === en)
|
|
127
131
|
return en;
|
|
@@ -10,6 +10,7 @@ import {
|
|
|
10
10
|
isCustomIssue,
|
|
11
11
|
issueAt,
|
|
12
12
|
messageOf,
|
|
13
|
+
pathOf,
|
|
13
14
|
throwOnProblem,
|
|
14
15
|
writeDomainActual,
|
|
15
16
|
writeLengthActual,
|
|
@@ -20,12 +21,12 @@ import {
|
|
|
20
21
|
writeProtoActual,
|
|
21
22
|
writeUnitActual,
|
|
22
23
|
writeUnitMessage
|
|
23
|
-
} from "./chunk-
|
|
24
|
+
} from "./chunk-3KBOPH3J.js";
|
|
24
25
|
import {
|
|
25
26
|
nameOf,
|
|
26
27
|
register,
|
|
27
28
|
registry
|
|
28
|
-
} from "./chunk-
|
|
29
|
+
} from "./chunk-J2BFVWVY.js";
|
|
29
30
|
import {
|
|
30
31
|
appendStringifiedKey,
|
|
31
32
|
appendUnique,
|
|
@@ -38,8 +39,9 @@ import {
|
|
|
38
39
|
printKind,
|
|
39
40
|
printable,
|
|
40
41
|
stringifyPath,
|
|
41
|
-
throwError
|
|
42
|
-
|
|
42
|
+
throwError,
|
|
43
|
+
throwParseError
|
|
44
|
+
} from "./chunk-3HZC67MT.js";
|
|
43
45
|
|
|
44
46
|
// ../schema/out/shared/errorWriters.js
|
|
45
47
|
var errorWriters = {
|
|
@@ -121,6 +123,7 @@ var ThrownErrors = ThrownIssues;
|
|
|
121
123
|
var writtenKey = Symbol("written");
|
|
122
124
|
var localeKey = Symbol("locale");
|
|
123
125
|
var configKey = Symbol("config");
|
|
126
|
+
var hasInstance = Function.prototype[Symbol.hasInstance];
|
|
124
127
|
var ArkErrors = class ArkErrors extends Issues {
|
|
125
128
|
constructor(config) {
|
|
126
129
|
super();
|
|
@@ -142,13 +145,13 @@ var ArkErrors = class ArkErrors extends Issues {
|
|
|
142
145
|
*/
|
|
143
146
|
get issues() {
|
|
144
147
|
const issues = this._;
|
|
145
|
-
if (this[writtenKey]
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
return issues;
|
|
148
|
+
if (this[writtenKey] < issues.length) {
|
|
149
|
+
const locale = selectedLocaleOf(this);
|
|
150
|
+
const config = this[configKey];
|
|
151
|
+
while (this[writtenKey] < issues.length)
|
|
152
|
+
writeError(issues[this[writtenKey]++], config, locale);
|
|
153
|
+
}
|
|
154
|
+
return serializableErrors(issues);
|
|
152
155
|
}
|
|
153
156
|
/** @internal the first of issues, its text written alone */
|
|
154
157
|
get _first() {
|
|
@@ -193,7 +196,7 @@ var ArkErrors = class ArkErrors extends Issues {
|
|
|
193
196
|
}
|
|
194
197
|
/** @internal */
|
|
195
198
|
_merge(merged, prefix) {
|
|
196
|
-
if (merged
|
|
199
|
+
if (hasInstance.call(ArkErrors, merged))
|
|
197
200
|
return mergeErrors(this, merged, prefix);
|
|
198
201
|
const config = this[configKey];
|
|
199
202
|
for (const issue of merged.issues) {
|
|
@@ -209,6 +212,11 @@ var ArkErrors = class ArkErrors extends Issues {
|
|
|
209
212
|
return this._;
|
|
210
213
|
}
|
|
211
214
|
};
|
|
215
|
+
Object.defineProperty(ArkErrors, Symbol.hasInstance, {
|
|
216
|
+
value(value) {
|
|
217
|
+
return this === ArkErrors ? value instanceof Issues : hasInstance.call(this, value);
|
|
218
|
+
}
|
|
219
|
+
});
|
|
212
220
|
var selectedLocaleOf = (errors) => errors[localeKey] ??= renderer?.select(errors[configKey]) ?? errors[configKey].locale;
|
|
213
221
|
var pathEquals = function (l, r) {
|
|
214
222
|
if (l.length !== r.length)
|
|
@@ -644,10 +652,16 @@ var asTemplated = function (error, line) {
|
|
|
644
652
|
templated.add(error);
|
|
645
653
|
if (line !== void 0)
|
|
646
654
|
noteLine(error, line);
|
|
647
|
-
} else if (
|
|
655
|
+
} else if (line !== void 0)
|
|
656
|
+
error._l = line;
|
|
657
|
+
if (error.message?.startsWith("must be "))
|
|
648
658
|
error.expected = error.message.slice(8);
|
|
649
659
|
else if (error.message === "is invalid")
|
|
650
|
-
error.expected =
|
|
660
|
+
error.expected = "valid";
|
|
661
|
+
else if (!isArkError(error) && error._l === void 0 && error.message !== void 0) {
|
|
662
|
+
const path = pathOf(error);
|
|
663
|
+
error._l = path ? `${path} ${error.message}` : error.message;
|
|
664
|
+
}
|
|
651
665
|
return error;
|
|
652
666
|
};
|
|
653
667
|
var isCustom = function (error) {
|
|
@@ -810,7 +824,12 @@ var configureLocale = function (locale, base) {
|
|
|
810
824
|
}
|
|
811
825
|
return renderer ? renderer.configure(locale, base) : locale === void 0 || locale === base.locale ? base.locale : throwError(unrenderedLocaleMessage);
|
|
812
826
|
};
|
|
813
|
-
var resolveLocale =
|
|
827
|
+
var resolveLocale = function (locale) {
|
|
828
|
+
if (typeof locale !== "object" || locale === null || Array.isArray(locale))
|
|
829
|
+
throwParseError(writeInvalidLocaleObjectMessage(locale));
|
|
830
|
+
return renderer ? renderer.normalize(locale) : locale;
|
|
831
|
+
};
|
|
832
|
+
var writeInvalidLocaleObjectMessage = (locale) => `Expected a Locale object like \`de\` from "arktype/locales/de" (was ${printable(locale)})`;
|
|
814
833
|
var writtenIn = function (error, locale) {
|
|
815
834
|
const config = configOf(error);
|
|
816
835
|
if (!renderer && locale !== config.locale)
|
|
@@ -858,37 +877,22 @@ var summarize = function (issues, locale) {
|
|
|
858
877
|
result += (i ? "\n" : "") + lineOf(issues[i], locale);
|
|
859
878
|
return result;
|
|
860
879
|
};
|
|
861
|
-
var jsonOf = function (error) {
|
|
862
|
-
|
|
863
|
-
|
|
864
|
-
|
|
865
|
-
|
|
866
|
-
|
|
867
|
-
|
|
868
|
-
json.path = v.map(jsonKeyOf);
|
|
869
|
-
else if (k === "errors")
|
|
870
|
-
json.errors = v.map(jsonOf);
|
|
871
|
-
else if (isJsonPrimitive(v))
|
|
872
|
-
json[k] = v;
|
|
873
|
-
}
|
|
874
|
-
return json;
|
|
875
|
-
};
|
|
876
|
-
var isJsonPrimitive = (v) => v === null || typeof v === "string" || typeof v === "number" || typeof v === "boolean";
|
|
880
|
+
var jsonOf = function (error) { return ({
|
|
881
|
+
code: error.code,
|
|
882
|
+
path: error.path.map(jsonKeyOf),
|
|
883
|
+
...error.expected !== void 0 && { expected: error.expected },
|
|
884
|
+
message: error.message,
|
|
885
|
+
...error.code === "union" && error.errors.length > 0 ? { errors: error.errors.map(jsonOf) } : {}
|
|
886
|
+
}) };
|
|
877
887
|
var jsonKeyOf = (k) => typeof k === "symbol" ? String(k) : k;
|
|
878
|
-
var
|
|
879
|
-
|
|
880
|
-
|
|
881
|
-
|
|
882
|
-
|
|
883
|
-
|
|
884
|
-
rule: 1,
|
|
885
|
-
predicate: 1,
|
|
886
|
-
morph: 1,
|
|
887
|
-
cause: 1,
|
|
888
|
-
missing: 1,
|
|
889
|
-
valueMeta: 1,
|
|
890
|
-
cases: 1
|
|
888
|
+
var errorsToJson = {
|
|
889
|
+
value() {
|
|
890
|
+
return this.map(jsonOf);
|
|
891
|
+
},
|
|
892
|
+
writable: true,
|
|
893
|
+
configurable: true
|
|
891
894
|
};
|
|
895
|
+
var serializableErrors = (issues) => issues.toJSON ? issues : Object.defineProperty(issues, "toJSON", errorsToJson);
|
|
892
896
|
var firstIssue = (errors) => errors._first ?? errors.issues[0];
|
|
893
897
|
var byPath = function (errors) {
|
|
894
898
|
const result = {};
|
|
@@ -1093,7 +1097,9 @@ export {
|
|
|
1093
1097
|
registerLocaleRenderer,
|
|
1094
1098
|
defaultConfig,
|
|
1095
1099
|
configureLocale,
|
|
1100
|
+
writeInvalidLocaleObjectMessage,
|
|
1096
1101
|
unwrittenError,
|
|
1102
|
+
serializableErrors,
|
|
1097
1103
|
firstIssue,
|
|
1098
1104
|
byPath,
|
|
1099
1105
|
flatByPath,
|
|
@@ -1,13 +1,30 @@
|
|
|
1
1
|
import {
|
|
2
2
|
FileConstructor,
|
|
3
3
|
baseNameOf
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-3HZC67MT.js";
|
|
5
5
|
|
|
6
6
|
// ../util/out/registry.js
|
|
7
|
-
var arkUtilVersion = "3.0.0-
|
|
7
|
+
var arkUtilVersion = "3.0.0-rc.1";
|
|
8
|
+
var reservedRegistryKeys = {
|
|
9
|
+
inPlace: void 0,
|
|
10
|
+
errorModes: void 0,
|
|
11
|
+
encode: void 0,
|
|
12
|
+
sets: void 0,
|
|
13
|
+
kw: void 0,
|
|
14
|
+
config: void 0,
|
|
15
|
+
cfg: void 0,
|
|
16
|
+
defaultConfig: void 0,
|
|
17
|
+
ambient: void 0,
|
|
18
|
+
nodesById: void 0,
|
|
19
|
+
reached: void 0,
|
|
20
|
+
deferDefaultCheck: void 0,
|
|
21
|
+
eagerTypes: void 0,
|
|
22
|
+
typeAttachments: void 0
|
|
23
|
+
};
|
|
8
24
|
var initialRegistryContents = {
|
|
9
25
|
version: arkUtilVersion,
|
|
10
|
-
FileConstructor
|
|
26
|
+
FileConstructor,
|
|
27
|
+
...reservedRegistryKeys
|
|
11
28
|
};
|
|
12
29
|
var registry = initialRegistryContents;
|
|
13
30
|
var namesByResolution = /* @__PURE__ */ new Map();
|
|
@@ -1,18 +1,18 @@
|
|
|
1
1
|
import {
|
|
2
2
|
precompileInPlace
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-7SUZFAHZ.js";
|
|
4
4
|
import {
|
|
5
5
|
arrayIndexMatcher
|
|
6
6
|
} from "./chunk-CWSF57VM.js";
|
|
7
7
|
import {
|
|
8
8
|
$ark
|
|
9
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-I65VSWGS.js";
|
|
10
10
|
import {
|
|
11
11
|
hasArkKind
|
|
12
|
-
} from "./chunk-
|
|
12
|
+
} from "./chunk-3KBOPH3J.js";
|
|
13
13
|
import {
|
|
14
14
|
arityOf
|
|
15
|
-
} from "./chunk-
|
|
15
|
+
} from "./chunk-3HZC67MT.js";
|
|
16
16
|
|
|
17
17
|
// ../schema/out/shared/inPlace.js
|
|
18
18
|
var keys = () => ({ every: false, indices: false, named: /* @__PURE__ */ new Set() });
|
|
@@ -3,13 +3,13 @@ import {
|
|
|
3
3
|
copyConfig,
|
|
4
4
|
isSameConfig,
|
|
5
5
|
validateToJsonSchemaTarget
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-W2XOI5DY.js";
|
|
7
7
|
import {
|
|
8
8
|
editsBetween
|
|
9
9
|
} from "./chunk-TACLEIDM.js";
|
|
10
10
|
import {
|
|
11
11
|
compileSerializedValue
|
|
12
|
-
} from "./chunk-
|
|
12
|
+
} from "./chunk-TQYLOZRT.js";
|
|
13
13
|
import {
|
|
14
14
|
$ark,
|
|
15
15
|
configureAfterTypeMessage,
|
|
@@ -18,11 +18,11 @@ import {
|
|
|
18
18
|
errorWritersByCode,
|
|
19
19
|
namedReference,
|
|
20
20
|
registeredReference
|
|
21
|
-
} from "./chunk-
|
|
21
|
+
} from "./chunk-I65VSWGS.js";
|
|
22
22
|
import {
|
|
23
23
|
isNode,
|
|
24
24
|
removedProblemMessage
|
|
25
|
-
} from "./chunk-
|
|
25
|
+
} from "./chunk-3KBOPH3J.js";
|
|
26
26
|
import {
|
|
27
27
|
envHasCsp,
|
|
28
28
|
flatMorph,
|
|
@@ -33,7 +33,7 @@ import {
|
|
|
33
33
|
serializePrimitive,
|
|
34
34
|
throwInternalError,
|
|
35
35
|
throwParseError
|
|
36
|
-
} from "./chunk-
|
|
36
|
+
} from "./chunk-3HZC67MT.js";
|
|
37
37
|
|
|
38
38
|
// ../schema/out/shared/implement.js
|
|
39
39
|
var basisKinds = ["unit", "proto", "domain"];
|
|
@@ -86,7 +86,7 @@ var precedenceOfKind = (kind) => precedenceByKind[kind];
|
|
|
86
86
|
var schemaKindsRightOf = (kind) => rootKinds.slice(precedenceOfKind(kind) + 1);
|
|
87
87
|
var unionChildKinds = /* @__PURE__ */ (() => [...schemaKindsRightOf("union"), "alias"])();
|
|
88
88
|
var morphChildKinds = /* @__PURE__ */ (() => [...schemaKindsRightOf("morph"), "alias"])();
|
|
89
|
-
var ambiguousStringPattern = /^(?:"|\$ark\d*\.|(?:NaN|-?Infinity|-0|-?\d+n|undefined|[+-]?\d{4,6}-\d\d-\d\dT\d\d:\d\d:\d\d\.\d{3}Z)$)/;
|
|
89
|
+
var ambiguousStringPattern = /^(?:"|\$ark\d*\.|(?:NaN|-?Infinity|-0|-?\d+n|undefined|Invalid Date|[+-]?\d{4,6}-\d\d-\d\dT\d\d:\d\d:\d\d\.\d{3}Z)$)/;
|
|
90
90
|
var defaultValueSerializer = function (v) {
|
|
91
91
|
if (typeof v === "string")
|
|
92
92
|
return ambiguousStringPattern.test(v) ? JSON.stringify(v) : v;
|
|
@@ -21,27 +21,27 @@ import {
|
|
|
21
21
|
traversesUnions,
|
|
22
22
|
writeCreatedBeforeConfigureMessage,
|
|
23
23
|
writtenConfigMessage
|
|
24
|
-
} from "./chunk-
|
|
24
|
+
} from "./chunk-46PLKNON.js";
|
|
25
25
|
import {
|
|
26
26
|
encode,
|
|
27
27
|
inverses,
|
|
28
28
|
writeMissingInverseMessage
|
|
29
|
-
} from "./chunk-
|
|
29
|
+
} from "./chunk-2FVJ5JBN.js";
|
|
30
30
|
import {
|
|
31
31
|
ArkFirstIssueTraversal,
|
|
32
32
|
UndetailedErrors,
|
|
33
33
|
UndetailedTraversal,
|
|
34
34
|
errorModes,
|
|
35
35
|
rejectUndetailed
|
|
36
|
-
} from "./chunk-
|
|
36
|
+
} from "./chunk-5FNHK7CC.js";
|
|
37
37
|
import {
|
|
38
38
|
normalizeLocale
|
|
39
|
-
} from "./chunk-
|
|
39
|
+
} from "./chunk-H44UG6HG.js";
|
|
40
40
|
import {
|
|
41
41
|
inPlaceTransforms,
|
|
42
42
|
inputOnlyMorphs,
|
|
43
43
|
writesInPlace
|
|
44
|
-
} from "./chunk-
|
|
44
|
+
} from "./chunk-LMUBBBHJ.js";
|
|
45
45
|
import {
|
|
46
46
|
After,
|
|
47
47
|
AfterNode,
|
|
@@ -209,6 +209,7 @@ import {
|
|
|
209
209
|
writeInvalidMergeOperandMessage,
|
|
210
210
|
writeInvalidOperandMessage,
|
|
211
211
|
writeInvalidPropertyKeyMessage,
|
|
212
|
+
writeInvalidRangeRuleMessage,
|
|
212
213
|
writeInvalidSchemaMessage,
|
|
213
214
|
writeLiteralUnionEntriesMessage,
|
|
214
215
|
writeMissingImportMessage,
|
|
@@ -226,7 +227,7 @@ import {
|
|
|
226
227
|
writeUnsatisfiableExpressionError,
|
|
227
228
|
writeUnsatisfiedParameterConstraintMessage,
|
|
228
229
|
zeroDivisorMessage
|
|
229
|
-
} from "./chunk-
|
|
230
|
+
} from "./chunk-7SUZFAHZ.js";
|
|
230
231
|
import {
|
|
231
232
|
arrayIndexMatcher,
|
|
232
233
|
arrayIndexSource,
|
|
@@ -265,7 +266,7 @@ import {
|
|
|
265
266
|
writeInvalidLocaleMessage,
|
|
266
267
|
writeInvalidUndeclaredKeyBehaviorMessage,
|
|
267
268
|
writeUnknownConfigOptionMessage
|
|
268
|
-
} from "./chunk-
|
|
269
|
+
} from "./chunk-P3HEEGB5.js";
|
|
269
270
|
import {
|
|
270
271
|
ToJsonSchemaError,
|
|
271
272
|
openApiNull,
|
|
@@ -276,13 +277,13 @@ import {
|
|
|
276
277
|
writeInvalidJsonSchemaTargetMessage,
|
|
277
278
|
writeNullableJsonSchema,
|
|
278
279
|
writeUnionJsonSchema
|
|
279
|
-
} from "./chunk-
|
|
280
|
+
} from "./chunk-W2XOI5DY.js";
|
|
280
281
|
import {
|
|
281
282
|
rootApplyParams,
|
|
282
283
|
rootApplyParts,
|
|
283
284
|
rootApplyRuntime,
|
|
284
285
|
writeRootApply
|
|
285
|
-
} from "./chunk-
|
|
286
|
+
} from "./chunk-ERGIJZFA.js";
|
|
286
287
|
import {
|
|
287
288
|
CompiledFunction,
|
|
288
289
|
NodeCompiler,
|
|
@@ -297,7 +298,7 @@ import {
|
|
|
297
298
|
returnsTransformErrors,
|
|
298
299
|
serializeLiteralKey,
|
|
299
300
|
tryJit
|
|
300
|
-
} from "./chunk-
|
|
301
|
+
} from "./chunk-TQYLOZRT.js";
|
|
301
302
|
import {
|
|
302
303
|
$ark,
|
|
303
304
|
ArkErrors,
|
|
@@ -345,14 +346,16 @@ import {
|
|
|
345
346
|
registerLocaleRenderer,
|
|
346
347
|
registeredReference,
|
|
347
348
|
registryName,
|
|
349
|
+
serializableErrors,
|
|
348
350
|
siteTraversalOf,
|
|
349
351
|
suppliedText,
|
|
350
352
|
unrenderedLocaleMessage,
|
|
351
353
|
unwrittenError,
|
|
352
354
|
writeActual,
|
|
355
|
+
writeInvalidLocaleObjectMessage,
|
|
353
356
|
writeKeywordExpected,
|
|
354
357
|
writeText
|
|
355
|
-
} from "./chunk-
|
|
358
|
+
} from "./chunk-I65VSWGS.js";
|
|
356
359
|
import {
|
|
357
360
|
FirstIssueTraversal,
|
|
358
361
|
FirstIssues,
|
|
@@ -440,6 +443,7 @@ import {
|
|
|
440
443
|
rejects,
|
|
441
444
|
removedProblemMessage,
|
|
442
445
|
resolving,
|
|
446
|
+
setOwnValue,
|
|
443
447
|
sharedMessageOf,
|
|
444
448
|
silentCtx,
|
|
445
449
|
throwIssues,
|
|
@@ -466,13 +470,13 @@ import {
|
|
|
466
470
|
writeProtoActual,
|
|
467
471
|
writeUnitActual,
|
|
468
472
|
writeUnitMessage
|
|
469
|
-
} from "./chunk-
|
|
473
|
+
} from "./chunk-3KBOPH3J.js";
|
|
470
474
|
import {
|
|
471
475
|
ParseError,
|
|
472
476
|
arkKind,
|
|
473
477
|
describeCollapsibleDate,
|
|
474
478
|
printKind
|
|
475
|
-
} from "./chunk-
|
|
479
|
+
} from "./chunk-3HZC67MT.js";
|
|
476
480
|
import {
|
|
477
481
|
__export,
|
|
478
482
|
__reExport
|
|
@@ -830,7 +834,9 @@ __export(internal_exports, {
|
|
|
830
834
|
schemaKindOf: () => schemaKindOf,
|
|
831
835
|
schemaKindsRightOf: () => schemaKindsRightOf,
|
|
832
836
|
schemaScope: () => schemaScope,
|
|
837
|
+
serializableErrors: () => serializableErrors,
|
|
833
838
|
serializeLiteralKey: () => serializeLiteralKey,
|
|
839
|
+
setOwnValue: () => setOwnValue,
|
|
834
840
|
sets: () => sets,
|
|
835
841
|
shareConfig: () => shareConfig,
|
|
836
842
|
sharedMessageOf: () => sharedMessageOf,
|
|
@@ -890,9 +896,11 @@ __export(internal_exports, {
|
|
|
890
896
|
writeInvalidKeysMessage: () => writeInvalidKeysMessage,
|
|
891
897
|
writeInvalidLengthBoundMessage: () => writeInvalidLengthBoundMessage,
|
|
892
898
|
writeInvalidLocaleMessage: () => writeInvalidLocaleMessage,
|
|
899
|
+
writeInvalidLocaleObjectMessage: () => writeInvalidLocaleObjectMessage,
|
|
893
900
|
writeInvalidMergeOperandMessage: () => writeInvalidMergeOperandMessage,
|
|
894
901
|
writeInvalidOperandMessage: () => writeInvalidOperandMessage,
|
|
895
902
|
writeInvalidPropertyKeyMessage: () => writeInvalidPropertyKeyMessage,
|
|
903
|
+
writeInvalidRangeRuleMessage: () => writeInvalidRangeRuleMessage,
|
|
896
904
|
writeInvalidSchemaMessage: () => writeInvalidSchemaMessage,
|
|
897
905
|
writeInvalidUndeclaredKeyBehaviorMessage: () => writeInvalidUndeclaredKeyBehaviorMessage,
|
|
898
906
|
writeKeywordExpected: () => writeKeywordExpected,
|