arktype 2.1.18 → 2.1.20
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/attributes.d.ts +10 -3
- package/out/keywords/string.d.ts +5 -3
- package/out/keywords/string.js +75 -43
- package/out/methods/base.d.ts +4 -4
- package/out/nary.d.ts +318 -325
- package/out/parser/definition.d.ts +2 -2
- package/out/parser/tupleLiteral.js +9 -3
- package/package.json +3 -3
package/out/attributes.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { ArkError, ArkErrors, Morph } from "@ark/schema";
|
|
2
|
-
import { type anyOrNever, type array, type Brand, type equals, type Hkt, type intersectArrays, type isSafelyMappable, type merge, type Primitive, type show } from "@ark/util";
|
|
2
|
+
import { type anyOrNever, type array, type Brand, type equals, type Hkt, type intersectArrays, type isSafelyMappable, type merge, type optionalKeyOf, type Primitive, type show, type unionKeyOf, type unionToTuple } from "@ark/util";
|
|
3
3
|
import type { arkPrototypes } from "./keywords/constructors.ts";
|
|
4
4
|
import type { type } from "./keywords/keywords.ts";
|
|
5
5
|
import type { Type } from "./type.ts";
|
|
@@ -53,9 +53,16 @@ type TerminallyInferredObject = arkPrototypes.instanceOf<BuiltinTerminalObjectKi
|
|
|
53
53
|
export type inferPredicate<t, predicate> = predicate extends (data: any, ...args: any[]) => data is infer narrowed ? narrowed : t;
|
|
54
54
|
export type inferNaryPipe<morphs extends readonly Morph[]> = _inferNaryPipe<morphs, unknown>;
|
|
55
55
|
type _inferNaryPipe<remaining extends readonly unknown[], result> = remaining extends (readonly [infer head extends Morph, ...infer tail extends Morph[]]) ? _inferNaryPipe<tail, inferMorph<result, head>> : result;
|
|
56
|
-
export type inferNaryIntersection<types extends readonly unknown[]> = _inferNaryIntersection<types, unknown>;
|
|
56
|
+
export type inferNaryIntersection<types extends readonly unknown[]> = number extends types["length"] ? _inferNaryIntersection<unionToTuple<types[number]>, unknown> : _inferNaryIntersection<types, unknown>;
|
|
57
57
|
type _inferNaryIntersection<remaining extends readonly unknown[], result> = remaining extends readonly [infer head, ...infer tail] ? _inferNaryIntersection<tail, inferIntersection<result, head>> : result;
|
|
58
|
-
export type inferNaryMerge<types extends readonly unknown[]> = _inferNaryMerge<types, {}>;
|
|
58
|
+
export type inferNaryMerge<types extends readonly unknown[]> = number extends types["length"] ? _inferUnorderedMerge<types> : _inferNaryMerge<types, {}>;
|
|
59
|
+
type _inferUnorderedMerge<types extends readonly unknown[], optionalKey extends PropertyKey = optionalAtLeastOnceUnionKeyOf<types[number]>, requiredKey extends PropertyKey = Exclude<unionKeyOf<types[number]>, optionalKey>> = show<{
|
|
60
|
+
[k in requiredKey]: types[number] extends infer v ? v extends unknown ? k extends keyof v ? v[k] : never : never : never;
|
|
61
|
+
} & {
|
|
62
|
+
[k in optionalKey]?: types[number] extends infer v ? v extends unknown ? k extends keyof v ? v[k] : never : never : never;
|
|
63
|
+
}>;
|
|
64
|
+
/** Coalesce keys that exist and are optional on one or more branches of a union */
|
|
65
|
+
type optionalAtLeastOnceUnionKeyOf<t> = t extends unknown ? optionalKeyOf<t> : never;
|
|
59
66
|
type _inferNaryMerge<remaining extends readonly unknown[], result> = remaining extends (readonly [infer head, ...infer tail extends readonly unknown[]]) ? _inferNaryMerge<tail, merge<result, head>> : result;
|
|
60
67
|
export type inferMorphOut<morph extends Morph> = Exclude<ReturnType<morph>, ArkError | ArkErrors>;
|
|
61
68
|
declare const isMorphOutKey: " isMorphOut";
|
package/out/keywords/string.d.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { type
|
|
1
|
+
import { type Intersection, type JsonSchema } from "@ark/schema";
|
|
2
2
|
import { type Json } from "@ark/util";
|
|
3
3
|
import type { To } from "../attributes.ts";
|
|
4
4
|
import type { Module, Submodule } from "../module.ts";
|
|
5
|
-
export declare const regexStringNode: (regex: RegExp, description: string) =>
|
|
5
|
+
export declare const regexStringNode: (regex: RegExp, description: string, jsonSchemaFormat?: JsonSchema.Format) => Intersection.Node;
|
|
6
6
|
export declare const stringInteger: stringInteger.module;
|
|
7
7
|
export declare namespace stringInteger {
|
|
8
8
|
type module = Module<submodule>;
|
|
@@ -184,7 +184,7 @@ export declare namespace normalize {
|
|
|
184
184
|
};
|
|
185
185
|
}
|
|
186
186
|
}
|
|
187
|
-
export declare const
|
|
187
|
+
export declare const stringNumeric: stringNumeric.module;
|
|
188
188
|
export declare namespace stringNumeric {
|
|
189
189
|
type module = Module<submodule>;
|
|
190
190
|
type submodule = Submodule<$>;
|
|
@@ -286,6 +286,7 @@ export declare const string: Module<{
|
|
|
286
286
|
}>;
|
|
287
287
|
}>;
|
|
288
288
|
numeric: Submodule<stringNumeric.submodule>;
|
|
289
|
+
regex: unknown;
|
|
289
290
|
semver: unknown;
|
|
290
291
|
trim: Submodule<trim.submodule>;
|
|
291
292
|
upper: Submodule<upper.submodule>;
|
|
@@ -322,6 +323,7 @@ export declare namespace string {
|
|
|
322
323
|
lower: lower.submodule;
|
|
323
324
|
normalize: normalize.submodule;
|
|
324
325
|
numeric: stringNumeric.submodule;
|
|
326
|
+
regex: string;
|
|
325
327
|
semver: string;
|
|
326
328
|
trim: trim.submodule;
|
|
327
329
|
upper: upper.submodule;
|
package/out/keywords/string.js
CHANGED
|
@@ -2,15 +2,20 @@ import { ArkErrors, intrinsic, node, rootSchema } from "@ark/schema";
|
|
|
2
2
|
import { flatMorph, numericStringMatcher, wellFormedIntegerMatcher } from "@ark/util";
|
|
3
3
|
import { Scope } from "../scope.js";
|
|
4
4
|
import { number } from "./number.js";
|
|
5
|
-
//
|
|
6
|
-
export const regexStringNode = (regex, description) =>
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
}
|
|
5
|
+
// non-trivial expressions should have an explanation or attribution
|
|
6
|
+
export const regexStringNode = (regex, description, jsonSchemaFormat) => {
|
|
7
|
+
const schema = {
|
|
8
|
+
domain: "string",
|
|
9
|
+
pattern: {
|
|
10
|
+
rule: regex.source,
|
|
11
|
+
flags: regex.flags,
|
|
12
|
+
meta: description
|
|
13
|
+
}
|
|
14
|
+
};
|
|
15
|
+
if (jsonSchemaFormat)
|
|
16
|
+
schema.meta = { format: jsonSchemaFormat };
|
|
17
|
+
return node("intersection", schema);
|
|
18
|
+
};
|
|
14
19
|
const stringIntegerRoot = regexStringNode(wellFormedIntegerMatcher, "a well-formed integer string");
|
|
15
20
|
export const stringInteger = Scope.module({
|
|
16
21
|
root: stringIntegerRoot,
|
|
@@ -25,10 +30,10 @@ export const stringInteger = Scope.module({
|
|
|
25
30
|
}, {
|
|
26
31
|
name: "string.integer"
|
|
27
32
|
});
|
|
28
|
-
const hex = regexStringNode(/^[
|
|
33
|
+
const hex = regexStringNode(/^[\dA-Fa-f]+$/, "hex characters only");
|
|
29
34
|
const base64 = Scope.module({
|
|
30
|
-
root: regexStringNode(/^(?:[A-Za-
|
|
31
|
-
url: regexStringNode(/^(?:[
|
|
35
|
+
root: regexStringNode(/^(?:[\d+/A-Za-z]{4})*(?:[\d+/A-Za-z]{2}==|[\d+/A-Za-z]{3}=)?$/, "base64-encoded"),
|
|
36
|
+
url: regexStringNode(/^(?:[\w-]{4})*(?:[\w-]{2}(?:==|%3D%3D)?|[\w-]{3}(?:=|%3D)?)?$/, "base64url-encoded")
|
|
32
37
|
}, {
|
|
33
38
|
name: "string.base64"
|
|
34
39
|
});
|
|
@@ -45,7 +50,7 @@ export const capitalize = Scope.module({
|
|
|
45
50
|
});
|
|
46
51
|
// https://github.com/validatorjs/validator.js/blob/master/src/lib/isLuhnNumber.js
|
|
47
52
|
export const isLuhnValid = (creditCardInput) => {
|
|
48
|
-
const sanitized = creditCardInput.
|
|
53
|
+
const sanitized = creditCardInput.replaceAll(/[ -]+/g, "");
|
|
49
54
|
let sum = 0;
|
|
50
55
|
let digit;
|
|
51
56
|
let tmpNum;
|
|
@@ -55,10 +60,7 @@ export const isLuhnValid = (creditCardInput) => {
|
|
|
55
60
|
tmpNum = Number.parseInt(digit, 10);
|
|
56
61
|
if (shouldDouble) {
|
|
57
62
|
tmpNum *= 2;
|
|
58
|
-
|
|
59
|
-
sum += (tmpNum % 10) + 1;
|
|
60
|
-
else
|
|
61
|
-
sum += tmpNum;
|
|
63
|
+
sum += tmpNum >= 10 ? (tmpNum % 10) + 1 : tmpNum;
|
|
62
64
|
}
|
|
63
65
|
else
|
|
64
66
|
sum += tmpNum;
|
|
@@ -67,7 +69,7 @@ export const isLuhnValid = (creditCardInput) => {
|
|
|
67
69
|
return !!(sum % 10 === 0 ? sanitized : false);
|
|
68
70
|
};
|
|
69
71
|
// https://github.com/validatorjs/validator.js/blob/master/src/lib/isCreditCard.js
|
|
70
|
-
const creditCardMatcher = /^(?:4
|
|
72
|
+
const creditCardMatcher = /^(?:4\d{12}(?:\d{3,6})?|5[1-5]\d{14}|(222[1-9]|22[3-9]\d|2[3-6]\d{2}|27[01]\d|2720)\d{12}|6(?:011|5\d\d)\d{12,15}|3[47]\d{13}|3(?:0[0-5]|[68]\d)\d{11}|(?:2131|1800|35\d{3})\d{11}|6[27]\d{14}|^(81\d{14,17}))$/;
|
|
71
73
|
export const creditCard = rootSchema({
|
|
72
74
|
domain: "string",
|
|
73
75
|
pattern: {
|
|
@@ -83,7 +85,7 @@ const dayDelimiterMatcher = /^[./-]$/;
|
|
|
83
85
|
// ISO 8601 date/time modernized from https://github.com/validatorjs/validator.js/blob/master/src/lib/isISO8601.js
|
|
84
86
|
// Based on https://tc39.es/ecma262/#sec-date-time-string-format, the T
|
|
85
87
|
// delimiter for date/time is mandatory. Regex from validator.js strict matcher:
|
|
86
|
-
export const iso8601Matcher = /^([+-]?\d{4}(?!\d{2}\b))((-?)((0[1-9]|1[0-2])(\3([12]\d|0[1-9]|3[01]))?|W([0-4]\d|5[0-3])(-?[1-7])?|(00[1-9]|0[1-9]\d|[12]\d{2}|3([0-5]\d|6[1-6])))(
|
|
88
|
+
export const iso8601Matcher = /^([+-]?\d{4}(?!\d{2}\b))((-?)((0[1-9]|1[0-2])(\3([12]\d|0[1-9]|3[01]))?|W([0-4]\d|5[0-3])(-?[1-7])?|(00[1-9]|0[1-9]\d|[12]\d{2}|3([0-5]\d|6[1-6])))(T((([01]\d|2[0-3])((:?)[0-5]\d)?|24:?00)([,.]\d+(?!:))?)?(\17[0-5]\d([,.]\d+)?)?([Zz]|([+-])([01]\d|2[0-3]):?([0-5]\d)?)?)?)?$/;
|
|
87
89
|
const isValidDateInstance = (date) => !Number.isNaN(+date);
|
|
88
90
|
const writeFormattedExpected = (format) => `a ${format}-formatted date`;
|
|
89
91
|
export const tryParseDatePattern = (data, opts) => {
|
|
@@ -125,7 +127,7 @@ const parsableDate = rootSchema({
|
|
|
125
127
|
}).assertHasKind("intersection");
|
|
126
128
|
const epochRoot = stringInteger.root.internal
|
|
127
129
|
.narrow((s, ctx) => {
|
|
128
|
-
//
|
|
130
|
+
// this is safe since it has already
|
|
129
131
|
// been validated as an integer string
|
|
130
132
|
const n = Number.parseInt(s);
|
|
131
133
|
const out = number.epoch(n);
|
|
@@ -179,10 +181,12 @@ export const stringDate = Scope.module({
|
|
|
179
181
|
name: "string.date"
|
|
180
182
|
});
|
|
181
183
|
const email = regexStringNode(
|
|
184
|
+
// considered https://colinhacks.com/essays/reasonable-email-regex but it includes a lookahead
|
|
185
|
+
// which breaks some integrations e.g. fast-check
|
|
186
|
+
// regex based on:
|
|
182
187
|
// https://www.regular-expressions.info/email.html
|
|
183
|
-
/^[
|
|
184
|
-
//
|
|
185
|
-
// Adjusted to incorporate unmerged fix in https://github.com/validatorjs/validator.js/pull/2083
|
|
188
|
+
/^[\w%+.-]+@[\d.A-Za-z-]+\.[A-Za-z]{2,}$/, "an email address", "email");
|
|
189
|
+
// based on https://github.com/validatorjs/validator.js/blob/master/src/lib/isIP.js
|
|
186
190
|
const ipv4Segment = "(?:[0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])";
|
|
187
191
|
const ipv4Address = `(${ipv4Segment}[.]){3}${ipv4Segment}`;
|
|
188
192
|
const ipv4Matcher = new RegExp(`^${ipv4Address}$`);
|
|
@@ -199,8 +203,8 @@ const ipv6Matcher = new RegExp("^(" +
|
|
|
199
203
|
")(%[0-9a-zA-Z.]{1,})?$");
|
|
200
204
|
export const ip = Scope.module({
|
|
201
205
|
root: ["v4 | v6", "@", "an IP address"],
|
|
202
|
-
v4: regexStringNode(ipv4Matcher, "an IPv4 address"),
|
|
203
|
-
v6: regexStringNode(ipv6Matcher, "an IPv6 address")
|
|
206
|
+
v4: regexStringNode(ipv4Matcher, "an IPv4 address", "ipv4"),
|
|
207
|
+
v6: regexStringNode(ipv6Matcher, "an IPv6 address", "ipv6")
|
|
204
208
|
}, {
|
|
205
209
|
name: "string.ip"
|
|
206
210
|
});
|
|
@@ -322,7 +326,7 @@ export const normalize = Scope.module({
|
|
|
322
326
|
name: "string.normalize"
|
|
323
327
|
});
|
|
324
328
|
const numericRoot = regexStringNode(numericStringMatcher, "a well-formed numeric string");
|
|
325
|
-
export const
|
|
329
|
+
export const stringNumeric = Scope.module({
|
|
326
330
|
root: numericRoot,
|
|
327
331
|
parse: rootSchema({
|
|
328
332
|
in: numericRoot,
|
|
@@ -332,8 +336,28 @@ export const numeric = Scope.module({
|
|
|
332
336
|
}, {
|
|
333
337
|
name: "string.numeric"
|
|
334
338
|
});
|
|
335
|
-
|
|
336
|
-
const
|
|
339
|
+
const regexPatternDescription = "a regex pattern";
|
|
340
|
+
const regex = rootSchema({
|
|
341
|
+
domain: "string",
|
|
342
|
+
predicate: {
|
|
343
|
+
meta: regexPatternDescription,
|
|
344
|
+
predicate: (s, ctx) => {
|
|
345
|
+
try {
|
|
346
|
+
new RegExp(s);
|
|
347
|
+
return true;
|
|
348
|
+
}
|
|
349
|
+
catch (e) {
|
|
350
|
+
return ctx.reject({
|
|
351
|
+
code: "predicate",
|
|
352
|
+
expected: regexPatternDescription,
|
|
353
|
+
problem: String(e)
|
|
354
|
+
});
|
|
355
|
+
}
|
|
356
|
+
}
|
|
357
|
+
},
|
|
358
|
+
meta: { format: "regex" }
|
|
359
|
+
});
|
|
360
|
+
const semverMatcher = /^(0|[1-9]\d*)\.(0|[1-9]\d*)\.(0|[1-9]\d*)(?:-((?:0|[1-9]\d*|\d*[A-Za-z-][\dA-Za-z-]*)(?:\.(?:0|[1-9]\d*|\d*[A-Za-z-][\dA-Za-z-]*))*))?(?:\+([\dA-Za-z-]+(?:\.[\dA-Za-z-]+)*))?$/;
|
|
337
361
|
const semver = regexStringNode(semverMatcher, "a semantic version (see https://semver.org/)");
|
|
338
362
|
const preformattedTrim = regexStringNode(
|
|
339
363
|
// no leading or trailing whitespace
|
|
@@ -362,7 +386,7 @@ const upper = Scope.module({
|
|
|
362
386
|
const isParsableUrl = (s) => {
|
|
363
387
|
if (URL.canParse)
|
|
364
388
|
return URL.canParse(s);
|
|
365
|
-
//
|
|
389
|
+
// TODO[2025-04-30] remove once Node 18 is EOL and we can rely on URL.canParse
|
|
366
390
|
try {
|
|
367
391
|
new URL(s);
|
|
368
392
|
return true;
|
|
@@ -376,7 +400,10 @@ const urlRoot = rootSchema({
|
|
|
376
400
|
predicate: {
|
|
377
401
|
meta: "a URL string",
|
|
378
402
|
predicate: isParsableUrl
|
|
379
|
-
}
|
|
403
|
+
},
|
|
404
|
+
// URL.canParse allows a subset of the RFC-3986 URI spec
|
|
405
|
+
// since there is no other serializable validation, best include a format
|
|
406
|
+
meta: { format: "uri" }
|
|
380
407
|
});
|
|
381
408
|
export const url = Scope.module({
|
|
382
409
|
root: urlRoot,
|
|
@@ -396,29 +423,33 @@ export const url = Scope.module({
|
|
|
396
423
|
}, {
|
|
397
424
|
name: "string.url"
|
|
398
425
|
});
|
|
399
|
-
//
|
|
426
|
+
// based on https://github.com/validatorjs/validator.js/blob/master/src/lib/isUUID.js
|
|
400
427
|
export const uuid = Scope.module({
|
|
401
428
|
// the meta tuple expression ensures the error message does not delegate
|
|
402
429
|
// to the individual branches, which are too detailed
|
|
403
|
-
root: [
|
|
430
|
+
root: [
|
|
431
|
+
"versioned | nil | max",
|
|
432
|
+
"@",
|
|
433
|
+
{ description: "a UUID", format: "uuid" }
|
|
434
|
+
],
|
|
404
435
|
"#nil": "'00000000-0000-0000-0000-000000000000'",
|
|
405
436
|
"#max": "'ffffffff-ffff-ffff-ffff-ffffffffffff'",
|
|
406
|
-
"#versioned": /[
|
|
407
|
-
v1: regexStringNode(/^[
|
|
408
|
-
v2: regexStringNode(/^[
|
|
409
|
-
v3: regexStringNode(/^[
|
|
410
|
-
v4: regexStringNode(/^[
|
|
411
|
-
v5: regexStringNode(/^[
|
|
412
|
-
v6: regexStringNode(/^[
|
|
413
|
-
v7: regexStringNode(/^[
|
|
414
|
-
v8: regexStringNode(/^[
|
|
437
|
+
"#versioned": /[\da-f]{8}-[\da-f]{4}-[1-8][\da-f]{3}-[89ab][\da-f]{3}-[\da-f]{12}/i,
|
|
438
|
+
v1: regexStringNode(/^[\da-f]{8}-[\da-f]{4}-1[\da-f]{3}-[89ab][\da-f]{3}-[\da-f]{12}$/i, "a UUIDv1"),
|
|
439
|
+
v2: regexStringNode(/^[\da-f]{8}-[\da-f]{4}-2[\da-f]{3}-[89ab][\da-f]{3}-[\da-f]{12}$/i, "a UUIDv2"),
|
|
440
|
+
v3: regexStringNode(/^[\da-f]{8}-[\da-f]{4}-3[\da-f]{3}-[89ab][\da-f]{3}-[\da-f]{12}$/i, "a UUIDv3"),
|
|
441
|
+
v4: regexStringNode(/^[\da-f]{8}-[\da-f]{4}-4[\da-f]{3}-[89ab][\da-f]{3}-[\da-f]{12}$/i, "a UUIDv4"),
|
|
442
|
+
v5: regexStringNode(/^[\da-f]{8}-[\da-f]{4}-5[\da-f]{3}-[89ab][\da-f]{3}-[\da-f]{12}$/i, "a UUIDv5"),
|
|
443
|
+
v6: regexStringNode(/^[\da-f]{8}-[\da-f]{4}-6[\da-f]{3}-[89ab][\da-f]{3}-[\da-f]{12}$/i, "a UUIDv6"),
|
|
444
|
+
v7: regexStringNode(/^[\da-f]{8}-[\da-f]{4}-7[\da-f]{3}-[89ab][\da-f]{3}-[\da-f]{12}$/i, "a UUIDv7"),
|
|
445
|
+
v8: regexStringNode(/^[\da-f]{8}-[\da-f]{4}-8[\da-f]{3}-[89ab][\da-f]{3}-[\da-f]{12}$/i, "a UUIDv8")
|
|
415
446
|
}, {
|
|
416
447
|
name: "string.uuid"
|
|
417
448
|
});
|
|
418
449
|
export const string = Scope.module({
|
|
419
450
|
root: intrinsic.string,
|
|
420
451
|
alpha: regexStringNode(/^[A-Za-z]*$/, "only letters"),
|
|
421
|
-
alphanumeric: regexStringNode(/^[
|
|
452
|
+
alphanumeric: regexStringNode(/^[\dA-Za-z]*$/, "only letters and digits 0-9"),
|
|
422
453
|
hex,
|
|
423
454
|
base64,
|
|
424
455
|
capitalize,
|
|
@@ -431,7 +462,8 @@ export const string = Scope.module({
|
|
|
431
462
|
json,
|
|
432
463
|
lower,
|
|
433
464
|
normalize,
|
|
434
|
-
numeric,
|
|
465
|
+
numeric: stringNumeric,
|
|
466
|
+
regex,
|
|
435
467
|
semver,
|
|
436
468
|
trim,
|
|
437
469
|
upper,
|
package/out/methods/base.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { BaseNode, BaseRoot, Disjoint, JsonSchema, NodeSelector, Predicate, StandardSchemaV1, TypeMeta, UndeclaredKeyBehavior } from "@ark/schema";
|
|
1
|
+
import type { BaseNode, BaseRoot, Disjoint, JsonSchema, NodeSelector, Predicate, StandardSchemaV1, ToJsonSchema, TypeMeta, UndeclaredKeyBehavior } from "@ark/schema";
|
|
2
2
|
import type { anyOrNever, array, Callable, ErrorMessage, inferred, JsonStructure, unset } from "@ark/util";
|
|
3
3
|
import type { defaultFor, distill, inferIntersection, inferPipe, InferredMorph, Out, To } from "../attributes.ts";
|
|
4
4
|
import type { ArkAmbient } from "../config.ts";
|
|
@@ -98,9 +98,9 @@ export interface Inferred<out t = unknown, $ = {}> {
|
|
|
98
98
|
/**
|
|
99
99
|
* #### generate a JSON Schema
|
|
100
100
|
*
|
|
101
|
-
* @throws {
|
|
101
|
+
* @throws {ToJsonSchema.Error} if this cannot be converted to JSON Schema
|
|
102
102
|
*/
|
|
103
|
-
toJsonSchema(): JsonSchema;
|
|
103
|
+
toJsonSchema(options?: ToJsonSchema.Options): JsonSchema;
|
|
104
104
|
/**
|
|
105
105
|
* #### metadata like custom descriptions and error messages
|
|
106
106
|
*
|
|
@@ -322,7 +322,7 @@ export interface Inferred<out t = unknown, $ = {}> {
|
|
|
322
322
|
/**
|
|
323
323
|
* #### apply a predicate function to output
|
|
324
324
|
*
|
|
325
|
-
* ✅ go-to fallback for validation not composable via
|
|
325
|
+
* ✅ go-to fallback for validation not composable via built-in types and operators
|
|
326
326
|
* ✅ runs after all other validators and morphs, if present
|
|
327
327
|
* 🥸 {@link https://www.typescriptlang.org/docs/handbook/2/narrowing.html#using-type-predicates | Type predicates} can be used as casts
|
|
328
328
|
*
|
package/out/nary.d.ts
CHANGED
|
@@ -7,397 +7,390 @@ import type { NonObjectMergeErrorMessage } from "./methods/object.ts";
|
|
|
7
7
|
import type { Type } from "./type.ts";
|
|
8
8
|
export type NaryUnionParser<$> = {
|
|
9
9
|
(): Type<never, $>;
|
|
10
|
-
<const a, r = Type<type.infer<a
|
|
11
|
-
<const a, const b, r = Type<type.infer<a
|
|
12
|
-
<const a, const b, const c, r = Type<type.infer<a
|
|
13
|
-
<const a, const b, const c, const d, r = Type<type.infer<a
|
|
14
|
-
<const a, const b, const c, const d, const e, r = Type<type.infer<a
|
|
15
|
-
<const a, const b, const c, const d, const e, const f, r = Type<type.infer<a
|
|
16
|
-
<const a, const b, const c, const d, const e, const f, const g, r = Type<type.infer<a
|
|
17
|
-
<const a, const b, const c, const d, const e, const f, const g, const h, r = Type<type.infer<a
|
|
18
|
-
<const a, const b, const c, const d, const e, const f, const g, const h, const i, r = Type<type.infer<a
|
|
19
|
-
<const a, const b, const c, const d, const e, const f, const g, const h, const i, const j, r = Type<type.infer<a
|
|
20
|
-
<const a, const b, const c, const d, const e, const f, const g, const h, const i, const j, const k, r = Type<type.infer<a
|
|
21
|
-
<const a, const b, const c, const d, const e, const f, const g, const h, const i, const j, const k, const l, r = Type<type.infer<a
|
|
22
|
-
<const a, const b, const c, const d, const e, const f, const g, const h, const i, const j, const k, const l, const m, r = Type<type.infer<a
|
|
23
|
-
<const a, const b, const c, const d, const e, const f, const g, const h, const i, const j, const k, const l, const m, const n, r = Type<type.infer<a
|
|
24
|
-
<const a, const b, const c, const d, const e, const f, const g, const h, const i, const j, const k, const l, const m, const n, const o, r = Type<type.infer<a
|
|
25
|
-
<const a, const b, const c, const d, const e, const f, const g, const h, const i, const j, const k, const l, const m, const n, const o, const p, r = Type<type.infer<a
|
|
26
|
-
<const a, const b, const c, const d, const e, const f, const g, const h, const i, const j, const k, const l, const m, const n, const o, const p, const q, r = Type<type.infer<a
|
|
27
|
-
<const defs extends readonly unknown[], r = Type<type.infer<defs[number]
|
|
28
|
-
[i in keyof defs]: type.validate<defs[i]
|
|
10
|
+
<const a, r = Type<type.infer<a, $>, $>>(a: type.validate<a, $>): r extends infer _ ? _ : never;
|
|
11
|
+
<const a, const b, r = Type<type.infer<a, $> | type.infer<b, $>, $>>(a: type.validate<a, $>, b: type.validate<b, $>): r extends infer _ ? _ : never;
|
|
12
|
+
<const a, const b, const c, r = Type<type.infer<a, $> | type.infer<b, $> | type.infer<c, $>, $>>(a: type.validate<a, $>, b: type.validate<b, $>, c: type.validate<c, $>): r extends infer _ ? _ : never;
|
|
13
|
+
<const a, const b, const c, const d, r = Type<type.infer<a, $> | type.infer<b, $> | type.infer<c, $> | type.infer<d, $>, $>>(a: type.validate<a, $>, b: type.validate<b, $>, c: type.validate<c, $>, d: type.validate<d, $>): r extends infer _ ? _ : never;
|
|
14
|
+
<const a, const b, const c, const d, const e, r = Type<type.infer<a, $> | type.infer<b, $> | type.infer<c, $> | type.infer<d, $> | type.infer<e, $>, $>>(a: type.validate<a, $>, b: type.validate<b, $>, c: type.validate<c, $>, d: type.validate<d, $>, e: type.validate<e, $>): r extends infer _ ? _ : never;
|
|
15
|
+
<const a, const b, const c, const d, const e, const f, r = Type<type.infer<a, $> | type.infer<b, $> | type.infer<c, $> | type.infer<d, $> | type.infer<e, $> | type.infer<f, $>, $>>(a: type.validate<a, $>, b: type.validate<b, $>, c: type.validate<c, $>, d: type.validate<d, $>, e: type.validate<e, $>, f: type.validate<f, $>): r extends infer _ ? _ : never;
|
|
16
|
+
<const a, const b, const c, const d, const e, const f, const g, r = Type<type.infer<a, $> | type.infer<b, $> | type.infer<c, $> | type.infer<d, $> | type.infer<e, $> | type.infer<f, $> | type.infer<g, $>, $>>(a: type.validate<a, $>, b: type.validate<b, $>, c: type.validate<c, $>, d: type.validate<d, $>, e: type.validate<e, $>, f: type.validate<f, $>, g: type.validate<g, $>): r extends infer _ ? _ : never;
|
|
17
|
+
<const a, const b, const c, const d, const e, const f, const g, const h, r = Type<type.infer<a, $> | type.infer<b, $> | type.infer<c, $> | type.infer<d, $> | type.infer<e, $> | type.infer<f, $> | type.infer<g, $> | type.infer<h, $>, $>>(a: type.validate<a, $>, b: type.validate<b, $>, c: type.validate<c, $>, d: type.validate<d, $>, e: type.validate<e, $>, f: type.validate<f, $>, g: type.validate<g, $>, h: type.validate<h, $>): r extends infer _ ? _ : never;
|
|
18
|
+
<const a, const b, const c, const d, const e, const f, const g, const h, const i, r = Type<type.infer<a, $> | type.infer<b, $> | type.infer<c, $> | type.infer<d, $> | type.infer<e, $> | type.infer<f, $> | type.infer<g, $> | type.infer<h, $> | type.infer<i, $>, $>>(a: type.validate<a, $>, b: type.validate<b, $>, c: type.validate<c, $>, d: type.validate<d, $>, e: type.validate<e, $>, f: type.validate<f, $>, g: type.validate<g, $>, h: type.validate<h, $>, i: type.validate<i, $>): r extends infer _ ? _ : never;
|
|
19
|
+
<const a, const b, const c, const d, const e, const f, const g, const h, const i, const j, r = Type<type.infer<a, $> | type.infer<b, $> | type.infer<c, $> | type.infer<d, $> | type.infer<e, $> | type.infer<f, $> | type.infer<g, $> | type.infer<h, $> | type.infer<i, $> | type.infer<j, $>>>(a: type.validate<a, $>, b: type.validate<b, $>, c: type.validate<c, $>, d: type.validate<d, $>, e: type.validate<e, $>, f: type.validate<f, $>, g: type.validate<g, $>, h: type.validate<h, $>, i: type.validate<i, $>, j: type.validate<j, $>): r extends infer _ ? _ : never;
|
|
20
|
+
<const a, const b, const c, const d, const e, const f, const g, const h, const i, const j, const k, r = Type<type.infer<a, $> | type.infer<b, $> | type.infer<c, $> | type.infer<d, $> | type.infer<e, $> | type.infer<f, $> | type.infer<g, $> | type.infer<h, $> | type.infer<i, $> | type.infer<j, $> | type.infer<k, $>>>(a: type.validate<a, $>, b: type.validate<b, $>, c: type.validate<c, $>, d: type.validate<d, $>, e: type.validate<e, $>, f: type.validate<f, $>, g: type.validate<g, $>, h: type.validate<h, $>, i: type.validate<i, $>, j: type.validate<j, $>, k: type.validate<k, $>): r extends infer _ ? _ : never;
|
|
21
|
+
<const a, const b, const c, const d, const e, const f, const g, const h, const i, const j, const k, const l, r = Type<type.infer<a, $> | type.infer<b, $> | type.infer<c, $> | type.infer<d, $> | type.infer<e, $> | type.infer<f, $> | type.infer<g, $> | type.infer<h, $> | type.infer<i, $> | type.infer<j, $> | type.infer<k, $> | type.infer<l, $>, $>>(a: type.validate<a, $>, b: type.validate<b, $>, c: type.validate<c, $>, d: type.validate<d, $>, e: type.validate<e, $>, f: type.validate<f, $>, g: type.validate<g, $>, h: type.validate<h, $>, i: type.validate<i, $>, j: type.validate<j, $>, k: type.validate<k, $>, l: type.validate<l, $>): r extends infer _ ? _ : never;
|
|
22
|
+
<const a, const b, const c, const d, const e, const f, const g, const h, const i, const j, const k, const l, const m, r = Type<type.infer<a, $> | type.infer<b, $> | type.infer<c, $> | type.infer<d, $> | type.infer<e, $> | type.infer<f, $> | type.infer<g, $> | type.infer<h, $> | type.infer<i, $> | type.infer<j, $> | type.infer<k, $> | type.infer<l, $> | type.infer<m, $>, $>>(a: type.validate<a, $>, b: type.validate<b, $>, c: type.validate<c, $>, d: type.validate<d, $>, e: type.validate<e, $>, f: type.validate<f, $>, g: type.validate<g, $>, h: type.validate<h, $>, i: type.validate<i, $>, j: type.validate<j, $>, k: type.validate<k, $>, l: type.validate<l, $>, m: type.validate<m, $>): r extends infer _ ? _ : never;
|
|
23
|
+
<const a, const b, const c, const d, const e, const f, const g, const h, const i, const j, const k, const l, const m, const n, r = Type<type.infer<a, $> | type.infer<b, $> | type.infer<c, $> | type.infer<d, $> | type.infer<e, $> | type.infer<f, $> | type.infer<g, $> | type.infer<h, $> | type.infer<i, $> | type.infer<j, $> | type.infer<k, $> | type.infer<l, $> | type.infer<m, $> | type.infer<n, $>, $>>(a: type.validate<a, $>, b: type.validate<b, $>, c: type.validate<c, $>, d: type.validate<d, $>, e: type.validate<e, $>, f: type.validate<f, $>, g: type.validate<g, $>, h: type.validate<h, $>, i: type.validate<i, $>, j: type.validate<j, $>, k: type.validate<k, $>, l: type.validate<l, $>, m: type.validate<m, $>, n: type.validate<n, $>): r extends infer _ ? _ : never;
|
|
24
|
+
<const a, const b, const c, const d, const e, const f, const g, const h, const i, const j, const k, const l, const m, const n, const o, r = Type<type.infer<a, $> | type.infer<b, $> | type.infer<c, $> | type.infer<d, $> | type.infer<e, $> | type.infer<f, $> | type.infer<g, $> | type.infer<h, $> | type.infer<i, $> | type.infer<j, $> | type.infer<k, $> | type.infer<l, $> | type.infer<m, $> | type.infer<n, $> | type.infer<o, $>, $>>(a: type.validate<a, $>, b: type.validate<b, $>, c: type.validate<c, $>, d: type.validate<d, $>, e: type.validate<e, $>, f: type.validate<f, $>, g: type.validate<g, $>, h: type.validate<h, $>, i: type.validate<i, $>, j: type.validate<j, $>, k: type.validate<k, $>, l: type.validate<l, $>, m: type.validate<m, $>, n: type.validate<n, $>, o: type.validate<o, $>): r extends infer _ ? _ : never;
|
|
25
|
+
<const a, const b, const c, const d, const e, const f, const g, const h, const i, const j, const k, const l, const m, const n, const o, const p, r = Type<type.infer<a, $> | type.infer<b, $> | type.infer<c, $> | type.infer<d, $> | type.infer<e, $> | type.infer<f, $> | type.infer<g, $> | type.infer<h, $> | type.infer<i, $> | type.infer<j, $> | type.infer<k, $> | type.infer<l, $> | type.infer<m, $> | type.infer<n, $> | type.infer<o, $> | type.infer<p, $>, $>>(a: type.validate<a, $>, b: type.validate<b, $>, c: type.validate<c, $>, d: type.validate<d, $>, e: type.validate<e, $>, f: type.validate<f, $>, g: type.validate<g, $>, h: type.validate<h, $>, i: type.validate<i, $>, j: type.validate<j, $>, k: type.validate<k, $>, l: type.validate<l, $>, m: type.validate<m, $>, n: type.validate<n, $>, o: type.validate<o, $>, p: type.validate<p, $>): r extends infer _ ? _ : never;
|
|
26
|
+
<const a, const b, const c, const d, const e, const f, const g, const h, const i, const j, const k, const l, const m, const n, const o, const p, const q, r = Type<type.infer<a, $> | type.infer<b, $> | type.infer<c, $> | type.infer<d, $> | type.infer<e, $> | type.infer<f, $> | type.infer<g, $> | type.infer<h, $> | type.infer<i, $> | type.infer<j, $> | type.infer<k, $> | type.infer<l, $> | type.infer<m, $> | type.infer<n, $> | type.infer<o, $> | type.infer<p, $> | type.infer<q, $>, $>>(a: type.validate<a, $>, b: type.validate<b, $>, c: type.validate<c, $>, d: type.validate<d, $>, e: type.validate<e, $>, f: type.validate<f, $>, g: type.validate<g, $>, h: type.validate<h, $>, i: type.validate<i, $>, j: type.validate<j, $>, k: type.validate<k, $>, l: type.validate<l, $>, m: type.validate<m, $>, n: type.validate<n, $>, o: type.validate<o, $>, p: type.validate<p, $>, q: type.validate<q, $>): r extends infer _ ? _ : never;
|
|
27
|
+
<const defs extends readonly unknown[], r = Type<type.infer<defs[number], $>, $>>(...defs: {
|
|
28
|
+
[i in keyof defs]: type.validate<defs[i], $>;
|
|
29
29
|
}): r extends infer _ ? _ : never;
|
|
30
30
|
};
|
|
31
31
|
export type NaryIntersectionParser<$> = {
|
|
32
32
|
(): Type<unknown, $>;
|
|
33
|
-
<const a, r = Type<type.infer<a
|
|
34
|
-
<const a, const b, r = Type<inferIntersection<type.infer<a
|
|
35
|
-
<const a, const b, const c, r = Type<inferNaryIntersection<[
|
|
33
|
+
<const a, r = Type<type.infer<a, $>, $>>(a: type.validate<a, $>): r extends infer _ ? _ : never;
|
|
34
|
+
<const a, const b, r = Type<inferIntersection<type.infer<a, $>, type.infer<b, $>>, $>>(a: type.validate<a, $>, b: type.validate<b, $>): r extends infer _ ? _ : never;
|
|
35
|
+
<const a, const b, const c, r = Type<inferNaryIntersection<[
|
|
36
|
+
type.infer<a, $>,
|
|
37
|
+
type.infer<b, $>,
|
|
38
|
+
type.infer<c, $>
|
|
39
|
+
]>, $>>(a: type.validate<a, $>, b: type.validate<b, $>, c: type.validate<c, $>): r extends infer _ ? _ : never;
|
|
36
40
|
<const a, const b, const c, const d, r = Type<inferNaryIntersection<[
|
|
37
|
-
type.infer<a
|
|
38
|
-
type.infer<b
|
|
39
|
-
type.infer<c
|
|
40
|
-
type.infer<d
|
|
41
|
+
type.infer<a, $>,
|
|
42
|
+
type.infer<b, $>,
|
|
43
|
+
type.infer<c, $>,
|
|
44
|
+
type.infer<d, $>
|
|
41
45
|
]>, $>>(a: type.validate<a, $>, b: type.validate<b, $>, c: type.validate<c, $>, d: type.validate<d, $>): r extends infer _ ? _ : never;
|
|
42
46
|
<const a, const b, const c, const d, const e, r = Type<inferNaryIntersection<[
|
|
43
|
-
type.infer<a
|
|
44
|
-
type.infer<b
|
|
45
|
-
type.infer<c
|
|
46
|
-
type.infer<d
|
|
47
|
-
type.infer<e
|
|
47
|
+
type.infer<a, $>,
|
|
48
|
+
type.infer<b, $>,
|
|
49
|
+
type.infer<c, $>,
|
|
50
|
+
type.infer<d, $>,
|
|
51
|
+
type.infer<e, $>
|
|
48
52
|
]>, $>>(a: type.validate<a, $>, b: type.validate<b, $>, c: type.validate<c, $>, d: type.validate<d, $>, e: type.validate<e, $>): r extends infer _ ? _ : never;
|
|
49
53
|
<const a, const b, const c, const d, const e, const f, r = Type<inferNaryIntersection<[
|
|
50
|
-
type.infer<a
|
|
51
|
-
type.infer<b
|
|
52
|
-
type.infer<c
|
|
53
|
-
type.infer<d
|
|
54
|
-
type.infer<e
|
|
55
|
-
type.infer<f
|
|
54
|
+
type.infer<a, $>,
|
|
55
|
+
type.infer<b, $>,
|
|
56
|
+
type.infer<c, $>,
|
|
57
|
+
type.infer<d, $>,
|
|
58
|
+
type.infer<e, $>,
|
|
59
|
+
type.infer<f, $>
|
|
56
60
|
]>, $>>(a: type.validate<a, $>, b: type.validate<b, $>, c: type.validate<c, $>, d: type.validate<d, $>, e: type.validate<e, $>, f: type.validate<f, $>): r extends infer _ ? _ : never;
|
|
57
61
|
<const a, const b, const c, const d, const e, const f, const g, r = Type<inferNaryIntersection<[
|
|
58
|
-
type.infer<a
|
|
59
|
-
type.infer<b
|
|
60
|
-
type.infer<c
|
|
61
|
-
type.infer<d
|
|
62
|
-
type.infer<e
|
|
63
|
-
type.infer<f
|
|
64
|
-
type.infer<g
|
|
62
|
+
type.infer<a, $>,
|
|
63
|
+
type.infer<b, $>,
|
|
64
|
+
type.infer<c, $>,
|
|
65
|
+
type.infer<d, $>,
|
|
66
|
+
type.infer<e, $>,
|
|
67
|
+
type.infer<f, $>,
|
|
68
|
+
type.infer<g, $>
|
|
65
69
|
]>, $>>(a: type.validate<a, $>, b: type.validate<b, $>, c: type.validate<c, $>, d: type.validate<d, $>, e: type.validate<e, $>, f: type.validate<f, $>, g: type.validate<g, $>): r extends infer _ ? _ : never;
|
|
66
70
|
<const a, const b, const c, const d, const e, const f, const g, const h, r = Type<inferNaryIntersection<[
|
|
67
|
-
type.infer<a
|
|
68
|
-
type.infer<b
|
|
69
|
-
type.infer<c
|
|
70
|
-
type.infer<d
|
|
71
|
-
type.infer<e
|
|
72
|
-
type.infer<f
|
|
73
|
-
type.infer<g
|
|
74
|
-
type.infer<h
|
|
71
|
+
type.infer<a, $>,
|
|
72
|
+
type.infer<b, $>,
|
|
73
|
+
type.infer<c, $>,
|
|
74
|
+
type.infer<d, $>,
|
|
75
|
+
type.infer<e, $>,
|
|
76
|
+
type.infer<f, $>,
|
|
77
|
+
type.infer<g, $>,
|
|
78
|
+
type.infer<h, $>
|
|
75
79
|
]>, $>>(a: type.validate<a, $>, b: type.validate<b, $>, c: type.validate<c, $>, d: type.validate<d, $>, e: type.validate<e, $>, f: type.validate<f, $>, g: type.validate<g, $>, h: type.validate<h, $>): r extends infer _ ? _ : never;
|
|
76
80
|
<const a, const b, const c, const d, const e, const f, const g, const h, const i, r = Type<inferNaryIntersection<[
|
|
77
|
-
type.infer<a
|
|
78
|
-
type.infer<b
|
|
79
|
-
type.infer<c
|
|
80
|
-
type.infer<d
|
|
81
|
-
type.infer<e
|
|
82
|
-
type.infer<f
|
|
83
|
-
type.infer<g
|
|
84
|
-
type.infer<h
|
|
85
|
-
type.infer<i
|
|
81
|
+
type.infer<a, $>,
|
|
82
|
+
type.infer<b, $>,
|
|
83
|
+
type.infer<c, $>,
|
|
84
|
+
type.infer<d, $>,
|
|
85
|
+
type.infer<e, $>,
|
|
86
|
+
type.infer<f, $>,
|
|
87
|
+
type.infer<g, $>,
|
|
88
|
+
type.infer<h, $>,
|
|
89
|
+
type.infer<i, $>
|
|
86
90
|
]>, $>>(a: type.validate<a, $>, b: type.validate<b, $>, c: type.validate<c, $>, d: type.validate<d, $>, e: type.validate<e, $>, f: type.validate<f, $>, g: type.validate<g, $>, h: type.validate<h, $>, i: type.validate<i, $>): r extends infer _ ? _ : never;
|
|
87
91
|
<const a, const b, const c, const d, const e, const f, const g, const h, const i, const j, r = Type<inferNaryIntersection<[
|
|
88
|
-
type.infer<a
|
|
89
|
-
type.infer<b
|
|
90
|
-
type.infer<c
|
|
91
|
-
type.infer<d
|
|
92
|
-
type.infer<e
|
|
93
|
-
type.infer<f
|
|
94
|
-
type.infer<g
|
|
95
|
-
type.infer<h
|
|
96
|
-
type.infer<i
|
|
97
|
-
type.infer<j
|
|
92
|
+
type.infer<a, $>,
|
|
93
|
+
type.infer<b, $>,
|
|
94
|
+
type.infer<c, $>,
|
|
95
|
+
type.infer<d, $>,
|
|
96
|
+
type.infer<e, $>,
|
|
97
|
+
type.infer<f, $>,
|
|
98
|
+
type.infer<g, $>,
|
|
99
|
+
type.infer<h, $>,
|
|
100
|
+
type.infer<i, $>,
|
|
101
|
+
type.infer<j, $>
|
|
98
102
|
]>, $>>(a: type.validate<a, $>, b: type.validate<b, $>, c: type.validate<c, $>, d: type.validate<d, $>, e: type.validate<e, $>, f: type.validate<f, $>, g: type.validate<g, $>, h: type.validate<h, $>, i: type.validate<i, $>, j: type.validate<j, $>): r extends infer _ ? _ : never;
|
|
99
103
|
<const a, const b, const c, const d, const e, const f, const g, const h, const i, const j, const k, r = Type<inferNaryIntersection<[
|
|
100
|
-
type.infer<a
|
|
101
|
-
type.infer<b
|
|
102
|
-
type.infer<c
|
|
103
|
-
type.infer<d
|
|
104
|
-
type.infer<e
|
|
105
|
-
type.infer<f
|
|
106
|
-
type.infer<g
|
|
107
|
-
type.infer<h
|
|
108
|
-
type.infer<i
|
|
109
|
-
type.infer<j
|
|
110
|
-
type.infer<k
|
|
104
|
+
type.infer<a, $>,
|
|
105
|
+
type.infer<b, $>,
|
|
106
|
+
type.infer<c, $>,
|
|
107
|
+
type.infer<d, $>,
|
|
108
|
+
type.infer<e, $>,
|
|
109
|
+
type.infer<f, $>,
|
|
110
|
+
type.infer<g, $>,
|
|
111
|
+
type.infer<h, $>,
|
|
112
|
+
type.infer<i, $>,
|
|
113
|
+
type.infer<j, $>,
|
|
114
|
+
type.infer<k, $>
|
|
111
115
|
]>, $>>(a: type.validate<a, $>, b: type.validate<b, $>, c: type.validate<c, $>, d: type.validate<d, $>, e: type.validate<e, $>, f: type.validate<f, $>, g: type.validate<g, $>, h: type.validate<h, $>, i: type.validate<i, $>, j: type.validate<j, $>, k: type.validate<k, $>): r extends infer _ ? _ : never;
|
|
112
116
|
<const a, const b, const c, const d, const e, const f, const g, const h, const i, const j, const k, const l, r = Type<inferNaryIntersection<[
|
|
113
|
-
type.infer<a
|
|
114
|
-
type.infer<b
|
|
115
|
-
type.infer<c
|
|
116
|
-
type.infer<d
|
|
117
|
-
type.infer<e
|
|
118
|
-
type.infer<f
|
|
119
|
-
type.infer<g
|
|
120
|
-
type.infer<h
|
|
121
|
-
type.infer<i
|
|
122
|
-
type.infer<j
|
|
123
|
-
type.infer<k
|
|
124
|
-
type.infer<l
|
|
117
|
+
type.infer<a, $>,
|
|
118
|
+
type.infer<b, $>,
|
|
119
|
+
type.infer<c, $>,
|
|
120
|
+
type.infer<d, $>,
|
|
121
|
+
type.infer<e, $>,
|
|
122
|
+
type.infer<f, $>,
|
|
123
|
+
type.infer<g, $>,
|
|
124
|
+
type.infer<h, $>,
|
|
125
|
+
type.infer<i, $>,
|
|
126
|
+
type.infer<j, $>,
|
|
127
|
+
type.infer<k, $>,
|
|
128
|
+
type.infer<l, $>
|
|
125
129
|
]>, $>>(a: type.validate<a, $>, b: type.validate<b, $>, c: type.validate<c, $>, d: type.validate<d, $>, e: type.validate<e, $>, f: type.validate<f, $>, g: type.validate<g, $>, h: type.validate<h, $>, i: type.validate<i, $>, j: type.validate<j, $>, k: type.validate<k, $>, l: type.validate<l, $>): r extends infer _ ? _ : never;
|
|
126
130
|
<const a, const b, const c, const d, const e, const f, const g, const h, const i, const j, const k, const l, const m, r = Type<inferNaryIntersection<[
|
|
127
|
-
type.infer<a
|
|
128
|
-
type.infer<b
|
|
129
|
-
type.infer<c
|
|
130
|
-
type.infer<d
|
|
131
|
-
type.infer<e
|
|
132
|
-
type.infer<f
|
|
133
|
-
type.infer<g
|
|
134
|
-
type.infer<h
|
|
135
|
-
type.infer<i
|
|
136
|
-
type.infer<j
|
|
137
|
-
type.infer<k
|
|
138
|
-
type.infer<l
|
|
139
|
-
type.infer<m
|
|
131
|
+
type.infer<a, $>,
|
|
132
|
+
type.infer<b, $>,
|
|
133
|
+
type.infer<c, $>,
|
|
134
|
+
type.infer<d, $>,
|
|
135
|
+
type.infer<e, $>,
|
|
136
|
+
type.infer<f, $>,
|
|
137
|
+
type.infer<g, $>,
|
|
138
|
+
type.infer<h, $>,
|
|
139
|
+
type.infer<i, $>,
|
|
140
|
+
type.infer<j, $>,
|
|
141
|
+
type.infer<k, $>,
|
|
142
|
+
type.infer<l, $>,
|
|
143
|
+
type.infer<m, $>
|
|
140
144
|
]>, $>>(a: type.validate<a, $>, b: type.validate<b, $>, c: type.validate<c, $>, d: type.validate<d, $>, e: type.validate<e, $>, f: type.validate<f, $>, g: type.validate<g, $>, h: type.validate<h, $>, i: type.validate<i, $>, j: type.validate<j, $>, k: type.validate<k, $>, l: type.validate<l, $>, m: type.validate<m, $>): r extends infer _ ? _ : never;
|
|
141
145
|
<const a, const b, const c, const d, const e, const f, const g, const h, const i, const j, const k, const l, const m, const n, r = Type<inferNaryIntersection<[
|
|
142
|
-
type.infer<a
|
|
143
|
-
type.infer<b
|
|
144
|
-
type.infer<c
|
|
145
|
-
type.infer<d
|
|
146
|
-
type.infer<e
|
|
147
|
-
type.infer<f
|
|
148
|
-
type.infer<g
|
|
149
|
-
type.infer<h
|
|
150
|
-
type.infer<i
|
|
151
|
-
type.infer<j
|
|
152
|
-
type.infer<k
|
|
153
|
-
type.infer<l
|
|
154
|
-
type.infer<m
|
|
155
|
-
type.infer<n
|
|
146
|
+
type.infer<a, $>,
|
|
147
|
+
type.infer<b, $>,
|
|
148
|
+
type.infer<c, $>,
|
|
149
|
+
type.infer<d, $>,
|
|
150
|
+
type.infer<e, $>,
|
|
151
|
+
type.infer<f, $>,
|
|
152
|
+
type.infer<g, $>,
|
|
153
|
+
type.infer<h, $>,
|
|
154
|
+
type.infer<i, $>,
|
|
155
|
+
type.infer<j, $>,
|
|
156
|
+
type.infer<k, $>,
|
|
157
|
+
type.infer<l, $>,
|
|
158
|
+
type.infer<m, $>,
|
|
159
|
+
type.infer<n, $>
|
|
156
160
|
]>, $>>(a: type.validate<a, $>, b: type.validate<b, $>, c: type.validate<c, $>, d: type.validate<d, $>, e: type.validate<e, $>, f: type.validate<f, $>, g: type.validate<g, $>, h: type.validate<h, $>, i: type.validate<i, $>, j: type.validate<j, $>, k: type.validate<k, $>, l: type.validate<l, $>, m: type.validate<m, $>, n: type.validate<n, $>): r extends infer _ ? _ : never;
|
|
157
161
|
<const a, const b, const c, const d, const e, const f, const g, const h, const i, const j, const k, const l, const m, const n, const o, r = Type<inferNaryIntersection<[
|
|
158
|
-
type.infer<a
|
|
159
|
-
type.infer<b
|
|
160
|
-
type.infer<c
|
|
161
|
-
type.infer<d
|
|
162
|
-
type.infer<e
|
|
163
|
-
type.infer<f
|
|
164
|
-
type.infer<g
|
|
165
|
-
type.infer<h
|
|
166
|
-
type.infer<i
|
|
167
|
-
type.infer<j
|
|
168
|
-
type.infer<k
|
|
169
|
-
type.infer<l
|
|
170
|
-
type.infer<m
|
|
171
|
-
type.infer<n
|
|
172
|
-
type.infer<o
|
|
162
|
+
type.infer<a, $>,
|
|
163
|
+
type.infer<b, $>,
|
|
164
|
+
type.infer<c, $>,
|
|
165
|
+
type.infer<d, $>,
|
|
166
|
+
type.infer<e, $>,
|
|
167
|
+
type.infer<f, $>,
|
|
168
|
+
type.infer<g, $>,
|
|
169
|
+
type.infer<h, $>,
|
|
170
|
+
type.infer<i, $>,
|
|
171
|
+
type.infer<j, $>,
|
|
172
|
+
type.infer<k, $>,
|
|
173
|
+
type.infer<l, $>,
|
|
174
|
+
type.infer<m, $>,
|
|
175
|
+
type.infer<n, $>,
|
|
176
|
+
type.infer<o, $>
|
|
173
177
|
]>, $>>(a: type.validate<a, $>, b: type.validate<b, $>, c: type.validate<c, $>, d: type.validate<d, $>, e: type.validate<e, $>, f: type.validate<f, $>, g: type.validate<g, $>, h: type.validate<h, $>, i: type.validate<i, $>, j: type.validate<j, $>, k: type.validate<k, $>, l: type.validate<l, $>, m: type.validate<m, $>, n: type.validate<n, $>, o: type.validate<o, $>): r extends infer _ ? _ : never;
|
|
174
178
|
<const a, const b, const c, const d, const e, const f, const g, const h, const i, const j, const k, const l, const m, const n, const o, const p, r = Type<inferNaryIntersection<[
|
|
175
|
-
type.infer<a
|
|
176
|
-
type.infer<b
|
|
177
|
-
type.infer<c
|
|
178
|
-
type.infer<d
|
|
179
|
-
type.infer<e
|
|
180
|
-
type.infer<f
|
|
181
|
-
type.infer<g
|
|
182
|
-
type.infer<h
|
|
183
|
-
type.infer<i
|
|
184
|
-
type.infer<j
|
|
185
|
-
type.infer<k
|
|
186
|
-
type.infer<l
|
|
187
|
-
type.infer<m
|
|
188
|
-
type.infer<n
|
|
189
|
-
type.infer<o
|
|
190
|
-
type.infer<p
|
|
179
|
+
type.infer<a, $>,
|
|
180
|
+
type.infer<b, $>,
|
|
181
|
+
type.infer<c, $>,
|
|
182
|
+
type.infer<d, $>,
|
|
183
|
+
type.infer<e, $>,
|
|
184
|
+
type.infer<f, $>,
|
|
185
|
+
type.infer<g, $>,
|
|
186
|
+
type.infer<h, $>,
|
|
187
|
+
type.infer<i, $>,
|
|
188
|
+
type.infer<j, $>,
|
|
189
|
+
type.infer<k, $>,
|
|
190
|
+
type.infer<l, $>,
|
|
191
|
+
type.infer<m, $>,
|
|
192
|
+
type.infer<n, $>,
|
|
193
|
+
type.infer<o, $>,
|
|
194
|
+
type.infer<p, $>
|
|
191
195
|
]>, $>>(a: type.validate<a, $>, b: type.validate<b, $>, c: type.validate<c, $>, d: type.validate<d, $>, e: type.validate<e, $>, f: type.validate<f, $>, g: type.validate<g, $>, h: type.validate<h, $>, i: type.validate<i, $>, j: type.validate<j, $>, k: type.validate<k, $>, l: type.validate<l, $>, m: type.validate<m, $>, n: type.validate<n, $>, o: type.validate<o, $>, p: type.validate<p, $>): r extends infer _ ? _ : never;
|
|
192
196
|
<const a, const b, const c, const d, const e, const f, const g, const h, const i, const j, const k, const l, const m, const n, const o, const p, const q, r = Type<inferNaryIntersection<[
|
|
193
|
-
type.infer<a
|
|
194
|
-
type.infer<b
|
|
195
|
-
type.infer<c
|
|
196
|
-
type.infer<d
|
|
197
|
-
type.infer<e
|
|
198
|
-
type.infer<f
|
|
199
|
-
type.infer<g
|
|
200
|
-
type.infer<h
|
|
201
|
-
type.infer<i
|
|
202
|
-
type.infer<j
|
|
203
|
-
type.infer<k
|
|
204
|
-
type.infer<l
|
|
205
|
-
type.infer<m
|
|
206
|
-
type.infer<n
|
|
207
|
-
type.infer<o
|
|
208
|
-
type.infer<p
|
|
209
|
-
type.infer<q
|
|
197
|
+
type.infer<a, $>,
|
|
198
|
+
type.infer<b, $>,
|
|
199
|
+
type.infer<c, $>,
|
|
200
|
+
type.infer<d, $>,
|
|
201
|
+
type.infer<e, $>,
|
|
202
|
+
type.infer<f, $>,
|
|
203
|
+
type.infer<g, $>,
|
|
204
|
+
type.infer<h, $>,
|
|
205
|
+
type.infer<i, $>,
|
|
206
|
+
type.infer<j, $>,
|
|
207
|
+
type.infer<k, $>,
|
|
208
|
+
type.infer<l, $>,
|
|
209
|
+
type.infer<m, $>,
|
|
210
|
+
type.infer<n, $>,
|
|
211
|
+
type.infer<o, $>,
|
|
212
|
+
type.infer<p, $>,
|
|
213
|
+
type.infer<q, $>
|
|
210
214
|
]>, $>>(a: type.validate<a, $>, b: type.validate<b, $>, c: type.validate<c, $>, d: type.validate<d, $>, e: type.validate<e, $>, f: type.validate<f, $>, g: type.validate<g, $>, h: type.validate<h, $>, i: type.validate<i, $>, j: type.validate<j, $>, k: type.validate<k, $>, l: type.validate<l, $>, m: type.validate<m, $>, n: type.validate<n, $>, o: type.validate<o, $>, p: type.validate<p, $>, q: type.validate<q, $>): r extends infer _ ? _ : never;
|
|
211
215
|
<const defs extends readonly unknown[], r = Type<inferNaryIntersection<{
|
|
212
|
-
[i in keyof defs]: type.infer<defs[i]
|
|
216
|
+
[i in keyof defs]: type.infer<defs[i], $>;
|
|
213
217
|
}>, $>>(...defs: {
|
|
214
|
-
[i in keyof defs]: type.validate<defs[i]
|
|
218
|
+
[i in keyof defs]: type.validate<defs[i], $>;
|
|
215
219
|
}): r extends infer _ ? _ : never;
|
|
216
220
|
};
|
|
217
221
|
export type NaryMergeParser<$> = {
|
|
218
222
|
(): Type<object, $>;
|
|
219
223
|
<const a, inferredA = type.infer<a, $>, r = Type<inferredA, $>>(a: type.validate<a, $> & (inferredA extends object ? unknown : ErrorType<NonObjectMergeErrorMessage, [actual: inferredA]>)): r extends infer _ ? _ : never;
|
|
220
224
|
<const a, const b, inferredA = type.infer<a, $>, inferredB = type.infer<b, $>, r = Type<merge<inferredA, inferredB>, $>>(a: type.validate<a, $> & (inferredA extends object ? unknown : ErrorType<NonObjectMergeErrorMessage, [actual: inferredA]>), b: type.validate<b, $> & (inferredB extends object ? unknown : ErrorType<"Merged type must be an object", [actual: inferredB]>)): r extends infer _ ? _ : never;
|
|
221
|
-
<const a, const b, const c, inferredA = type.infer<a, $>, inferredB = type.infer<b, $>, inferredC = type.infer<c, $>, r = Type<inferNaryMerge<[
|
|
222
|
-
<const a, const b, const c, const d, inferredA = type.infer<a, $>, inferredB = type.infer<b, $>, inferredC = type.infer<c, $>, inferredD = type.infer<d, $>, r = Type<inferNaryMerge<[
|
|
223
|
-
|
|
224
|
-
type.infer<b>,
|
|
225
|
-
type.infer<c>,
|
|
226
|
-
type.infer<d>
|
|
227
|
-
]>, $>>(a: type.validate<a, $> & (inferredA extends object ? unknown : ErrorType<NonObjectMergeErrorMessage, [actual: inferredA]>), b: type.validate<b, $> & (inferredB extends object ? unknown : ErrorType<NonObjectMergeErrorMessage, [actual: inferredB]>), c: type.validate<c, $> & (inferredC extends object ? unknown : ErrorType<NonObjectMergeErrorMessage, [actual: inferredC]>), d: type.validate<d, $> & (inferredD extends object ? unknown : ErrorType<NonObjectMergeErrorMessage, [actual: inferredD]>)): r extends infer _ ? _ : never;
|
|
228
|
-
<const a, const b, const c, const d, const e, inferredA = type.infer<a, $>, inferredB = type.infer<b, $>, inferredC = type.infer<c, $>, inferredD = type.infer<d, $>, inferredE = type.infer<e, $>, r = Type<inferNaryMerge<[
|
|
229
|
-
type.infer<a>,
|
|
230
|
-
type.infer<b>,
|
|
231
|
-
type.infer<c>,
|
|
232
|
-
type.infer<d>,
|
|
233
|
-
type.infer<e>
|
|
234
|
-
]>, $>>(a: type.validate<a, $> & (inferredA extends object ? unknown : ErrorType<NonObjectMergeErrorMessage, [actual: inferredA]>), b: type.validate<b, $> & (inferredB extends object ? unknown : ErrorType<NonObjectMergeErrorMessage, [actual: inferredB]>), c: type.validate<c, $> & (inferredC extends object ? unknown : ErrorType<NonObjectMergeErrorMessage, [actual: inferredC]>), d: type.validate<d, $> & (inferredD extends object ? unknown : ErrorType<NonObjectMergeErrorMessage, [actual: inferredD]>), e: type.validate<e, $> & (inferredE extends object ? unknown : ErrorType<NonObjectMergeErrorMessage, [actual: inferredE]>)): r extends infer _ ? _ : never;
|
|
225
|
+
<const a, const b, const c, inferredA = type.infer<a, $>, inferredB = type.infer<b, $>, inferredC = type.infer<c, $>, r = Type<inferNaryMerge<[inferredA, inferredB, inferredC]>, $>>(a: type.validate<a, $> & (inferredA extends object ? unknown : ErrorType<NonObjectMergeErrorMessage, [actual: inferredA]>), b: type.validate<b, $> & (inferredB extends object ? unknown : ErrorType<NonObjectMergeErrorMessage, [actual: inferredB]>), c: type.validate<c, $> & (inferredC extends object ? unknown : ErrorType<NonObjectMergeErrorMessage, [actual: inferredC]>)): r extends infer _ ? _ : never;
|
|
226
|
+
<const a, const b, const c, const d, inferredA = type.infer<a, $>, inferredB = type.infer<b, $>, inferredC = type.infer<c, $>, inferredD = type.infer<d, $>, r = Type<inferNaryMerge<[inferredA, inferredB, inferredC, inferredD]>, $>>(a: type.validate<a, $> & (inferredA extends object ? unknown : ErrorType<NonObjectMergeErrorMessage, [actual: inferredA]>), b: type.validate<b, $> & (inferredB extends object ? unknown : ErrorType<NonObjectMergeErrorMessage, [actual: inferredB]>), c: type.validate<c, $> & (inferredC extends object ? unknown : ErrorType<NonObjectMergeErrorMessage, [actual: inferredC]>), d: type.validate<d, $> & (inferredD extends object ? unknown : ErrorType<NonObjectMergeErrorMessage, [actual: inferredD]>)): r extends infer _ ? _ : never;
|
|
227
|
+
<const a, const b, const c, const d, const e, inferredA = type.infer<a, $>, inferredB = type.infer<b, $>, inferredC = type.infer<c, $>, inferredD = type.infer<d, $>, inferredE = type.infer<e, $>, r = Type<inferNaryMerge<[inferredA, inferredB, inferredC, inferredD, inferredE]>, $>>(a: type.validate<a, $> & (inferredA extends object ? unknown : ErrorType<NonObjectMergeErrorMessage, [actual: inferredA]>), b: type.validate<b, $> & (inferredB extends object ? unknown : ErrorType<NonObjectMergeErrorMessage, [actual: inferredB]>), c: type.validate<c, $> & (inferredC extends object ? unknown : ErrorType<NonObjectMergeErrorMessage, [actual: inferredC]>), d: type.validate<d, $> & (inferredD extends object ? unknown : ErrorType<NonObjectMergeErrorMessage, [actual: inferredD]>), e: type.validate<e, $> & (inferredE extends object ? unknown : ErrorType<NonObjectMergeErrorMessage, [actual: inferredE]>)): r extends infer _ ? _ : never;
|
|
235
228
|
<const a, const b, const c, const d, const e, const f, inferredA = type.infer<a, $>, inferredB = type.infer<b, $>, inferredC = type.infer<c, $>, inferredD = type.infer<d, $>, inferredE = type.infer<e, $>, inferredF = type.infer<f, $>, r = Type<inferNaryMerge<[
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
229
|
+
inferredA,
|
|
230
|
+
inferredB,
|
|
231
|
+
inferredC,
|
|
232
|
+
inferredD,
|
|
233
|
+
inferredE,
|
|
234
|
+
inferredF
|
|
242
235
|
]>, $>>(a: type.validate<a, $> & (inferredA extends object ? unknown : ErrorType<NonObjectMergeErrorMessage, [actual: inferredA]>), b: type.validate<b, $> & (inferredB extends object ? unknown : ErrorType<NonObjectMergeErrorMessage, [actual: inferredB]>), c: type.validate<c, $> & (inferredC extends object ? unknown : ErrorType<NonObjectMergeErrorMessage, [actual: inferredC]>), d: type.validate<d, $> & (inferredD extends object ? unknown : ErrorType<NonObjectMergeErrorMessage, [actual: inferredD]>), e: type.validate<e, $> & (inferredE extends object ? unknown : ErrorType<NonObjectMergeErrorMessage, [actual: inferredE]>), f: type.validate<f, $> & (inferredF extends object ? unknown : ErrorType<NonObjectMergeErrorMessage, [actual: inferredF]>)): r extends infer _ ? _ : never;
|
|
243
236
|
<const a, const b, const c, const d, const e, const f, const g, inferredA = type.infer<a, $>, inferredB = type.infer<b, $>, inferredC = type.infer<c, $>, inferredD = type.infer<d, $>, inferredE = type.infer<e, $>, inferredF = type.infer<f, $>, inferredG = type.infer<g, $>, r = Type<inferNaryMerge<[
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
237
|
+
inferredA,
|
|
238
|
+
inferredB,
|
|
239
|
+
inferredC,
|
|
240
|
+
inferredD,
|
|
241
|
+
inferredE,
|
|
242
|
+
inferredF,
|
|
243
|
+
inferredG
|
|
251
244
|
]>, $>>(a: type.validate<a, $> & (inferredA extends object ? unknown : ErrorType<NonObjectMergeErrorMessage, [actual: inferredA]>), b: type.validate<b, $> & (inferredB extends object ? unknown : ErrorType<NonObjectMergeErrorMessage, [actual: inferredB]>), c: type.validate<c, $> & (inferredC extends object ? unknown : ErrorType<NonObjectMergeErrorMessage, [actual: inferredC]>), d: type.validate<d, $> & (inferredD extends object ? unknown : ErrorType<NonObjectMergeErrorMessage, [actual: inferredD]>), e: type.validate<e, $> & (inferredE extends object ? unknown : ErrorType<NonObjectMergeErrorMessage, [actual: inferredE]>), f: type.validate<f, $> & (inferredF extends object ? unknown : ErrorType<NonObjectMergeErrorMessage, [actual: inferredF]>), g: type.validate<g, $> & (inferredG extends object ? unknown : ErrorType<NonObjectMergeErrorMessage, [actual: inferredG]>)): r extends infer _ ? _ : never;
|
|
252
245
|
<const a, const b, const c, const d, const e, const f, const g, const h, inferredA = type.infer<a, $>, inferredB = type.infer<b, $>, inferredC = type.infer<c, $>, inferredD = type.infer<d, $>, inferredE = type.infer<e, $>, inferredF = type.infer<f, $>, inferredG = type.infer<g, $>, inferredH = type.infer<h, $>, r = Type<inferNaryMerge<[
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
246
|
+
inferredA,
|
|
247
|
+
inferredB,
|
|
248
|
+
inferredC,
|
|
249
|
+
inferredD,
|
|
250
|
+
inferredE,
|
|
251
|
+
inferredF,
|
|
252
|
+
inferredG,
|
|
253
|
+
inferredH
|
|
261
254
|
]>, $>>(a: type.validate<a, $> & (inferredA extends object ? unknown : ErrorType<NonObjectMergeErrorMessage, [actual: inferredA]>), b: type.validate<b, $> & (inferredB extends object ? unknown : ErrorType<NonObjectMergeErrorMessage, [actual: inferredB]>), c: type.validate<c, $> & (inferredC extends object ? unknown : ErrorType<NonObjectMergeErrorMessage, [actual: inferredC]>), d: type.validate<d, $> & (inferredD extends object ? unknown : ErrorType<NonObjectMergeErrorMessage, [actual: inferredD]>), e: type.validate<e, $> & (inferredE extends object ? unknown : ErrorType<NonObjectMergeErrorMessage, [actual: inferredE]>), f: type.validate<f, $> & (inferredF extends object ? unknown : ErrorType<NonObjectMergeErrorMessage, [actual: inferredF]>), g: type.validate<g, $> & (inferredG extends object ? unknown : ErrorType<NonObjectMergeErrorMessage, [actual: inferredG]>), h: type.validate<h, $> & (inferredH extends object ? unknown : ErrorType<NonObjectMergeErrorMessage, [actual: inferredH]>)): r extends infer _ ? _ : never;
|
|
262
255
|
<const a, const b, const c, const d, const e, const f, const g, const h, const i, inferredA = type.infer<a, $>, inferredB = type.infer<b, $>, inferredC = type.infer<c, $>, inferredD = type.infer<d, $>, inferredE = type.infer<e, $>, inferredF = type.infer<f, $>, inferredG = type.infer<g, $>, inferredH = type.infer<h, $>, inferredI = type.infer<i, $>, r = Type<inferNaryMerge<[
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
256
|
+
inferredA,
|
|
257
|
+
inferredB,
|
|
258
|
+
inferredC,
|
|
259
|
+
inferredD,
|
|
260
|
+
inferredE,
|
|
261
|
+
inferredF,
|
|
262
|
+
inferredG,
|
|
263
|
+
inferredH,
|
|
264
|
+
inferredI
|
|
272
265
|
]>, $>>(a: type.validate<a, $> & (inferredA extends object ? unknown : ErrorType<NonObjectMergeErrorMessage, [actual: inferredA]>), b: type.validate<b, $> & (inferredB extends object ? unknown : ErrorType<NonObjectMergeErrorMessage, [actual: inferredB]>), c: type.validate<c, $> & (inferredC extends object ? unknown : ErrorType<NonObjectMergeErrorMessage, [actual: inferredC]>), d: type.validate<d, $> & (inferredD extends object ? unknown : ErrorType<NonObjectMergeErrorMessage, [actual: inferredD]>), e: type.validate<e, $> & (inferredE extends object ? unknown : ErrorType<NonObjectMergeErrorMessage, [actual: inferredE]>), f: type.validate<f, $> & (inferredF extends object ? unknown : ErrorType<NonObjectMergeErrorMessage, [actual: inferredF]>), g: type.validate<g, $> & (inferredG extends object ? unknown : ErrorType<NonObjectMergeErrorMessage, [actual: inferredG]>), h: type.validate<h, $> & (inferredH extends object ? unknown : ErrorType<NonObjectMergeErrorMessage, [actual: inferredH]>), i: type.validate<i, $> & (inferredI extends object ? unknown : ErrorType<NonObjectMergeErrorMessage, [actual: inferredI]>)): r extends infer _ ? _ : never;
|
|
273
266
|
<const a, const b, const c, const d, const e, const f, const g, const h, const i, const j, inferredA = type.infer<a, $>, inferredB = type.infer<b, $>, inferredC = type.infer<c, $>, inferredD = type.infer<d, $>, inferredE = type.infer<e, $>, inferredF = type.infer<f, $>, inferredG = type.infer<g, $>, inferredH = type.infer<h, $>, inferredI = type.infer<i, $>, inferredJ = type.infer<j, $>, r = Type<inferNaryMerge<[
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
267
|
+
inferredA,
|
|
268
|
+
inferredB,
|
|
269
|
+
inferredC,
|
|
270
|
+
inferredD,
|
|
271
|
+
inferredE,
|
|
272
|
+
inferredF,
|
|
273
|
+
inferredG,
|
|
274
|
+
inferredH,
|
|
275
|
+
inferredI,
|
|
276
|
+
inferredJ
|
|
284
277
|
]>, $>>(a: type.validate<a, $> & (inferredA extends object ? unknown : ErrorType<NonObjectMergeErrorMessage, [actual: inferredA]>), b: type.validate<b, $> & (inferredB extends object ? unknown : ErrorType<NonObjectMergeErrorMessage, [actual: inferredB]>), c: type.validate<c, $> & (inferredC extends object ? unknown : ErrorType<NonObjectMergeErrorMessage, [actual: inferredC]>), d: type.validate<d, $> & (inferredD extends object ? unknown : ErrorType<NonObjectMergeErrorMessage, [actual: inferredD]>), e: type.validate<e, $> & (inferredE extends object ? unknown : ErrorType<NonObjectMergeErrorMessage, [actual: inferredE]>), f: type.validate<f, $> & (inferredF extends object ? unknown : ErrorType<NonObjectMergeErrorMessage, [actual: inferredF]>), g: type.validate<g, $> & (inferredG extends object ? unknown : ErrorType<NonObjectMergeErrorMessage, [actual: inferredG]>), h: type.validate<h, $> & (inferredH extends object ? unknown : ErrorType<NonObjectMergeErrorMessage, [actual: inferredH]>), i: type.validate<i, $> & (inferredI extends object ? unknown : ErrorType<NonObjectMergeErrorMessage, [actual: inferredI]>), j: type.validate<j, $> & (inferredJ extends object ? unknown : ErrorType<NonObjectMergeErrorMessage, [actual: inferredJ]>)): r extends infer _ ? _ : never;
|
|
285
278
|
<const a, const b, const c, const d, const e, const f, const g, const h, const i, const j, const k, inferredA = type.infer<a, $>, inferredB = type.infer<b, $>, inferredC = type.infer<c, $>, inferredD = type.infer<d, $>, inferredE = type.infer<e, $>, inferredF = type.infer<f, $>, inferredG = type.infer<g, $>, inferredH = type.infer<h, $>, inferredI = type.infer<i, $>, inferredJ = type.infer<j, $>, inferredK = type.infer<k, $>, r = Type<inferNaryMerge<[
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
279
|
+
inferredA,
|
|
280
|
+
inferredB,
|
|
281
|
+
inferredC,
|
|
282
|
+
inferredD,
|
|
283
|
+
inferredE,
|
|
284
|
+
inferredF,
|
|
285
|
+
inferredG,
|
|
286
|
+
inferredH,
|
|
287
|
+
inferredI,
|
|
288
|
+
inferredJ,
|
|
289
|
+
inferredK
|
|
297
290
|
]>, $>>(a: type.validate<a, $> & (inferredA extends object ? unknown : ErrorType<NonObjectMergeErrorMessage, [actual: inferredA]>), b: type.validate<b, $> & (inferredB extends object ? unknown : ErrorType<NonObjectMergeErrorMessage, [actual: inferredB]>), c: type.validate<c, $> & (inferredC extends object ? unknown : ErrorType<NonObjectMergeErrorMessage, [actual: inferredC]>), d: type.validate<d, $> & (inferredD extends object ? unknown : ErrorType<NonObjectMergeErrorMessage, [actual: inferredD]>), e: type.validate<e, $> & (inferredE extends object ? unknown : ErrorType<NonObjectMergeErrorMessage, [actual: inferredE]>), f: type.validate<f, $> & (inferredF extends object ? unknown : ErrorType<NonObjectMergeErrorMessage, [actual: inferredF]>), g: type.validate<g, $> & (inferredG extends object ? unknown : ErrorType<NonObjectMergeErrorMessage, [actual: inferredG]>), h: type.validate<h, $> & (inferredH extends object ? unknown : ErrorType<NonObjectMergeErrorMessage, [actual: inferredH]>), i: type.validate<i, $> & (inferredI extends object ? unknown : ErrorType<NonObjectMergeErrorMessage, [actual: inferredI]>), j: type.validate<j, $> & (inferredJ extends object ? unknown : ErrorType<NonObjectMergeErrorMessage, [actual: inferredJ]>), k: type.validate<k, $> & (inferredK extends object ? unknown : ErrorType<NonObjectMergeErrorMessage, [actual: inferredK]>)): r extends infer _ ? _ : never;
|
|
298
291
|
<const a, const b, const c, const d, const e, const f, const g, const h, const i, const j, const k, const l, inferredA = type.infer<a, $>, inferredB = type.infer<b, $>, inferredC = type.infer<c, $>, inferredD = type.infer<d, $>, inferredE = type.infer<e, $>, inferredF = type.infer<f, $>, inferredG = type.infer<g, $>, inferredH = type.infer<h, $>, inferredI = type.infer<i, $>, inferredJ = type.infer<j, $>, inferredK = type.infer<k, $>, inferredL = type.infer<l, $>, r = Type<inferNaryMerge<[
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
292
|
+
inferredA,
|
|
293
|
+
inferredB,
|
|
294
|
+
inferredC,
|
|
295
|
+
inferredD,
|
|
296
|
+
inferredE,
|
|
297
|
+
inferredF,
|
|
298
|
+
inferredG,
|
|
299
|
+
inferredH,
|
|
300
|
+
inferredI,
|
|
301
|
+
inferredJ,
|
|
302
|
+
inferredK,
|
|
303
|
+
inferredL
|
|
311
304
|
]>, $>>(a: type.validate<a, $> & (inferredA extends object ? unknown : ErrorType<NonObjectMergeErrorMessage, [actual: inferredA]>), b: type.validate<b, $> & (inferredB extends object ? unknown : ErrorType<NonObjectMergeErrorMessage, [actual: inferredB]>), c: type.validate<c, $> & (inferredC extends object ? unknown : ErrorType<NonObjectMergeErrorMessage, [actual: inferredC]>), d: type.validate<d, $> & (inferredD extends object ? unknown : ErrorType<NonObjectMergeErrorMessage, [actual: inferredD]>), e: type.validate<e, $> & (inferredE extends object ? unknown : ErrorType<NonObjectMergeErrorMessage, [actual: inferredE]>), f: type.validate<f, $> & (inferredF extends object ? unknown : ErrorType<NonObjectMergeErrorMessage, [actual: inferredF]>), g: type.validate<g, $> & (inferredG extends object ? unknown : ErrorType<NonObjectMergeErrorMessage, [actual: inferredG]>), h: type.validate<h, $> & (inferredH extends object ? unknown : ErrorType<NonObjectMergeErrorMessage, [actual: inferredH]>), i: type.validate<i, $> & (inferredI extends object ? unknown : ErrorType<NonObjectMergeErrorMessage, [actual: inferredI]>), j: type.validate<j, $> & (inferredJ extends object ? unknown : ErrorType<NonObjectMergeErrorMessage, [actual: inferredJ]>), k: type.validate<k, $> & (inferredK extends object ? unknown : ErrorType<NonObjectMergeErrorMessage, [actual: inferredK]>), l: type.validate<l, $> & (inferredL extends object ? unknown : ErrorType<NonObjectMergeErrorMessage, [actual: inferredL]>)): r extends infer _ ? _ : never;
|
|
312
305
|
<const a, const b, const c, const d, const e, const f, const g, const h, const i, const j, const k, const l, const m, inferredA = type.infer<a, $>, inferredB = type.infer<b, $>, inferredC = type.infer<c, $>, inferredD = type.infer<d, $>, inferredE = type.infer<e, $>, inferredF = type.infer<f, $>, inferredG = type.infer<g, $>, inferredH = type.infer<h, $>, inferredI = type.infer<i, $>, inferredJ = type.infer<j, $>, inferredK = type.infer<k, $>, inferredL = type.infer<l, $>, inferredM = type.infer<m, $>, r = Type<inferNaryMerge<[
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
306
|
+
inferredA,
|
|
307
|
+
inferredB,
|
|
308
|
+
inferredC,
|
|
309
|
+
inferredD,
|
|
310
|
+
inferredE,
|
|
311
|
+
inferredF,
|
|
312
|
+
inferredG,
|
|
313
|
+
inferredH,
|
|
314
|
+
inferredI,
|
|
315
|
+
inferredJ,
|
|
316
|
+
inferredK,
|
|
317
|
+
inferredL,
|
|
318
|
+
inferredM
|
|
326
319
|
]>, $>>(a: type.validate<a, $> & (inferredA extends object ? unknown : ErrorType<NonObjectMergeErrorMessage, [actual: inferredA]>), b: type.validate<b, $> & (inferredB extends object ? unknown : ErrorType<NonObjectMergeErrorMessage, [actual: inferredB]>), c: type.validate<c, $> & (inferredC extends object ? unknown : ErrorType<NonObjectMergeErrorMessage, [actual: inferredC]>), d: type.validate<d, $> & (inferredD extends object ? unknown : ErrorType<NonObjectMergeErrorMessage, [actual: inferredD]>), e: type.validate<e, $> & (inferredE extends object ? unknown : ErrorType<NonObjectMergeErrorMessage, [actual: inferredE]>), f: type.validate<f, $> & (inferredF extends object ? unknown : ErrorType<NonObjectMergeErrorMessage, [actual: inferredF]>), g: type.validate<g, $> & (inferredG extends object ? unknown : ErrorType<NonObjectMergeErrorMessage, [actual: inferredG]>), h: type.validate<h, $> & (inferredH extends object ? unknown : ErrorType<NonObjectMergeErrorMessage, [actual: inferredH]>), i: type.validate<i, $> & (inferredI extends object ? unknown : ErrorType<NonObjectMergeErrorMessage, [actual: inferredI]>), j: type.validate<j, $> & (inferredJ extends object ? unknown : ErrorType<NonObjectMergeErrorMessage, [actual: inferredJ]>), k: type.validate<k, $> & (inferredK extends object ? unknown : ErrorType<NonObjectMergeErrorMessage, [actual: inferredK]>), l: type.validate<l, $> & (inferredL extends object ? unknown : ErrorType<NonObjectMergeErrorMessage, [actual: inferredL]>), m: type.validate<m, $> & (inferredM extends object ? unknown : ErrorType<NonObjectMergeErrorMessage, [actual: inferredM]>)): r extends infer _ ? _ : never;
|
|
327
320
|
<const a, const b, const c, const d, const e, const f, const g, const h, const i, const j, const k, const l, const m, const n, inferredA = type.infer<a, $>, inferredB = type.infer<b, $>, inferredC = type.infer<c, $>, inferredD = type.infer<d, $>, inferredE = type.infer<e, $>, inferredF = type.infer<f, $>, inferredG = type.infer<g, $>, inferredH = type.infer<h, $>, inferredI = type.infer<i, $>, inferredJ = type.infer<j, $>, inferredK = type.infer<k, $>, inferredL = type.infer<l, $>, inferredM = type.infer<m, $>, inferredN = type.infer<n, $>, r = Type<inferNaryMerge<[
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
321
|
+
inferredA,
|
|
322
|
+
inferredB,
|
|
323
|
+
inferredC,
|
|
324
|
+
inferredD,
|
|
325
|
+
inferredE,
|
|
326
|
+
inferredF,
|
|
327
|
+
inferredG,
|
|
328
|
+
inferredH,
|
|
329
|
+
inferredI,
|
|
330
|
+
inferredJ,
|
|
331
|
+
inferredK,
|
|
332
|
+
inferredL,
|
|
333
|
+
inferredM,
|
|
334
|
+
inferredN
|
|
342
335
|
]>, $>>(a: type.validate<a, $> & (inferredA extends object ? unknown : ErrorType<NonObjectMergeErrorMessage, [actual: inferredA]>), b: type.validate<b, $> & (inferredB extends object ? unknown : ErrorType<NonObjectMergeErrorMessage, [actual: inferredB]>), c: type.validate<c, $> & (inferredC extends object ? unknown : ErrorType<NonObjectMergeErrorMessage, [actual: inferredC]>), d: type.validate<d, $> & (inferredD extends object ? unknown : ErrorType<NonObjectMergeErrorMessage, [actual: inferredD]>), e: type.validate<e, $> & (inferredE extends object ? unknown : ErrorType<NonObjectMergeErrorMessage, [actual: inferredE]>), f: type.validate<f, $> & (inferredF extends object ? unknown : ErrorType<NonObjectMergeErrorMessage, [actual: inferredF]>), g: type.validate<g, $> & (inferredG extends object ? unknown : ErrorType<NonObjectMergeErrorMessage, [actual: inferredG]>), h: type.validate<h, $> & (inferredH extends object ? unknown : ErrorType<NonObjectMergeErrorMessage, [actual: inferredH]>), i: type.validate<i, $> & (inferredI extends object ? unknown : ErrorType<NonObjectMergeErrorMessage, [actual: inferredI]>), j: type.validate<j, $> & (inferredJ extends object ? unknown : ErrorType<NonObjectMergeErrorMessage, [actual: inferredJ]>), k: type.validate<k, $> & (inferredK extends object ? unknown : ErrorType<NonObjectMergeErrorMessage, [actual: inferredK]>), l: type.validate<l, $> & (inferredL extends object ? unknown : ErrorType<NonObjectMergeErrorMessage, [actual: inferredL]>), m: type.validate<m, $> & (inferredM extends object ? unknown : ErrorType<NonObjectMergeErrorMessage, [actual: inferredM]>), n: type.validate<n, $> & (inferredN extends object ? unknown : ErrorType<NonObjectMergeErrorMessage, [actual: inferredN]>)): r extends infer _ ? _ : never;
|
|
343
336
|
<const a, const b, const c, const d, const e, const f, const g, const h, const i, const j, const k, const l, const m, const n, const o, inferredA = type.infer<a, $>, inferredB = type.infer<b, $>, inferredC = type.infer<c, $>, inferredD = type.infer<d, $>, inferredE = type.infer<e, $>, inferredF = type.infer<f, $>, inferredG = type.infer<g, $>, inferredH = type.infer<h, $>, inferredI = type.infer<i, $>, inferredJ = type.infer<j, $>, inferredK = type.infer<k, $>, inferredL = type.infer<l, $>, inferredM = type.infer<m, $>, inferredN = type.infer<n, $>, inferredO = type.infer<o, $>, r = Type<inferNaryMerge<[
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
337
|
+
inferredA,
|
|
338
|
+
inferredB,
|
|
339
|
+
inferredC,
|
|
340
|
+
inferredD,
|
|
341
|
+
inferredE,
|
|
342
|
+
inferredF,
|
|
343
|
+
inferredG,
|
|
344
|
+
inferredH,
|
|
345
|
+
inferredI,
|
|
346
|
+
inferredJ,
|
|
347
|
+
inferredK,
|
|
348
|
+
inferredL,
|
|
349
|
+
inferredM,
|
|
350
|
+
inferredN,
|
|
351
|
+
inferredO
|
|
359
352
|
]>, $>>(a: type.validate<a, $> & (inferredA extends object ? unknown : ErrorType<NonObjectMergeErrorMessage, [actual: inferredA]>), b: type.validate<b, $> & (inferredB extends object ? unknown : ErrorType<NonObjectMergeErrorMessage, [actual: inferredB]>), c: type.validate<c, $> & (inferredC extends object ? unknown : ErrorType<NonObjectMergeErrorMessage, [actual: inferredC]>), d: type.validate<d, $> & (inferredD extends object ? unknown : ErrorType<NonObjectMergeErrorMessage, [actual: inferredD]>), e: type.validate<e, $> & (inferredE extends object ? unknown : ErrorType<NonObjectMergeErrorMessage, [actual: inferredE]>), f: type.validate<f, $> & (inferredF extends object ? unknown : ErrorType<NonObjectMergeErrorMessage, [actual: inferredF]>), g: type.validate<g, $> & (inferredG extends object ? unknown : ErrorType<NonObjectMergeErrorMessage, [actual: inferredG]>), h: type.validate<h, $> & (inferredH extends object ? unknown : ErrorType<NonObjectMergeErrorMessage, [actual: inferredH]>), i: type.validate<i, $> & (inferredI extends object ? unknown : ErrorType<NonObjectMergeErrorMessage, [actual: inferredI]>), j: type.validate<j, $> & (inferredJ extends object ? unknown : ErrorType<NonObjectMergeErrorMessage, [actual: inferredJ]>), k: type.validate<k, $> & (inferredK extends object ? unknown : ErrorType<NonObjectMergeErrorMessage, [actual: inferredK]>), l: type.validate<l, $> & (inferredL extends object ? unknown : ErrorType<NonObjectMergeErrorMessage, [actual: inferredL]>), m: type.validate<m, $> & (inferredM extends object ? unknown : ErrorType<NonObjectMergeErrorMessage, [actual: inferredM]>), n: type.validate<n, $> & (inferredN extends object ? unknown : ErrorType<NonObjectMergeErrorMessage, [actual: inferredN]>), o: type.validate<o, $> & (inferredO extends object ? unknown : ErrorType<NonObjectMergeErrorMessage, [actual: inferredO]>)): r extends infer _ ? _ : never;
|
|
360
353
|
<const a, const b, const c, const d, const e, const f, const g, const h, const i, const j, const k, const l, const m, const n, const o, const p, inferredA = type.infer<a, $>, inferredB = type.infer<b, $>, inferredC = type.infer<c, $>, inferredD = type.infer<d, $>, inferredE = type.infer<e, $>, inferredF = type.infer<f, $>, inferredG = type.infer<g, $>, inferredH = type.infer<h, $>, inferredI = type.infer<i, $>, inferredJ = type.infer<j, $>, inferredK = type.infer<k, $>, inferredL = type.infer<l, $>, inferredM = type.infer<m, $>, inferredN = type.infer<n, $>, inferredO = type.infer<o, $>, inferredP = type.infer<p, $>, r = Type<inferNaryMerge<[
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
354
|
+
inferredA,
|
|
355
|
+
inferredB,
|
|
356
|
+
inferredC,
|
|
357
|
+
inferredD,
|
|
358
|
+
inferredE,
|
|
359
|
+
inferredF,
|
|
360
|
+
inferredG,
|
|
361
|
+
inferredH,
|
|
362
|
+
inferredI,
|
|
363
|
+
inferredJ,
|
|
364
|
+
inferredK,
|
|
365
|
+
inferredL,
|
|
366
|
+
inferredM,
|
|
367
|
+
inferredN,
|
|
368
|
+
inferredO,
|
|
369
|
+
inferredP
|
|
377
370
|
]>, $>>(a: type.validate<a, $> & (inferredA extends object ? unknown : ErrorType<NonObjectMergeErrorMessage, [actual: inferredA]>), b: type.validate<b, $> & (inferredB extends object ? unknown : ErrorType<NonObjectMergeErrorMessage, [actual: inferredB]>), c: type.validate<c, $> & (inferredC extends object ? unknown : ErrorType<NonObjectMergeErrorMessage, [actual: inferredC]>), d: type.validate<d, $> & (inferredD extends object ? unknown : ErrorType<NonObjectMergeErrorMessage, [actual: inferredD]>), e: type.validate<e, $> & (inferredE extends object ? unknown : ErrorType<NonObjectMergeErrorMessage, [actual: inferredE]>), f: type.validate<f, $> & (inferredF extends object ? unknown : ErrorType<NonObjectMergeErrorMessage, [actual: inferredF]>), g: type.validate<g, $> & (inferredG extends object ? unknown : ErrorType<NonObjectMergeErrorMessage, [actual: inferredG]>), h: type.validate<h, $> & (inferredH extends object ? unknown : ErrorType<NonObjectMergeErrorMessage, [actual: inferredH]>), i: type.validate<i, $> & (inferredI extends object ? unknown : ErrorType<NonObjectMergeErrorMessage, [actual: inferredI]>), j: type.validate<j, $> & (inferredJ extends object ? unknown : ErrorType<NonObjectMergeErrorMessage, [actual: inferredJ]>), k: type.validate<k, $> & (inferredK extends object ? unknown : ErrorType<NonObjectMergeErrorMessage, [actual: inferredK]>), l: type.validate<l, $> & (inferredL extends object ? unknown : ErrorType<NonObjectMergeErrorMessage, [actual: inferredL]>), m: type.validate<m, $> & (inferredM extends object ? unknown : ErrorType<NonObjectMergeErrorMessage, [actual: inferredM]>), n: type.validate<n, $> & (inferredN extends object ? unknown : ErrorType<NonObjectMergeErrorMessage, [actual: inferredN]>), o: type.validate<o, $> & (inferredO extends object ? unknown : ErrorType<NonObjectMergeErrorMessage, [actual: inferredO]>), p: type.validate<p, $> & (inferredP extends object ? unknown : ErrorType<NonObjectMergeErrorMessage, [actual: inferredP]>)): r extends infer _ ? _ : never;
|
|
378
371
|
<const a, const b, const c, const d, const e, const f, const g, const h, const i, const j, const k, const l, const m, const n, const o, const p, const q, inferredA = type.infer<a, $>, inferredB = type.infer<b, $>, inferredC = type.infer<c, $>, inferredD = type.infer<d, $>, inferredE = type.infer<e, $>, inferredF = type.infer<f, $>, inferredG = type.infer<g, $>, inferredH = type.infer<h, $>, inferredI = type.infer<i, $>, inferredJ = type.infer<j, $>, inferredK = type.infer<k, $>, inferredL = type.infer<l, $>, inferredM = type.infer<m, $>, inferredN = type.infer<n, $>, inferredO = type.infer<o, $>, inferredP = type.infer<p, $>, inferredQ = type.infer<q, $>, r = Type<inferNaryMerge<[
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
372
|
+
inferredA,
|
|
373
|
+
inferredB,
|
|
374
|
+
inferredC,
|
|
375
|
+
inferredD,
|
|
376
|
+
inferredE,
|
|
377
|
+
inferredF,
|
|
378
|
+
inferredG,
|
|
379
|
+
inferredH,
|
|
380
|
+
inferredI,
|
|
381
|
+
inferredJ,
|
|
382
|
+
inferredK,
|
|
383
|
+
inferredL,
|
|
384
|
+
inferredM,
|
|
385
|
+
inferredN,
|
|
386
|
+
inferredO,
|
|
387
|
+
inferredP,
|
|
388
|
+
inferredQ
|
|
396
389
|
]>, $>>(a: type.validate<a, $> & (inferredA extends object ? unknown : ErrorType<NonObjectMergeErrorMessage, [actual: inferredA]>), b: type.validate<b, $> & (inferredB extends object ? unknown : ErrorType<NonObjectMergeErrorMessage, [actual: inferredB]>), c: type.validate<c, $> & (inferredC extends object ? unknown : ErrorType<NonObjectMergeErrorMessage, [actual: inferredC]>), d: type.validate<d, $> & (inferredD extends object ? unknown : ErrorType<NonObjectMergeErrorMessage, [actual: inferredD]>), e: type.validate<e, $> & (inferredE extends object ? unknown : ErrorType<NonObjectMergeErrorMessage, [actual: inferredE]>), f: type.validate<f, $> & (inferredF extends object ? unknown : ErrorType<NonObjectMergeErrorMessage, [actual: inferredF]>), g: type.validate<g, $> & (inferredG extends object ? unknown : ErrorType<NonObjectMergeErrorMessage, [actual: inferredG]>), h: type.validate<h, $> & (inferredH extends object ? unknown : ErrorType<NonObjectMergeErrorMessage, [actual: inferredH]>), i: type.validate<i, $> & (inferredI extends object ? unknown : ErrorType<NonObjectMergeErrorMessage, [actual: inferredI]>), j: type.validate<j, $> & (inferredJ extends object ? unknown : ErrorType<NonObjectMergeErrorMessage, [actual: inferredJ]>), k: type.validate<k, $> & (inferredK extends object ? unknown : ErrorType<NonObjectMergeErrorMessage, [actual: inferredK]>), l: type.validate<l, $> & (inferredL extends object ? unknown : ErrorType<NonObjectMergeErrorMessage, [actual: inferredL]>), m: type.validate<m, $> & (inferredM extends object ? unknown : ErrorType<NonObjectMergeErrorMessage, [actual: inferredM]>), n: type.validate<n, $> & (inferredN extends object ? unknown : ErrorType<NonObjectMergeErrorMessage, [actual: inferredN]>), o: type.validate<o, $> & (inferredO extends object ? unknown : ErrorType<NonObjectMergeErrorMessage, [actual: inferredO]>), p: type.validate<p, $> & (inferredP extends object ? unknown : ErrorType<NonObjectMergeErrorMessage, [actual: inferredP]>), q: type.validate<q, $> & (inferredQ extends object ? unknown : ErrorType<NonObjectMergeErrorMessage, [actual: inferredQ]>)): r extends infer _ ? _ : never;
|
|
397
390
|
<const defs extends readonly unknown[], r = Type<inferNaryMerge<{
|
|
398
|
-
[i in keyof defs]: type.infer<defs[i]
|
|
391
|
+
[i in keyof defs]: type.infer<defs[i], $>;
|
|
399
392
|
}>, $>>(...defs: {
|
|
400
|
-
[i in keyof defs]: type.validate<defs[i]
|
|
393
|
+
[i in keyof defs]: type.validate<defs[i], $> & (type.infer<defs[i], $> extends object ? unknown : ErrorType<NonObjectMergeErrorMessage, [
|
|
401
394
|
actual: type.infer<defs[i], $>
|
|
402
395
|
]>);
|
|
403
396
|
}): r extends infer _ ? _ : never;
|
|
@@ -16,7 +16,7 @@ export type inferDefinition<def, $, args> = [
|
|
|
16
16
|
export type validateDefinition<def, $, args> = null extends undefined ? ErrorMessage<`'strict' or 'strictNullChecks' must be set to true in your tsconfig's 'compilerOptions'`> : [def] extends [anyOrNever] ? def : def extends OptionalPropertyDefinition ? ErrorMessage<shallowOptionalMessage> : isDefaultable<def, $, args> extends true ? ErrorMessage<shallowDefaultableMessage> : validateInnerDefinition<def, $, args>;
|
|
17
17
|
export type validateInnerDefinition<def, $, args> = [
|
|
18
18
|
def
|
|
19
|
-
] extends [Terminal] ? def : def extends string ? validateString<def, $, args> : def extends
|
|
19
|
+
] extends [Terminal] ? def : def extends string ? validateString<def, $, args> : def extends BadDefinitionType ? ErrorMessage<writeBadDefinitionTypeMessage<objectKindOrDomainOf<def>>> : unknown extends def ? BaseCompletions<$, args> | {} : def extends readonly unknown[] ? validateTuple<def, $, args> : validateObjectLiteral<def, $, args>;
|
|
20
20
|
export declare const parseTuple: (def: array, ctx: BaseParseContext) => BaseRoot;
|
|
21
21
|
export type validateTuple<def extends array, $, args> = maybeValidateTupleExpression<def, $, args> extends infer result ? result extends null ? validateTupleLiteral<def, $, args> : result : never;
|
|
22
22
|
export type inferTuple<def extends array, $, args> = def extends TupleExpression ? inferTupleExpression<def, $, args> : inferTupleLiteral<def, $, args>;
|
|
@@ -33,7 +33,7 @@ type declarationMismatch<def, declared, $, args> = {
|
|
|
33
33
|
declared: declared;
|
|
34
34
|
inferred: inferDefinition<def, $, args>;
|
|
35
35
|
};
|
|
36
|
-
type Terminal = type.cast<unknown> | Fn;
|
|
36
|
+
type Terminal = type.cast<unknown> | Fn | RegExp;
|
|
37
37
|
export type ThunkCast<t = unknown> = () => type.cast<t>;
|
|
38
38
|
type BadDefinitionType = Exclude<Primitive, string>;
|
|
39
39
|
export declare const writeBadDefinitionTypeMessage: <actual extends string>(actual: actual) => writeBadDefinitionTypeMessage<actual>;
|
|
@@ -106,11 +106,17 @@ const appendSpreadBranch = (base, branch) => {
|
|
|
106
106
|
// the only array with no sequence reference is unknown[]
|
|
107
107
|
return appendVariadicElement(base, $ark.intrinsic.unknown);
|
|
108
108
|
}
|
|
109
|
-
spread.prefix
|
|
110
|
-
|
|
109
|
+
if (spread.prefix)
|
|
110
|
+
for (const node of spread.prefix)
|
|
111
|
+
appendRequiredElement(base, node);
|
|
112
|
+
if (spread.optionals)
|
|
113
|
+
for (const node of spread.optionals)
|
|
114
|
+
appendOptionalElement(base, node);
|
|
111
115
|
if (spread.variadic)
|
|
112
116
|
appendVariadicElement(base, spread.variadic);
|
|
113
|
-
spread.postfix
|
|
117
|
+
if (spread.postfix)
|
|
118
|
+
for (const node of spread.postfix)
|
|
119
|
+
appendRequiredElement(base, node);
|
|
114
120
|
return base;
|
|
115
121
|
};
|
|
116
122
|
export const writeNonArraySpreadMessage = (operand) => `Spread element must be an array (was ${operand})`;
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "arktype",
|
|
3
3
|
"description": "TypeScript's 1:1 validator, optimized from editor to runtime",
|
|
4
|
-
"version": "2.1.
|
|
4
|
+
"version": "2.1.20",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"repository": {
|
|
7
7
|
"type": "git",
|
|
@@ -34,8 +34,8 @@
|
|
|
34
34
|
"out"
|
|
35
35
|
],
|
|
36
36
|
"dependencies": {
|
|
37
|
-
"@ark/util": "0.
|
|
38
|
-
"@ark/schema": "0.
|
|
37
|
+
"@ark/util": "0.46.0",
|
|
38
|
+
"@ark/schema": "0.46.0"
|
|
39
39
|
},
|
|
40
40
|
"publishConfig": {
|
|
41
41
|
"access": "public"
|