arktype 3.0.0-rc.3 → 3.0.0-rc.5
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/out/_internal/schema/runtime.d.ts +1 -0
- package/out/_internal/schema/shared/errorReaders.d.ts +28 -0
- package/out/_internal/schema/shared/errors.d.ts +1 -17
- package/out/_internal/util/registry.d.ts +1 -1
- package/out/{chunk-GTTUSCSN.js → chunk-223NAMM2.js} +6 -6
- package/out/{chunk-6BXI2HGB.js → chunk-32J3BJIT.js} +2 -2
- package/out/{chunk-JDNRVFDJ.js → chunk-3HYMQFAC.js} +3 -3
- package/out/{chunk-3DJ7WMQY.js → chunk-7H7M4BW2.js} +5 -5
- package/out/{chunk-JY2RW3YZ.js → chunk-7NX6KDC7.js} +3 -3
- package/out/{chunk-RFG7WANT.js → chunk-ADCJNPZW.js} +15 -15
- package/out/{chunk-R4OZUFE4.js → chunk-C6A65WF4.js} +3 -3
- package/out/{chunk-5I22KZGW.js → chunk-CE2YGI4T.js} +1 -1
- package/out/{chunk-FMW3G2HM.js → chunk-CM74IBWA.js} +3 -3
- package/out/{chunk-NA6AKIHO.js → chunk-EYXKZRJM.js} +1 -1
- package/out/{chunk-WJYZSFTR.js → chunk-FEXLREE4.js} +5 -5
- package/out/{chunk-3KBOPH3J.js → chunk-GU3X7OIZ.js} +55 -1
- package/out/{chunk-SUKTVBEL.js → chunk-IVOJVPSS.js} +2 -53
- package/out/{chunk-DDX6RRRC.js → chunk-J6NFH2BS.js} +2 -2
- package/out/{chunk-D4OFGPEY.js → chunk-JX4N7RSQ.js} +3 -3
- package/out/{chunk-HAUTPBFA.js → chunk-LZXHV74B.js} +2 -2
- package/out/{chunk-OORKLVIJ.js → chunk-N4DO6WIB.js} +3 -3
- package/out/{chunk-3DCESM55.js → chunk-NQL4QPUE.js} +8 -3
- package/out/{chunk-372QLHPR.js → chunk-PAP4AM6W.js} +1 -1
- package/out/{chunk-7COZLHTN.js → chunk-SIV4PRW5.js} +3 -3
- package/out/{chunk-LMCZ3U5T.js → chunk-SLIFVOQJ.js} +1 -1
- package/out/{chunk-LD4ERH7O.js → chunk-UHXVY3HO.js} +1 -1
- package/out/{chunk-4RDZ5SOT.js → chunk-UVB5BUJ4.js} +26 -16
- package/out/{chunk-FARGFIEU.js → chunk-UXYJKKHC.js} +2 -2
- package/out/{chunk-IPDD4PDL.js → chunk-VNCC4KXJ.js} +2 -2
- package/out/codecs.js +12 -12
- package/out/config.js +6 -6
- package/out/declare.d.ts +24 -5
- package/out/errors.js +7 -7
- package/out/i18n.js +4 -4
- package/out/index.js +12 -12
- package/out/internal.js +25 -25
- package/out/island.js +13 -13
- package/out/islandDependency.js +26 -26
- package/out/keywords/ts.js +8 -8
- package/out/locales/de.js +5 -5
- package/out/locales/en.js +10 -10
- package/out/mutatesInput.js +9 -9
- package/out/parser/tupleExpressions.d.ts +3 -3
- package/out/precompiled.js +7 -7
- package/out/runtime.d.ts +4 -2
- package/out/runtime.js +1 -1
- package/out/schema.js +7 -7
- package/out/schemaInternal.js +17 -17
- package/out/schemaRuntime.js +2 -2
- package/out/schemaRuntimeLean.js +87 -0
- package/out/schemaRuntimeNone.js +87 -0
- package/out/schemaRuntimeNoneLean.js +87 -0
- package/out/util.js +1 -1
- package/package.json +4 -4
- package/skills/arktype/references/precompile.md +25 -25
- /package/out/{chunk-46PLKNON.js → chunk-BMIVLSDP.js} +0 -0
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import type { ArkSchemaConfig, ResolvedConfig } from "./config.ts";
|
|
2
2
|
export type { ArkError, ArkErrorCode, ArkErrorInput, RejectInput, ErrorContextsByCode } from "./shared/errors.ts";
|
|
3
3
|
export * from "./shared/enWriters.ts";
|
|
4
|
+
export * from "./shared/errorReaders.ts";
|
|
4
5
|
export { appliesValues, discriminatesBooleans, failsInBranches, findsOnRead, holdsExpression, listsUnions, transformsBranches, traversesUnions } from "./shared/issueFeatures.ts";
|
|
5
6
|
export * from "./shared/issues.ts";
|
|
6
7
|
export * from "./shared/listed.ts";
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
/** an issue as the readers read it, arktype's or a standalone validator's */
|
|
2
|
+
export interface PathedIssue {
|
|
3
|
+
readonly path: readonly PropertyKey[];
|
|
4
|
+
readonly message: string;
|
|
5
|
+
/** written by arktype as the issue is, absent from a standalone validator's */
|
|
6
|
+
readonly propString?: string;
|
|
7
|
+
}
|
|
8
|
+
/** errors as the readers read them, arktype's or a standalone validator's */
|
|
9
|
+
export interface ReadableErrors<issue extends PathedIssue = PathedIssue> {
|
|
10
|
+
readonly issues: readonly issue[];
|
|
11
|
+
}
|
|
12
|
+
/**
|
|
13
|
+
* The first error at each path, by the string of the path.
|
|
14
|
+
*/
|
|
15
|
+
export declare const byPath: <issue extends PathedIssue>(errors: ReadableErrors<issue>) => Record<string, issue>;
|
|
16
|
+
/**
|
|
17
|
+
* Each path's errors, by the string of the path.
|
|
18
|
+
*/
|
|
19
|
+
export declare const flatByPath: <issue extends PathedIssue>(errors: ReadableErrors<issue>) => Record<string, issue[]>;
|
|
20
|
+
/**
|
|
21
|
+
* Each path's messages, by the string of the path.
|
|
22
|
+
*/
|
|
23
|
+
export declare const flatMessagesByPath: (errors: ReadableErrors) => Record<string, string[]>;
|
|
24
|
+
/**
|
|
25
|
+
* All path strings at which errors are present mapped to the errors occuring
|
|
26
|
+
* at that path or any nested path within it.
|
|
27
|
+
*/
|
|
28
|
+
export declare const byAncestorPath: <issue extends PathedIssue>(errors: ReadableErrors<issue>) => Record<string, issue[]>;
|
|
@@ -182,23 +182,7 @@ export declare const serializableErrors: (issues: ArkError[]) => readonly ArkErr
|
|
|
182
182
|
* The first of `errors.issues`, its text written without the rest's.
|
|
183
183
|
*/
|
|
184
184
|
export declare const firstIssue: (errors: ArkErrors) => ArkError;
|
|
185
|
-
|
|
186
|
-
* The first error at each path, by the string of the path.
|
|
187
|
-
*/
|
|
188
|
-
export declare const byPath: (errors: ArkErrors) => Record<string, ArkError>;
|
|
189
|
-
/**
|
|
190
|
-
* Each path's errors, by the string of the path.
|
|
191
|
-
*/
|
|
192
|
-
export declare const flatByPath: (errors: ArkErrors) => Record<string, ArkError[]>;
|
|
193
|
-
/**
|
|
194
|
-
* Each path's messages, by the string of the path.
|
|
195
|
-
*/
|
|
196
|
-
export declare const flatMessagesByPath: (errors: ArkErrors) => Record<string, string[]>;
|
|
197
|
-
/**
|
|
198
|
-
* All path strings at which errors are present mapped to the errors occuring
|
|
199
|
-
* at that path or any nested path within it.
|
|
200
|
-
*/
|
|
201
|
-
export declare const byAncestorPath: (errors: ArkErrors) => Record<string, ArkError[]>;
|
|
185
|
+
export { byAncestorPath, byPath, flatByPath, flatMessagesByPath } from "./errorReaders.ts";
|
|
202
186
|
export interface DerivableErrorContext<code extends ArkErrorCode = ArkErrorCode> {
|
|
203
187
|
expected: string;
|
|
204
188
|
actual: string;
|
|
@@ -37,7 +37,7 @@ import {
|
|
|
37
37
|
rootKinds,
|
|
38
38
|
structuralKinds,
|
|
39
39
|
structureKeys
|
|
40
|
-
} from "./chunk-
|
|
40
|
+
} from "./chunk-C6A65WF4.js";
|
|
41
41
|
import {
|
|
42
42
|
validateStandardJsonSchemaTarget
|
|
43
43
|
} from "./chunk-W2XOI5DY.js";
|
|
@@ -49,7 +49,7 @@ import {
|
|
|
49
49
|
rootApplyParams,
|
|
50
50
|
rootApplyRuntime,
|
|
51
51
|
writeRootApply
|
|
52
|
-
} from "./chunk-
|
|
52
|
+
} from "./chunk-JX4N7RSQ.js";
|
|
53
53
|
import {
|
|
54
54
|
CompiledFunction,
|
|
55
55
|
NodeCompiler,
|
|
@@ -60,7 +60,7 @@ import {
|
|
|
60
60
|
isRefinedBasis,
|
|
61
61
|
returnsTransformErrors,
|
|
62
62
|
tryJit
|
|
63
|
-
} from "./chunk-
|
|
63
|
+
} from "./chunk-VNCC4KXJ.js";
|
|
64
64
|
import {
|
|
65
65
|
$ark,
|
|
66
66
|
ArkErrors,
|
|
@@ -79,7 +79,7 @@ import {
|
|
|
79
79
|
registeredReference,
|
|
80
80
|
registryName,
|
|
81
81
|
siteTraversalOf
|
|
82
|
-
} from "./chunk-
|
|
82
|
+
} from "./chunk-IVOJVPSS.js";
|
|
83
83
|
import {
|
|
84
84
|
Issues,
|
|
85
85
|
TransformErrors,
|
|
@@ -150,12 +150,12 @@ import {
|
|
|
150
150
|
withContextOf,
|
|
151
151
|
withoutHoleNames,
|
|
152
152
|
writeLine
|
|
153
|
-
} from "./chunk-
|
|
153
|
+
} from "./chunk-GU3X7OIZ.js";
|
|
154
154
|
import {
|
|
155
155
|
arkUtilVersion,
|
|
156
156
|
nameOf,
|
|
157
157
|
registeredNameOf
|
|
158
|
-
} from "./chunk-
|
|
158
|
+
} from "./chunk-SLIFVOQJ.js";
|
|
159
159
|
import {
|
|
160
160
|
Callable,
|
|
161
161
|
DynamicBase,
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import {
|
|
2
2
|
encode,
|
|
3
3
|
inverses
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-7NX6KDC7.js";
|
|
5
5
|
import {
|
|
6
6
|
type
|
|
7
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-FEXLREE4.js";
|
|
8
8
|
import {
|
|
9
9
|
capitalizeString,
|
|
10
10
|
keepFormatted,
|
|
@@ -26,7 +26,7 @@ import {
|
|
|
26
26
|
} from "./chunk-4HREHNIV.js";
|
|
27
27
|
import {
|
|
28
28
|
$ark
|
|
29
|
-
} from "./chunk-
|
|
29
|
+
} from "./chunk-IVOJVPSS.js";
|
|
30
30
|
|
|
31
31
|
// ../schema/out/codecs.js
|
|
32
32
|
$ark.encode = encode;
|
|
@@ -47,7 +47,7 @@ import {
|
|
|
47
47
|
writeForeignArkMessage,
|
|
48
48
|
writeUnboundableMessage,
|
|
49
49
|
writeUnresolvableMessage
|
|
50
|
-
} from "./chunk-
|
|
50
|
+
} from "./chunk-223NAMM2.js";
|
|
51
51
|
import {
|
|
52
52
|
WeakCache,
|
|
53
53
|
defineLazily
|
|
@@ -60,7 +60,7 @@ import {
|
|
|
60
60
|
rootKinds,
|
|
61
61
|
schemaKindsRightOf,
|
|
62
62
|
unionJsonSchemaWritersKey
|
|
63
|
-
} from "./chunk-
|
|
63
|
+
} from "./chunk-C6A65WF4.js";
|
|
64
64
|
import {
|
|
65
65
|
openApiNull,
|
|
66
66
|
writeNullableJsonSchema,
|
|
@@ -74,12 +74,12 @@ import {
|
|
|
74
74
|
} from "./chunk-TACLEIDM.js";
|
|
75
75
|
import {
|
|
76
76
|
compileLiteralPropAccess
|
|
77
|
-
} from "./chunk-
|
|
77
|
+
} from "./chunk-VNCC4KXJ.js";
|
|
78
78
|
import {
|
|
79
79
|
$ark,
|
|
80
80
|
ArkErrors,
|
|
81
81
|
asTemplated
|
|
82
|
-
} from "./chunk-
|
|
82
|
+
} from "./chunk-IVOJVPSS.js";
|
|
83
83
|
import {
|
|
84
84
|
defining,
|
|
85
85
|
execMorph,
|
|
@@ -93,7 +93,7 @@ import {
|
|
|
93
93
|
printSelfAsThis,
|
|
94
94
|
queueUnchecked,
|
|
95
95
|
throwOnDefault
|
|
96
|
-
} from "./chunk-
|
|
96
|
+
} from "./chunk-GU3X7OIZ.js";
|
|
97
97
|
import {
|
|
98
98
|
Callable,
|
|
99
99
|
ParseError,
|
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
import {
|
|
2
2
|
referencesWithoutCases,
|
|
3
3
|
withoutUndefined
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-223NAMM2.js";
|
|
5
5
|
import {
|
|
6
6
|
$ark
|
|
7
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-IVOJVPSS.js";
|
|
8
8
|
import {
|
|
9
9
|
assertUnchecked,
|
|
10
10
|
defining,
|
|
11
11
|
hasArkKind,
|
|
12
12
|
isResolutionFinal
|
|
13
|
-
} from "./chunk-
|
|
13
|
+
} from "./chunk-GU3X7OIZ.js";
|
|
14
14
|
import {
|
|
15
15
|
omit,
|
|
16
16
|
throwParseError
|
|
@@ -21,27 +21,27 @@ import {
|
|
|
21
21
|
traversesUnions,
|
|
22
22
|
writeCreatedBeforeConfigureMessage,
|
|
23
23
|
writtenConfigMessage
|
|
24
|
-
} from "./chunk-
|
|
24
|
+
} from "./chunk-BMIVLSDP.js";
|
|
25
25
|
import {
|
|
26
26
|
encode,
|
|
27
27
|
inverses,
|
|
28
28
|
writeMissingInverseMessage
|
|
29
|
-
} from "./chunk-
|
|
29
|
+
} from "./chunk-7NX6KDC7.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-N4DO6WIB.js";
|
|
37
37
|
import {
|
|
38
38
|
normalizeLocale
|
|
39
|
-
} from "./chunk-
|
|
39
|
+
} from "./chunk-UXYJKKHC.js";
|
|
40
40
|
import {
|
|
41
41
|
inPlaceTransforms,
|
|
42
42
|
inputOnlyMorphs,
|
|
43
43
|
writesInPlace
|
|
44
|
-
} from "./chunk-
|
|
44
|
+
} from "./chunk-CM74IBWA.js";
|
|
45
45
|
import {
|
|
46
46
|
After,
|
|
47
47
|
AfterNode,
|
|
@@ -227,7 +227,7 @@ import {
|
|
|
227
227
|
writeUnsatisfiableExpressionError,
|
|
228
228
|
writeUnsatisfiedParameterConstraintMessage,
|
|
229
229
|
zeroDivisorMessage
|
|
230
|
-
} from "./chunk-
|
|
230
|
+
} from "./chunk-223NAMM2.js";
|
|
231
231
|
import {
|
|
232
232
|
arrayIndexMatcher,
|
|
233
233
|
arrayIndexSource,
|
|
@@ -266,7 +266,7 @@ import {
|
|
|
266
266
|
writeInvalidLocaleMessage,
|
|
267
267
|
writeInvalidUndeclaredKeyBehaviorMessage,
|
|
268
268
|
writeUnknownConfigOptionMessage
|
|
269
|
-
} from "./chunk-
|
|
269
|
+
} from "./chunk-C6A65WF4.js";
|
|
270
270
|
import {
|
|
271
271
|
ToJsonSchemaError,
|
|
272
272
|
openApiNull,
|
|
@@ -283,7 +283,7 @@ import {
|
|
|
283
283
|
rootApplyParts,
|
|
284
284
|
rootApplyRuntime,
|
|
285
285
|
writeRootApply
|
|
286
|
-
} from "./chunk-
|
|
286
|
+
} from "./chunk-JX4N7RSQ.js";
|
|
287
287
|
import {
|
|
288
288
|
CompiledFunction,
|
|
289
289
|
NodeCompiler,
|
|
@@ -298,7 +298,7 @@ import {
|
|
|
298
298
|
returnsTransformErrors,
|
|
299
299
|
serializeLiteralKey,
|
|
300
300
|
tryJit
|
|
301
|
-
} from "./chunk-
|
|
301
|
+
} from "./chunk-VNCC4KXJ.js";
|
|
302
302
|
import {
|
|
303
303
|
$ark,
|
|
304
304
|
ArkErrors,
|
|
@@ -310,8 +310,6 @@ import {
|
|
|
310
310
|
ambientResolver,
|
|
311
311
|
applyUnread,
|
|
312
312
|
asTemplated,
|
|
313
|
-
byAncestorPath,
|
|
314
|
-
byPath,
|
|
315
313
|
configureAfterTypeMessage,
|
|
316
314
|
configureLocale,
|
|
317
315
|
configuredMessageOf,
|
|
@@ -327,8 +325,6 @@ import {
|
|
|
327
325
|
errorWriters,
|
|
328
326
|
errorWritersByCode,
|
|
329
327
|
firstIssue,
|
|
330
|
-
flatByPath,
|
|
331
|
-
flatMessagesByPath,
|
|
332
328
|
groupByPath,
|
|
333
329
|
invalidError,
|
|
334
330
|
isArkError,
|
|
@@ -355,7 +351,7 @@ import {
|
|
|
355
351
|
writeInvalidLocaleObjectMessage,
|
|
356
352
|
writeKeywordExpected,
|
|
357
353
|
writeText
|
|
358
|
-
} from "./chunk-
|
|
354
|
+
} from "./chunk-IVOJVPSS.js";
|
|
359
355
|
import {
|
|
360
356
|
FirstIssueTraversal,
|
|
361
357
|
FirstIssues,
|
|
@@ -378,6 +374,8 @@ import {
|
|
|
378
374
|
applyResolution,
|
|
379
375
|
applyValue,
|
|
380
376
|
assertUnchecked,
|
|
377
|
+
byAncestorPath,
|
|
378
|
+
byPath,
|
|
381
379
|
callMorph,
|
|
382
380
|
codedIssue,
|
|
383
381
|
composing,
|
|
@@ -403,6 +401,8 @@ import {
|
|
|
403
401
|
failsKey,
|
|
404
402
|
failsKeySite,
|
|
405
403
|
failsSite,
|
|
404
|
+
flatByPath,
|
|
405
|
+
flatMessagesByPath,
|
|
406
406
|
foundErrors,
|
|
407
407
|
hasArkKind,
|
|
408
408
|
holdsOnlyIndices,
|
|
@@ -470,7 +470,7 @@ import {
|
|
|
470
470
|
writeProtoActual,
|
|
471
471
|
writeUnitActual,
|
|
472
472
|
writeUnitMessage
|
|
473
|
-
} from "./chunk-
|
|
473
|
+
} from "./chunk-GU3X7OIZ.js";
|
|
474
474
|
import {
|
|
475
475
|
ParseError,
|
|
476
476
|
arkKind,
|
|
@@ -9,7 +9,7 @@ import {
|
|
|
9
9
|
} from "./chunk-TACLEIDM.js";
|
|
10
10
|
import {
|
|
11
11
|
compileSerializedValue
|
|
12
|
-
} from "./chunk-
|
|
12
|
+
} from "./chunk-VNCC4KXJ.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-IVOJVPSS.js";
|
|
22
22
|
import {
|
|
23
23
|
isNode,
|
|
24
24
|
removedProblemMessage
|
|
25
|
-
} from "./chunk-
|
|
25
|
+
} from "./chunk-GU3X7OIZ.js";
|
|
26
26
|
import {
|
|
27
27
|
envHasCsp,
|
|
28
28
|
flatMorph,
|
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
import {
|
|
2
2
|
precompileInPlace
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-223NAMM2.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-IVOJVPSS.js";
|
|
10
10
|
import {
|
|
11
11
|
hasArkKind
|
|
12
|
-
} from "./chunk-
|
|
12
|
+
} from "./chunk-GU3X7OIZ.js";
|
|
13
13
|
import {
|
|
14
14
|
arityOf
|
|
15
15
|
} from "./chunk-3HZC67MT.js";
|
|
@@ -8,13 +8,13 @@ import {
|
|
|
8
8
|
tsGenericDefinitions,
|
|
9
9
|
tsKeywordDefinitions,
|
|
10
10
|
unknown
|
|
11
|
-
} from "./chunk-
|
|
11
|
+
} from "./chunk-7H7M4BW2.js";
|
|
12
12
|
import {
|
|
13
13
|
Hkt
|
|
14
14
|
} from "./chunk-BDJVONP7.js";
|
|
15
15
|
import {
|
|
16
16
|
keywordMeta
|
|
17
|
-
} from "./chunk-
|
|
17
|
+
} from "./chunk-UHXVY3HO.js";
|
|
18
18
|
import {
|
|
19
19
|
capitalizeString,
|
|
20
20
|
epochDescriptions,
|
|
@@ -47,7 +47,7 @@ import {
|
|
|
47
47
|
node,
|
|
48
48
|
rootSchema,
|
|
49
49
|
writeUnresolvableMessage
|
|
50
|
-
} from "./chunk-
|
|
50
|
+
} from "./chunk-223NAMM2.js";
|
|
51
51
|
import {
|
|
52
52
|
defineLazily
|
|
53
53
|
} from "./chunk-UJJGG4VQ.js";
|
|
@@ -59,10 +59,10 @@ import {
|
|
|
59
59
|
} from "./chunk-US6BWOGJ.js";
|
|
60
60
|
import {
|
|
61
61
|
$ark
|
|
62
|
-
} from "./chunk-
|
|
62
|
+
} from "./chunk-IVOJVPSS.js";
|
|
63
63
|
import {
|
|
64
64
|
registry
|
|
65
|
-
} from "./chunk-
|
|
65
|
+
} from "./chunk-SLIFVOQJ.js";
|
|
66
66
|
import {
|
|
67
67
|
cached,
|
|
68
68
|
defineProperties,
|
|
@@ -2,6 +2,7 @@ import {
|
|
|
2
2
|
listPattern
|
|
3
3
|
} from "./chunk-3SH2BQ4T.js";
|
|
4
4
|
import {
|
|
5
|
+
appendStringifiedKey,
|
|
5
6
|
arkKindOf,
|
|
6
7
|
defineValue,
|
|
7
8
|
describeCollapsibleDate,
|
|
@@ -22,6 +23,7 @@ import {
|
|
|
22
23
|
pathAt,
|
|
23
24
|
printKind,
|
|
24
25
|
printable,
|
|
26
|
+
stringifyPath,
|
|
25
27
|
throwError,
|
|
26
28
|
timeOf
|
|
27
29
|
} from "./chunk-3HZC67MT.js";
|
|
@@ -1445,6 +1447,54 @@ var computeDefaultValueMorph = (key, value, defaultInput, node = value, isThunkI
|
|
|
1445
1447
|
};
|
|
1446
1448
|
};
|
|
1447
1449
|
|
|
1450
|
+
// ../schema/out/shared/errorReaders.js
|
|
1451
|
+
var byPath = (errors) => {
|
|
1452
|
+
const result = {};
|
|
1453
|
+
for (const error of errors.issues) {
|
|
1454
|
+
const k = propStringOf(error);
|
|
1455
|
+
if (!hasOwn(result, k))
|
|
1456
|
+
defineEntry(result, k, error);
|
|
1457
|
+
}
|
|
1458
|
+
return result;
|
|
1459
|
+
};
|
|
1460
|
+
var flatByPath = (errors) => {
|
|
1461
|
+
const result = {};
|
|
1462
|
+
for (const error of errors.issues)
|
|
1463
|
+
addEntry(result, propStringOf(error), error);
|
|
1464
|
+
return result;
|
|
1465
|
+
};
|
|
1466
|
+
var flatMessagesByPath = (errors) => {
|
|
1467
|
+
const result = {};
|
|
1468
|
+
for (const error of errors.issues)
|
|
1469
|
+
addEntry(result, propStringOf(error), error.message);
|
|
1470
|
+
return result;
|
|
1471
|
+
};
|
|
1472
|
+
var byAncestorPath = (errors) => {
|
|
1473
|
+
const result = {};
|
|
1474
|
+
for (const error of errors.issues) {
|
|
1475
|
+
let propString = "";
|
|
1476
|
+
addEntry(result, propString, error);
|
|
1477
|
+
for (const k of error.path) {
|
|
1478
|
+
propString = appendStringifiedKey(propString, k);
|
|
1479
|
+
addEntry(result, propString, error);
|
|
1480
|
+
}
|
|
1481
|
+
}
|
|
1482
|
+
return result;
|
|
1483
|
+
};
|
|
1484
|
+
var propStringOf = (error) => error.propString ?? stringifyPath(error.path);
|
|
1485
|
+
var addEntry = (result, k, value) => {
|
|
1486
|
+
if (hasOwn(result, k))
|
|
1487
|
+
result[k].push(value);
|
|
1488
|
+
else
|
|
1489
|
+
defineEntry(result, k, [value]);
|
|
1490
|
+
};
|
|
1491
|
+
var defineEntry = (result, k, value) => Object.defineProperty(result, k, {
|
|
1492
|
+
value,
|
|
1493
|
+
enumerable: true,
|
|
1494
|
+
writable: true,
|
|
1495
|
+
configurable: true
|
|
1496
|
+
});
|
|
1497
|
+
|
|
1448
1498
|
export {
|
|
1449
1499
|
describeActual,
|
|
1450
1500
|
describeUnwrittenActual,
|
|
@@ -1560,5 +1610,9 @@ export {
|
|
|
1560
1610
|
allowsAcyclic,
|
|
1561
1611
|
allowsInContext,
|
|
1562
1612
|
travKey,
|
|
1563
|
-
computeDefaultValueMorph
|
|
1613
|
+
computeDefaultValueMorph,
|
|
1614
|
+
byPath,
|
|
1615
|
+
flatByPath,
|
|
1616
|
+
flatMessagesByPath,
|
|
1617
|
+
byAncestorPath
|
|
1564
1618
|
};
|
|
@@ -21,14 +21,13 @@ import {
|
|
|
21
21
|
writeProtoActual,
|
|
22
22
|
writeUnitActual,
|
|
23
23
|
writeUnitMessage
|
|
24
|
-
} from "./chunk-
|
|
24
|
+
} from "./chunk-GU3X7OIZ.js";
|
|
25
25
|
import {
|
|
26
26
|
nameOf,
|
|
27
27
|
register,
|
|
28
28
|
registry
|
|
29
|
-
} from "./chunk-
|
|
29
|
+
} from "./chunk-SLIFVOQJ.js";
|
|
30
30
|
import {
|
|
31
|
-
appendStringifiedKey,
|
|
32
31
|
appendUnique,
|
|
33
32
|
conflatenateAll,
|
|
34
33
|
describeCollapsibleDate,
|
|
@@ -894,52 +893,6 @@ var errorsToJson = {
|
|
|
894
893
|
};
|
|
895
894
|
var serializableErrors = (issues) => issues.toJSON ? issues : Object.defineProperty(issues, "toJSON", errorsToJson);
|
|
896
895
|
var firstIssue = (errors) => errors._first ?? errors.issues[0];
|
|
897
|
-
var byPath = function (errors) {
|
|
898
|
-
const result = {};
|
|
899
|
-
for (const error of errors.issues) {
|
|
900
|
-
const k = propStringOf(error);
|
|
901
|
-
if (!hasOwn(result, k))
|
|
902
|
-
defineEntry(result, k, error);
|
|
903
|
-
}
|
|
904
|
-
return result;
|
|
905
|
-
};
|
|
906
|
-
var flatByPath = function (errors) {
|
|
907
|
-
const result = {};
|
|
908
|
-
for (const error of errors.issues)
|
|
909
|
-
addEntry(result, propStringOf(error), error);
|
|
910
|
-
return result;
|
|
911
|
-
};
|
|
912
|
-
var flatMessagesByPath = function (errors) {
|
|
913
|
-
const result = {};
|
|
914
|
-
for (const error of errors.issues)
|
|
915
|
-
addEntry(result, propStringOf(error), error.message);
|
|
916
|
-
return result;
|
|
917
|
-
};
|
|
918
|
-
var byAncestorPath = function (errors) {
|
|
919
|
-
const result = {};
|
|
920
|
-
for (const error of errors.issues) {
|
|
921
|
-
let propString = "";
|
|
922
|
-
addEntry(result, propString, error);
|
|
923
|
-
for (const k of error.path) {
|
|
924
|
-
propString = appendStringifiedKey(propString, k);
|
|
925
|
-
addEntry(result, propString, error);
|
|
926
|
-
}
|
|
927
|
-
}
|
|
928
|
-
return result;
|
|
929
|
-
};
|
|
930
|
-
var propStringOf = (error) => error.propString ?? stringifyPath(error.path);
|
|
931
|
-
var addEntry = (result, k, value) => {
|
|
932
|
-
if (hasOwn(result, k))
|
|
933
|
-
result[k].push(value);
|
|
934
|
-
else
|
|
935
|
-
defineEntry(result, k, [value]);
|
|
936
|
-
};
|
|
937
|
-
var defineEntry = (result, k, value) => Object.defineProperty(result, k, {
|
|
938
|
-
value,
|
|
939
|
-
enumerable: true,
|
|
940
|
-
writable: true,
|
|
941
|
-
configurable: true
|
|
942
|
-
});
|
|
943
896
|
var configureAfterTypeMessage = "configure() must be called before any Type is created, so import the module calling it before any module that creates one";
|
|
944
897
|
var unrenderedLocaleMessage = 'import "arktype/i18n" to write errors in locales other than en';
|
|
945
898
|
var copiedErrorMessage = "Only errors validation returned can be written again, not copies";
|
|
@@ -1101,10 +1054,6 @@ export {
|
|
|
1101
1054
|
unwrittenError,
|
|
1102
1055
|
serializableErrors,
|
|
1103
1056
|
firstIssue,
|
|
1104
|
-
byPath,
|
|
1105
|
-
flatByPath,
|
|
1106
|
-
flatMessagesByPath,
|
|
1107
|
-
byAncestorPath,
|
|
1108
1057
|
configureAfterTypeMessage,
|
|
1109
1058
|
unrenderedLocaleMessage,
|
|
1110
1059
|
copiedErrorMessage,
|
|
@@ -5,10 +5,10 @@ import {
|
|
|
5
5
|
groupByPath,
|
|
6
6
|
labelOf,
|
|
7
7
|
writeKeywordExpected
|
|
8
|
-
} from "./chunk-
|
|
8
|
+
} from "./chunk-IVOJVPSS.js";
|
|
9
9
|
import {
|
|
10
10
|
printedActualOf
|
|
11
|
-
} from "./chunk-
|
|
11
|
+
} from "./chunk-GU3X7OIZ.js";
|
|
12
12
|
import {
|
|
13
13
|
listPattern
|
|
14
14
|
} from "./chunk-3SH2BQ4T.js";
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import {
|
|
2
2
|
CompiledFunction
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-VNCC4KXJ.js";
|
|
4
4
|
import {
|
|
5
5
|
ArkTraversal,
|
|
6
6
|
applyUnread
|
|
7
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-IVOJVPSS.js";
|
|
8
8
|
import {
|
|
9
9
|
TransformErrors,
|
|
10
10
|
addMorphErrs,
|
|
@@ -12,7 +12,7 @@ import {
|
|
|
12
12
|
allowsInContext,
|
|
13
13
|
applyCyclic,
|
|
14
14
|
transformResolution
|
|
15
|
-
} from "./chunk-
|
|
15
|
+
} from "./chunk-GU3X7OIZ.js";
|
|
16
16
|
import {
|
|
17
17
|
unset
|
|
18
18
|
} from "./chunk-3HZC67MT.js";
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import {
|
|
2
2
|
inPlaceTransforms,
|
|
3
3
|
inputOnlyMorphs
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-CM74IBWA.js";
|
|
5
5
|
import {
|
|
6
6
|
parseDate,
|
|
7
7
|
parseInteger,
|
|
@@ -11,7 +11,7 @@ import {
|
|
|
11
11
|
} from "./chunk-4HREHNIV.js";
|
|
12
12
|
import {
|
|
13
13
|
$ark
|
|
14
|
-
} from "./chunk-
|
|
14
|
+
} from "./chunk-IVOJVPSS.js";
|
|
15
15
|
|
|
16
16
|
// ../schema/out/mutatesInput.js
|
|
17
17
|
$ark.inPlace = inPlaceTransforms;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
rootApplyRuntime
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-JX4N7RSQ.js";
|
|
4
4
|
import {
|
|
5
5
|
$ark,
|
|
6
6
|
ArkErrors,
|
|
@@ -9,10 +9,10 @@ import {
|
|
|
9
9
|
invalidError,
|
|
10
10
|
isArkError,
|
|
11
11
|
serializableErrors
|
|
12
|
-
} from "./chunk-
|
|
12
|
+
} from "./chunk-IVOJVPSS.js";
|
|
13
13
|
import {
|
|
14
14
|
lineOf
|
|
15
|
-
} from "./chunk-
|
|
15
|
+
} from "./chunk-GU3X7OIZ.js";
|
|
16
16
|
|
|
17
17
|
// ../schema/out/shared/errorModes.js
|
|
18
18
|
import { findsOnRead } from "./shared/issueFeatures.js";
|