arktype 0.5.1 → 0.6.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/api.cjs +4 -2
- package/dist/api.d.ts +1 -1
- package/dist/api.mjs +1 -1
- package/dist/cjs/nodes/branch.js +3 -3
- package/dist/cjs/nodes/discriminate.js +2 -2
- package/dist/cjs/nodes/node.js +13 -18
- package/dist/cjs/nodes/predicate.js +1 -6
- package/dist/cjs/nodes/rules/props.js +39 -0
- package/dist/cjs/nodes/rules/rules.js +5 -2
- package/dist/cjs/parse/ast/config.js +15 -0
- package/dist/cjs/parse/ast/distributableFunction.js +1 -1
- package/dist/cjs/parse/ast/keyof.js +1 -1
- package/dist/cjs/parse/ast/morph.js +3 -3
- package/dist/cjs/{nodes/infer.js → parse/ast/node.js} +0 -0
- package/dist/cjs/parse/ast/tuple.js +2 -1
- package/dist/cjs/parse/definition.js +2 -2
- package/dist/cjs/parse/string/reduce/dynamic.js +2 -2
- package/dist/cjs/parse/string/shift/operand/unenclosed.js +1 -1
- package/dist/cjs/parse/string/string.js +3 -3
- package/dist/cjs/scopes/{standard.js → ark.js} +9 -8
- package/dist/cjs/scopes/expressions.js +9 -9
- package/dist/cjs/scopes/scope.js +73 -63
- package/dist/cjs/scopes/type.js +10 -29
- package/dist/cjs/scopes/validation/creditCard.js +47 -0
- package/dist/cjs/scopes/validation/date.js +63 -0
- package/dist/cjs/scopes/validation/validation.js +90 -0
- package/dist/cjs/traverse/problems.js +45 -16
- package/dist/cjs/traverse/traverse.js +63 -26
- package/dist/mjs/nodes/branch.js +2 -2
- package/dist/mjs/nodes/discriminate.js +2 -2
- package/dist/mjs/nodes/node.js +13 -19
- package/dist/mjs/nodes/predicate.js +1 -5
- package/dist/mjs/nodes/rules/props.js +39 -0
- package/dist/mjs/nodes/rules/rules.js +5 -2
- package/dist/mjs/parse/ast/config.js +7 -0
- package/dist/mjs/parse/ast/distributableFunction.js +1 -1
- package/dist/mjs/parse/ast/keyof.js +1 -1
- package/dist/mjs/parse/ast/morph.js +4 -4
- package/dist/mjs/{nodes/infer.js → parse/ast/node.js} +0 -0
- package/dist/mjs/parse/ast/tuple.js +2 -1
- package/dist/mjs/parse/definition.js +2 -2
- package/dist/mjs/parse/string/reduce/dynamic.js +2 -2
- package/dist/mjs/parse/string/shift/operand/unenclosed.js +1 -1
- package/dist/mjs/parse/string/string.js +3 -3
- package/dist/mjs/scopes/{standard.js → ark.js} +8 -7
- package/dist/mjs/scopes/expressions.js +9 -9
- package/dist/mjs/scopes/scope.js +69 -63
- package/dist/mjs/scopes/type.js +10 -29
- package/dist/mjs/scopes/validation/creditCard.js +34 -0
- package/dist/mjs/scopes/validation/date.js +49 -0
- package/dist/mjs/scopes/validation/validation.js +76 -0
- package/dist/mjs/traverse/problems.js +42 -15
- package/dist/mjs/traverse/traverse.js +64 -27
- package/dist/tsconfig.temp.tsbuildinfo +1 -1
- package/dist/types/nodes/branch.d.ts +6 -6
- package/dist/types/nodes/node.d.ts +10 -5
- package/dist/types/nodes/predicate.d.ts +2 -6
- package/dist/types/nodes/rules/props.d.ts +15 -0
- package/dist/types/nodes/rules/rules.d.ts +2 -2
- package/dist/types/parse/ast/ast.d.ts +1 -1
- package/dist/types/parse/ast/config.d.ts +10 -0
- package/dist/types/parse/ast/narrow.d.ts +1 -1
- package/dist/types/{nodes/infer.d.ts → parse/ast/node.d.ts} +12 -12
- package/dist/types/parse/ast/tuple.d.ts +4 -3
- package/dist/types/scopes/{standard.d.ts → ark.d.ts} +12 -4
- package/dist/types/scopes/expressions.d.ts +3 -3
- package/dist/types/scopes/scope.d.ts +19 -7
- package/dist/types/scopes/type.d.ts +20 -12
- package/dist/types/scopes/validation/creditCard.d.ts +2 -0
- package/dist/types/scopes/validation/date.d.ts +23 -0
- package/dist/types/scopes/validation/validation.d.ts +26 -0
- package/dist/types/traverse/problems.d.ts +14 -8
- package/dist/types/traverse/traverse.d.ts +13 -3
- package/dist/types/utils/generics.d.ts +5 -5
- package/package.json +1 -1
- package/dist/cjs/scopes/validation.js +0 -79
- package/dist/mjs/scopes/validation.js +0 -66
- package/dist/types/scopes/validation.d.ts +0 -25
|
@@ -1,20 +1,21 @@
|
|
|
1
|
-
import type { inferNode } from "../../nodes/infer.js";
|
|
2
1
|
import type { ResolvedNode, TypeNode } from "../../nodes/node.js";
|
|
3
2
|
import type { conform, constructor, Dict, error, evaluate, List } from "../../utils/generics.js";
|
|
4
3
|
import type { inferDefinition, ParseContext, validateDefinition } from "../definition.js";
|
|
5
4
|
import { writeMissingRightOperandMessage } from "../string/shift/operand/unenclosed.js";
|
|
6
5
|
import type { Scanner } from "../string/shift/scanner.js";
|
|
6
|
+
import type { validateConfigTuple } from "./config.js";
|
|
7
7
|
import type { inferIntersection } from "./intersection.js";
|
|
8
8
|
import type { inferKeyOfExpression, validateKeyOfExpression } from "./keyof.js";
|
|
9
9
|
import type { inferMorph, validateMorphTuple } from "./morph.js";
|
|
10
10
|
import type { inferNarrow, validateNarrowTuple } from "./narrow.js";
|
|
11
|
+
import type { inferNode } from "./node.js";
|
|
11
12
|
import type { inferUnion } from "./union.js";
|
|
12
13
|
export declare const parseTuple: (def: List, ctx: ParseContext) => TypeNode;
|
|
13
14
|
export type validateTupleExpression<def extends TupleExpression, $> = def[1] extends "[]" ? conform<def, readonly [validateDefinition<def[0], $>, "[]"]> : def[1] extends Scanner.BranchToken ? def[2] extends undefined ? [def[0], error<writeMissingRightOperandMessage<def[1], "">>] : conform<def, readonly [
|
|
14
15
|
validateDefinition<def[0], $>,
|
|
15
16
|
def[1],
|
|
16
17
|
validateDefinition<def[2], $>
|
|
17
|
-
]> : def[1] extends "|>" ? validateMorphTuple<def, $> : def[1] extends "
|
|
18
|
+
]> : def[1] extends "=>" ? validateNarrowTuple<def, $> : def[1] extends "|>" ? validateMorphTuple<def, $> : def[1] extends ":" ? validateConfigTuple<def, $> : def[0] extends "===" ? conform<def, readonly ["===", unknown]> : def[0] extends "instanceof" ? conform<def, readonly ["instanceof", constructor]> : def[0] extends "node" ? conform<def, readonly ["node", ResolvedNode<$>]> : def[0] extends "keyof" ? conform<def, validateKeyOfExpression<def[1], $>> : never;
|
|
18
19
|
export type UnparsedTupleExpressionInput<$> = {
|
|
19
20
|
instanceof: constructor;
|
|
20
21
|
node: ResolvedNode<$>;
|
|
@@ -24,7 +25,7 @@ export type UnparsedTupleOperator = evaluate<keyof UnparsedTupleExpressionInput<
|
|
|
24
25
|
export type inferTuple<def extends List, $> = def extends TupleExpression ? inferTupleExpression<def, $> : {
|
|
25
26
|
[i in keyof def]: inferDefinition<def[i], $>;
|
|
26
27
|
};
|
|
27
|
-
export type inferTupleExpression<def extends TupleExpression, $> = def[1] extends "[]" ? inferDefinition<def[0], $>[] : def[1] extends "&" ? inferIntersection<inferDefinition<def[0], $>, inferDefinition<def[2], $>> : def[1] extends "|" ? inferUnion<inferDefinition<def[0], $>, inferDefinition<def[2], $>> : def[1] extends "=>" ? inferNarrow<def[0], def[2], $> : def[1] extends "|>" ? inferMorph<def[0], def[2], $> : def[0] extends "===" ? def[1] : def[0] extends "instanceof" ? def[1] extends constructor<infer t> ? t : never : def[0] extends "node" ? def[1] extends ResolvedNode<$> ? inferNode<def[1], $> : never : def[0] extends "keyof" ? inferKeyOfExpression<def[1], $> : never;
|
|
28
|
+
export type inferTupleExpression<def extends TupleExpression, $> = def[1] extends "[]" ? inferDefinition<def[0], $>[] : def[1] extends "&" ? inferIntersection<inferDefinition<def[0], $>, inferDefinition<def[2], $>> : def[1] extends "|" ? inferUnion<inferDefinition<def[0], $>, inferDefinition<def[2], $>> : def[1] extends "=>" ? inferNarrow<def[0], def[2], $> : def[1] extends "|>" ? inferMorph<def[0], def[2], $> : def[1] extends ":" ? inferDefinition<def[0], $> : def[0] extends "===" ? def[1] : def[0] extends "instanceof" ? def[1] extends constructor<infer t> ? t : never : def[0] extends "node" ? def[1] extends ResolvedNode<$> ? inferNode<def[1], $> : never : def[0] extends "keyof" ? inferKeyOfExpression<def[1], $> : never;
|
|
28
29
|
export type PostfixParser<token extends IndexOneOperator> = (def: IndexOneExpression<token>, ctx: ParseContext) => TypeNode;
|
|
29
30
|
export type PrefixParser<token extends IndexZeroOperator> = (def: IndexZeroExpression<token>, ctx: ParseContext) => TypeNode;
|
|
30
31
|
export type TupleExpression = IndexZeroExpression | IndexOneExpression;
|
|
@@ -2,7 +2,7 @@ import type { Out } from "../parse/ast/morph.js";
|
|
|
2
2
|
import type { InferredObjectKinds } from "../utils/objectKinds.js";
|
|
3
3
|
import type { Space } from "./scope.js";
|
|
4
4
|
import type { TypeParser } from "./type.js";
|
|
5
|
-
export declare const
|
|
5
|
+
export declare const ark: import("./scope.js").Scope<[{
|
|
6
6
|
any: any;
|
|
7
7
|
bigint: bigint;
|
|
8
8
|
boolean: boolean;
|
|
@@ -42,9 +42,10 @@ export declare const standardScope: import("./scope.js").Scope<[{
|
|
|
42
42
|
uuid: string;
|
|
43
43
|
parsedNumber: (In: string) => Out<number>;
|
|
44
44
|
parsedInteger: (In: string) => Out<number>;
|
|
45
|
+
parsedDate: (In: string) => Out<Date>;
|
|
45
46
|
integer: number;
|
|
46
47
|
}, {}, false]>;
|
|
47
|
-
export declare const
|
|
48
|
+
export declare const arktypes: Space<{
|
|
48
49
|
any: any;
|
|
49
50
|
bigint: bigint;
|
|
50
51
|
boolean: boolean;
|
|
@@ -84,9 +85,11 @@ export declare const standard: Space<{
|
|
|
84
85
|
uuid: string;
|
|
85
86
|
parsedNumber: (In: string) => Out<number>;
|
|
86
87
|
parsedInteger: (In: string) => Out<number>;
|
|
88
|
+
parsedDate: (In: string) => Out<Date>;
|
|
87
89
|
integer: number;
|
|
88
90
|
}>;
|
|
89
91
|
export declare const scopes: {
|
|
92
|
+
root: import("./scope.js").Scope<[{}, {}, false]>;
|
|
90
93
|
tsKeywords: import("./scope.js").Scope<[{
|
|
91
94
|
any: any;
|
|
92
95
|
bigint: bigint;
|
|
@@ -131,9 +134,10 @@ export declare const scopes: {
|
|
|
131
134
|
uuid: string;
|
|
132
135
|
parsedNumber: (In: string) => Out<number>;
|
|
133
136
|
parsedInteger: (In: string) => Out<number>;
|
|
137
|
+
parsedDate: (In: string) => Out<Date>;
|
|
134
138
|
integer: number;
|
|
135
139
|
}, {}, false]>;
|
|
136
|
-
|
|
140
|
+
ark: import("./scope.js").Scope<[{
|
|
137
141
|
any: any;
|
|
138
142
|
bigint: bigint;
|
|
139
143
|
boolean: boolean;
|
|
@@ -173,6 +177,7 @@ export declare const scopes: {
|
|
|
173
177
|
uuid: string;
|
|
174
178
|
parsedNumber: (In: string) => Out<number>;
|
|
175
179
|
parsedInteger: (In: string) => Out<number>;
|
|
180
|
+
parsedDate: (In: string) => Out<Date>;
|
|
176
181
|
integer: number;
|
|
177
182
|
}, {}, false]>;
|
|
178
183
|
};
|
|
@@ -221,9 +226,10 @@ export declare const spaces: {
|
|
|
221
226
|
uuid: string;
|
|
222
227
|
parsedNumber: (In: string) => Out<number>;
|
|
223
228
|
parsedInteger: (In: string) => Out<number>;
|
|
229
|
+
parsedDate: (In: string) => Out<Date>;
|
|
224
230
|
integer: number;
|
|
225
231
|
}>;
|
|
226
|
-
|
|
232
|
+
ark: Space<{
|
|
227
233
|
any: any;
|
|
228
234
|
bigint: bigint;
|
|
229
235
|
boolean: boolean;
|
|
@@ -263,6 +269,7 @@ export declare const spaces: {
|
|
|
263
269
|
uuid: string;
|
|
264
270
|
parsedNumber: (In: string) => Out<number>;
|
|
265
271
|
parsedInteger: (In: string) => Out<number>;
|
|
272
|
+
parsedDate: (In: string) => Out<Date>;
|
|
266
273
|
integer: number;
|
|
267
274
|
}>;
|
|
268
275
|
};
|
|
@@ -291,5 +298,6 @@ export type PrecompiledDefaults = {
|
|
|
291
298
|
uuid: string;
|
|
292
299
|
parsedNumber: (In: string) => Out<number>;
|
|
293
300
|
parsedInteger: (In: string) => Out<number>;
|
|
301
|
+
parsedDate: (In: string) => Out<Date>;
|
|
294
302
|
} & InferredObjectKinds;
|
|
295
303
|
export declare const type: TypeParser<PrecompiledDefaults>;
|
|
@@ -4,14 +4,14 @@ import type { Narrow } from "../parse/ast/narrow.js";
|
|
|
4
4
|
import type { FunctionalTupleOperator, inferTupleExpression, TupleExpression, TuplePostfixOperator, UnparsedTupleExpressionInput, UnparsedTupleOperator } from "../parse/ast/tuple.js";
|
|
5
5
|
import type { inferDefinition, validateDefinition } from "../parse/definition.js";
|
|
6
6
|
import type { conform } from "../utils/generics.js";
|
|
7
|
-
import type { PrecompiledDefaults } from "./
|
|
7
|
+
import type { PrecompiledDefaults } from "./ark.js";
|
|
8
8
|
import type { asIn, asOut, Type, TypeOptions } from "./type.js";
|
|
9
9
|
export type Expressions<$> = {
|
|
10
10
|
intersection: BinaryExpressionParser<$, "&">;
|
|
11
11
|
union: BinaryExpressionParser<$, "|">;
|
|
12
12
|
arrayOf: UnaryExpressionParser<$, "[]">;
|
|
13
13
|
keyOf: UnaryExpressionParser<$, "keyof">;
|
|
14
|
-
|
|
14
|
+
node: UnvalidatedExpressionParser<$, "node">;
|
|
15
15
|
instanceOf: UnvalidatedExpressionParser<$, "instanceof">;
|
|
16
16
|
valueOf: UnvalidatedExpressionParser<$, "===">;
|
|
17
17
|
narrow: FunctionalExpressionParser<$, "=>">;
|
|
@@ -42,7 +42,7 @@ export type FunctionalExpressionParser<$, operator extends FunctionalTupleOperat
|
|
|
42
42
|
<inDef, fn extends FunctionWithInferredInput<$, operator, inDef>>(inDef: validateDefinition<inDef, $>, fn: fn): parseTupleExpression<[inDef, operator, fn], $>;
|
|
43
43
|
<inDef, fn extends FunctionWithInferredInput<$, operator, inDef>>(inDef: validateDefinition<inDef, $>, fn: fn, opts: TypeOptions): parseTupleExpression<[inDef, operator, fn], $>;
|
|
44
44
|
};
|
|
45
|
-
export type FunctionWithInferredInput<$, operator extends FunctionalTupleOperator, inDef> = operator extends "
|
|
45
|
+
export type FunctionWithInferredInput<$, operator extends FunctionalTupleOperator, inDef> = operator extends "=>" ? distributable<Narrow<asIn<inferDefinition<inDef, $>>>> : Morph<asOut<inferDefinition<inDef, $>>>;
|
|
46
46
|
type unaryToTupleExpression<def, operator extends "keyof" | "[]"> = operator extends TuplePostfixOperator ? [def, "[]"] : [operator, def];
|
|
47
47
|
type parseTupleExpression<expression extends TupleExpression, $> = inferTupleExpression<expression, $> extends infer result ? [result] extends [never] ? never : Type<result> : never;
|
|
48
48
|
export {};
|
|
@@ -1,11 +1,13 @@
|
|
|
1
1
|
import type { ResolvedNode, TypeNode } from "../nodes/node.js";
|
|
2
|
+
import type { ConfigTuple } from "../parse/ast/config.js";
|
|
2
3
|
import type { inferDefinition, ParseContext, validateDefinition } from "../parse/definition.js";
|
|
4
|
+
import type { ProblemsConfig, ProblemWritersByCode } from "../traverse/problems.js";
|
|
3
5
|
import type { Dict, error, evaluate, isAny, List, nominal } from "../utils/generics.js";
|
|
4
6
|
import type { stringifyUnion } from "../utils/unionToTuple.js";
|
|
7
|
+
import type { PrecompiledDefaults } from "./ark.js";
|
|
5
8
|
import { FreezingCache } from "./cache.js";
|
|
6
9
|
import type { Expressions } from "./expressions.js";
|
|
7
|
-
import type {
|
|
8
|
-
import type { Type, TypeConfig, TypeParser } from "./type.js";
|
|
10
|
+
import type { KeyCheckKind, Type, TypeParser } from "./type.js";
|
|
9
11
|
type ScopeParser = {
|
|
10
12
|
<aliases>(aliases: validateAliases<aliases, {}>): Scope<parseScope<aliases, {}>>;
|
|
11
13
|
<aliases, opts extends ScopeOptions>(aliases: validateAliases<aliases, opts>, opts: validateOptions<opts>): Scope<parseScope<aliases, opts>>;
|
|
@@ -18,8 +20,14 @@ export type ScopeOptions = {
|
|
|
18
20
|
includes?: Space[] | [];
|
|
19
21
|
standard?: boolean;
|
|
20
22
|
name?: string;
|
|
21
|
-
|
|
23
|
+
codes?: ProblemsConfig;
|
|
24
|
+
keys?: KeyCheckKind;
|
|
22
25
|
};
|
|
26
|
+
export type ScopeConfig = evaluate<{
|
|
27
|
+
keys: KeyCheckKind;
|
|
28
|
+
codes: ProblemWritersByCode;
|
|
29
|
+
}>;
|
|
30
|
+
export declare const compileScopeOptions: (opts: ScopeOptions) => ScopeConfig;
|
|
23
31
|
type validateOptions<opts extends ScopeOptions> = {
|
|
24
32
|
[k in keyof opts]: k extends "imports" | "includes" ? mergeSpaces<opts[k], [
|
|
25
33
|
k,
|
|
@@ -54,15 +62,16 @@ export type Space<exports = Dict> = {
|
|
|
54
62
|
};
|
|
55
63
|
type resolutions<context extends ScopeContext> = localsOf<context> & exportsOf<context>;
|
|
56
64
|
type name<context extends ScopeContext> = keyof resolutions<context> & string;
|
|
65
|
+
export declare const isConfigTuple: (def: unknown) => def is ConfigTuple;
|
|
57
66
|
export declare class Scope<context extends ScopeContext = any> {
|
|
58
67
|
#private;
|
|
59
68
|
aliases: Dict;
|
|
60
|
-
opts: ScopeOptions;
|
|
61
69
|
name: string;
|
|
62
|
-
config:
|
|
70
|
+
config: ScopeConfig;
|
|
63
71
|
parseCache: FreezingCache<TypeNode>;
|
|
64
|
-
constructor(aliases: Dict, opts
|
|
65
|
-
|
|
72
|
+
constructor(aliases: Dict, opts?: ScopeOptions);
|
|
73
|
+
getAnonymousTypeName(ctx?: ParseContext): string;
|
|
74
|
+
addAnonymous(type: Type, ctx: ParseContext): string;
|
|
66
75
|
get infer(): exportsOf<context>;
|
|
67
76
|
compile(): Space<exportsOf<context>>;
|
|
68
77
|
addReferenceIfResolvable(name: name<context>, ctx: ParseContext): boolean;
|
|
@@ -78,8 +87,11 @@ export declare class Scope<context extends ScopeContext = any> {
|
|
|
78
87
|
narrow: import("./expressions.js").FunctionalExpressionParser<resolutions<context>, "=>">;
|
|
79
88
|
morph: import("./expressions.js").FunctionalExpressionParser<resolutions<context>, "|>">;
|
|
80
89
|
type: TypeParser<resolutions<context>>;
|
|
90
|
+
isInternallyResolvable(name: string): unknown;
|
|
81
91
|
}
|
|
82
92
|
export declare const scope: ScopeParser;
|
|
93
|
+
export declare const rootScope: Scope<[{}, {}, false]>;
|
|
94
|
+
export declare const rootType: TypeParser<{}>;
|
|
83
95
|
export declare const writeShallowCycleErrorMessage: (name: string, seen: string[]) => string;
|
|
84
96
|
export declare const writeDuplicateAliasesMessage: <name_1 extends string>(name: name_1) => `Alias '${name_1}' is already defined`;
|
|
85
97
|
type writeDuplicateAliasesMessage<name extends string> = `Alias '${name}' is already defined`;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { TraversalNode, TypeNode } from "../nodes/node.js";
|
|
2
2
|
import type { ParsedMorph } from "../parse/ast/morph.js";
|
|
3
3
|
import type { as, inferDefinition, validateDefinition } from "../parse/definition.js";
|
|
4
|
-
import type {
|
|
4
|
+
import type { ProblemOptions, Problems } from "../traverse/problems.js";
|
|
5
5
|
import type { defer, evaluate, xor } from "../utils/generics.js";
|
|
6
6
|
import type { BuiltinClass } from "../utils/objectKinds.js";
|
|
7
7
|
import type { Expressions } from "./expressions.js";
|
|
@@ -11,29 +11,37 @@ export type TypeParser<$> = {
|
|
|
11
11
|
<def>(def: validateDefinition<def, $>, opts: TypeOptions): parseType<def, $>;
|
|
12
12
|
} & TypeParserProps<$>;
|
|
13
13
|
export type TypeParserProps<$> = {
|
|
14
|
-
from: Expressions<$>["
|
|
14
|
+
from: Expressions<$>["node"];
|
|
15
15
|
};
|
|
16
16
|
export type parseType<def, $> = [def] extends [validateDefinition<def, $>] ? Type<inferDefinition<def, $>> : never;
|
|
17
|
-
type TypeRoot<t = unknown> = {
|
|
17
|
+
type TypeRoot<t = unknown> = evaluate<{
|
|
18
18
|
[as]: t;
|
|
19
19
|
infer: asOut<t>;
|
|
20
20
|
node: TypeNode;
|
|
21
21
|
flat: TraversalNode;
|
|
22
|
-
|
|
23
|
-
|
|
22
|
+
qualifiedName: QualifiedTypeName;
|
|
23
|
+
definition: unknown;
|
|
24
|
+
scope: Scope;
|
|
25
|
+
includesMorph: boolean;
|
|
26
|
+
config: TypeConfig | undefined;
|
|
27
|
+
}>;
|
|
28
|
+
export type KeyCheckKind = "loose" | "strict" | "distilled";
|
|
24
29
|
export type TypeOptions = evaluate<{
|
|
30
|
+
keys?: KeyCheckKind;
|
|
25
31
|
name?: string;
|
|
26
|
-
} &
|
|
27
|
-
export type TypeConfig =
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
32
|
+
} & ProblemOptions>;
|
|
33
|
+
export type TypeConfig = Omit<TypeOptions, "name">;
|
|
34
|
+
export declare const initializeType: (name: string, definition: unknown, config: TypeConfig | undefined, scope: Scope) => Checker<unknown> & {
|
|
35
|
+
infer: unknown;
|
|
36
|
+
node: TypeNode;
|
|
37
|
+
flat: TraversalNode;
|
|
38
|
+
qualifiedName: QualifiedTypeName;
|
|
31
39
|
definition: unknown;
|
|
32
40
|
scope: Scope;
|
|
33
|
-
config: TypeConfig | undefined;
|
|
34
41
|
includesMorph: boolean;
|
|
42
|
+
config: TypeConfig | undefined;
|
|
43
|
+
[as]: unknown;
|
|
35
44
|
};
|
|
36
|
-
export declare const initializeType: (definition: unknown, opts: TypeOptions | undefined, scope: Scope) => Type<unknown>;
|
|
37
45
|
export declare const isType: (value: unknown) => value is Type<unknown>;
|
|
38
46
|
export type CheckResult<t> = xor<{
|
|
39
47
|
data: asOut<t>;
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
type DayDelimiter = "." | "/" | "-";
|
|
2
|
+
type DayPart = DayPatterns[PartKey];
|
|
3
|
+
type PartKey = keyof DayPatterns;
|
|
4
|
+
type DayPatterns = {
|
|
5
|
+
y: "yy" | "yyyy";
|
|
6
|
+
m: "mm" | "m";
|
|
7
|
+
d: "dd" | "d";
|
|
8
|
+
};
|
|
9
|
+
type fragment<part extends DayPart, delimiter extends DayDelimiter> = `${delimiter}${part}` | "";
|
|
10
|
+
export type DayPattern<delimiter extends DayDelimiter = DayDelimiter> = {
|
|
11
|
+
[d in delimiter]: {
|
|
12
|
+
[k1 in keyof DayPatterns]: {
|
|
13
|
+
[k2 in Exclude<keyof DayPatterns, k1>]: `${DayPatterns[k1]}${fragment<DayPatterns[k2], d>}${fragment<DayPatterns[Exclude<keyof DayPatterns, k1 | k2>], d>}`;
|
|
14
|
+
}[Exclude<keyof DayPatterns, k1>];
|
|
15
|
+
}[keyof DayPatterns];
|
|
16
|
+
}[delimiter];
|
|
17
|
+
export type DateFormat = "iso8601" | DayPattern;
|
|
18
|
+
export type DateOptions = {
|
|
19
|
+
format?: DateFormat;
|
|
20
|
+
};
|
|
21
|
+
export declare const tryParseDate: (data: string, opts?: DateOptions) => Date | string;
|
|
22
|
+
export declare const parsedDate: import("../type.js").Type<(In: string) => import("../../parse/ast/morph.js").Out<Date>>;
|
|
23
|
+
export {};
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
export declare const validationScope: import("../scope.js").Scope<[{
|
|
2
|
+
alpha: string;
|
|
3
|
+
alphanumeric: string;
|
|
4
|
+
lowercase: string;
|
|
5
|
+
uppercase: string;
|
|
6
|
+
creditCard: string;
|
|
7
|
+
email: string;
|
|
8
|
+
uuid: string;
|
|
9
|
+
parsedNumber: (In: string) => import("../../parse/ast/morph.js").Out<number>;
|
|
10
|
+
parsedInteger: (In: string) => import("../../parse/ast/morph.js").Out<number>;
|
|
11
|
+
parsedDate: (In: string) => import("../../parse/ast/morph.js").Out<Date>;
|
|
12
|
+
integer: number;
|
|
13
|
+
}, {}, false]>;
|
|
14
|
+
export declare const validation: import("../scope.js").Space<{
|
|
15
|
+
alpha: string;
|
|
16
|
+
alphanumeric: string;
|
|
17
|
+
lowercase: string;
|
|
18
|
+
uppercase: string;
|
|
19
|
+
creditCard: string;
|
|
20
|
+
email: string;
|
|
21
|
+
uuid: string;
|
|
22
|
+
parsedNumber: (In: string) => import("../../parse/ast/morph.js").Out<number>;
|
|
23
|
+
parsedInteger: (In: string) => import("../../parse/ast/morph.js").Out<number>;
|
|
24
|
+
parsedDate: (In: string) => import("../../parse/ast/morph.js").Out<Date>;
|
|
25
|
+
integer: number;
|
|
26
|
+
}>;
|
|
@@ -31,6 +31,7 @@ declare class ProblemArray extends Array<Problem> {
|
|
|
31
31
|
byPath: Record<string, Problem>;
|
|
32
32
|
count: number;
|
|
33
33
|
constructor(state: TraversalState);
|
|
34
|
+
mustBe(description: string, opts?: AddProblemOptions): Problem<any>;
|
|
34
35
|
add<code extends ProblemCode>(code: code, source: ProblemSource<code>, opts?: AddProblemOptions<ProblemData<code>>): Problem;
|
|
35
36
|
addProblem(problem: Problem): void;
|
|
36
37
|
get summary(): string;
|
|
@@ -47,12 +48,13 @@ type ProblemSources = {
|
|
|
47
48
|
class: DefaultObjectKind | constructor;
|
|
48
49
|
domain: Domain;
|
|
49
50
|
missing: undefined;
|
|
51
|
+
extraneous: unknown;
|
|
50
52
|
bound: FlatBound;
|
|
51
53
|
regex: RegexLiteral;
|
|
52
54
|
value: unknown;
|
|
53
55
|
multi: Problem[];
|
|
54
56
|
branches: readonly Problem[];
|
|
55
|
-
|
|
57
|
+
custom: string;
|
|
56
58
|
cases: string[];
|
|
57
59
|
};
|
|
58
60
|
export type ProblemCode = evaluate<keyof ProblemSources>;
|
|
@@ -61,22 +63,26 @@ type ProblemDataByCode = {
|
|
|
61
63
|
[code in ProblemCode]: code extends keyof ConstrainedRuleTraversalData ? ConstrainedRuleTraversalData[code] : unknown;
|
|
62
64
|
};
|
|
63
65
|
export type ProblemData<code extends ProblemCode = ProblemCode> = ProblemDataByCode[code];
|
|
64
|
-
export type MustBeWriter<code extends ProblemCode> = (source: ProblemSources[code]) => string;
|
|
66
|
+
export type MustBeWriter<code extends ProblemCode> = string | ((source: ProblemSources[code]) => string);
|
|
65
67
|
export type ReasonWriter<code extends ProblemCode = ProblemCode> = (mustBe: string, data: DataWrapper<code extends keyof ConstrainedRuleTraversalData ? ConstrainedRuleTraversalData[code] : unknown>) => string;
|
|
66
68
|
export type ContextWriter = (reason: string, path: Path) => string;
|
|
67
|
-
export declare const
|
|
69
|
+
export declare const problemCodes: readonly ProblemCode[];
|
|
70
|
+
export declare const defaultProblemWriters: ProblemWritersByCode;
|
|
71
|
+
export declare const compileProblemWriters: (input: ProblemsConfig | undefined) => ProblemWritersByCode;
|
|
68
72
|
export type ProblemOptions<code extends ProblemCode = ProblemCode> = {
|
|
69
73
|
mustBe?: MustBeWriter<code>;
|
|
70
74
|
writeReason?: ReasonWriter<code>;
|
|
71
75
|
addContext?: ContextWriter;
|
|
72
76
|
};
|
|
73
77
|
export type ProblemsConfig = evaluate<{
|
|
74
|
-
|
|
75
|
-
|
|
78
|
+
writeReason?: ReasonWriter;
|
|
79
|
+
addContext?: ContextWriter;
|
|
80
|
+
} & ProblemsConfigByCode>;
|
|
81
|
+
export type ProblemsConfigByCode = {
|
|
76
82
|
[code in ProblemCode]?: ProblemOptions<code>;
|
|
77
|
-
}
|
|
78
|
-
export type
|
|
83
|
+
};
|
|
84
|
+
export type ProblemWritersByCode = {
|
|
79
85
|
[code in ProblemCode]: ProblemWriters<code>;
|
|
80
86
|
};
|
|
81
|
-
export type ProblemWriters<code extends ProblemCode> = Required<ProblemOptions<code>>;
|
|
87
|
+
export type ProblemWriters<code extends ProblemCode = ProblemCode> = Required<ProblemOptions<code>>;
|
|
82
88
|
export {};
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import type { TraversalEntry, TraversalKey, TraversalNode, TraversalValue } from "../nodes/node.js";
|
|
1
|
+
import type { ConfigEntry, TraversalEntry, TraversalKey, TraversalNode, TraversalValue } from "../nodes/node.js";
|
|
2
2
|
import type { TraversalProp } from "../nodes/rules/props.js";
|
|
3
|
+
import type { Scope } from "../scopes/scope.js";
|
|
3
4
|
import type { Type, TypeConfig } from "../scopes/type.js";
|
|
4
5
|
import type { SizedData } from "../utils/data.js";
|
|
5
6
|
import type { extend, stringKeyOf } from "../utils/generics.js";
|
|
@@ -16,6 +17,7 @@ export declare class TraversalState<data = unknown> {
|
|
|
16
17
|
byPath: Record<string, Problem<any>>;
|
|
17
18
|
count: number;
|
|
18
19
|
"__#2@#state": TraversalState<unknown>;
|
|
20
|
+
mustBe(description: string, opts?: import("./problems.js").AddProblemOptions<unknown> | undefined): Problem<any>;
|
|
19
21
|
add<code extends ProblemCode>(code: code, source: import("./problems.js").ProblemSource<code>, opts?: import("./problems.js").AddProblemOptions<import("./problems.js").ProblemData<code>> | undefined): Problem<any>;
|
|
20
22
|
addProblem(problem: Problem<any>): void;
|
|
21
23
|
readonly summary: string;
|
|
@@ -76,14 +78,20 @@ export declare class TraversalState<data = unknown> {
|
|
|
76
78
|
values: boolean;
|
|
77
79
|
};
|
|
78
80
|
}>;
|
|
79
|
-
configs: TypeConfig[];
|
|
80
81
|
failFast: boolean;
|
|
82
|
+
traversalConfig: TraversalConfig;
|
|
83
|
+
readonly rootScope: Scope;
|
|
81
84
|
constructor(data: data, type: Type);
|
|
82
|
-
|
|
85
|
+
getProblemConfig<code extends ProblemCode>(code: code): ProblemWriters<code>;
|
|
86
|
+
getConfigKey<k extends keyof TypeConfig>(k: k): TypeConfig[k] | undefined;
|
|
87
|
+
traverseConfig(configEntries: ConfigEntry[], node: TraversalNode): boolean;
|
|
83
88
|
traverseKey(key: stringKeyOf<this["data"]>, node: TraversalNode): boolean;
|
|
84
89
|
traverseResolution(name: string): boolean;
|
|
85
90
|
traverseBranches(branches: TraversalEntry[][]): boolean;
|
|
86
91
|
}
|
|
92
|
+
export type TraversalConfig = {
|
|
93
|
+
[k in keyof TypeConfig]-?: TypeConfig[k][];
|
|
94
|
+
};
|
|
87
95
|
export declare const traverse: (node: TraversalNode, state: TraversalState) => boolean;
|
|
88
96
|
export declare const checkEntries: (entries: TraversalEntry[], state: TraversalState) => boolean;
|
|
89
97
|
export declare const checkRequiredProp: (prop: TraversalProp, state: TraversalState<TraversableData>) => boolean;
|
|
@@ -100,5 +108,7 @@ export type ConstrainedRuleTraversalData = extend<{
|
|
|
100
108
|
optionalProp: TraversableData;
|
|
101
109
|
requiredProp: TraversableData;
|
|
102
110
|
indexProp: TraversableData;
|
|
111
|
+
distilledProps: TraversableData;
|
|
112
|
+
strictProps: TraversableData;
|
|
103
113
|
}>;
|
|
104
114
|
export type RuleData<k extends TraversalKey> = k extends keyof ConstrainedRuleTraversalData ? ConstrainedRuleTraversalData[k] : unknown;
|
|
@@ -33,11 +33,11 @@ export type conform<t, base> = t extends base ? t : base;
|
|
|
33
33
|
export declare const isKeyOf: <k extends string | number, obj extends object>(k: k, obj: obj) => k is Extract<keyof obj, k>;
|
|
34
34
|
export type constructor<instance = unknown> = new (...args: any[]) => instance;
|
|
35
35
|
export type instanceOf<classType extends constructor<any>> = classType extends constructor<infer Instance> ? Instance : never;
|
|
36
|
-
export type entryOf<o> = {
|
|
37
|
-
[k in keyof o]-?: [k, o[k]];
|
|
38
|
-
}[o extends List ? keyof o & number : keyof o]
|
|
39
|
-
export type entriesOf<o extends object> = entryOf<o>[]
|
|
40
|
-
export declare const entriesOf: <o extends object>(o: o) =>
|
|
36
|
+
export type entryOf<o> = evaluate<{
|
|
37
|
+
[k in keyof o]-?: [k, defined<o[k]>];
|
|
38
|
+
}[o extends List ? keyof o & number : keyof o]>;
|
|
39
|
+
export type entriesOf<o extends object> = evaluate<entryOf<o>[]>;
|
|
40
|
+
export declare const entriesOf: <o extends object>(o: o) => ({ [k_1 in keyof o]-?: [k_1, Exclude<o[k_1], undefined>]; }[o extends List<unknown> ? keyof o & number : keyof o] extends infer T ? { [k in keyof T]: { [k_1 in keyof o]-?: [k_1, Exclude<o[k_1], undefined>]; }[o extends List<unknown> ? keyof o & number : keyof o][k]; } : never)[];
|
|
41
41
|
/** Mimics the result of Object.keys(...) */
|
|
42
42
|
export type objectKeysOf<o> = [o] extends [object] ? o extends readonly unknown[] ? any[] extends o ? `${number}` : keyof o & `${number}` : keyof o extends number ? `${keyof o}` : Exclude<keyof o, symbol> : never;
|
|
43
43
|
export declare const objectKeysOf: <o extends object>(o: o) => objectKeysOf<o>[];
|
package/package.json
CHANGED
|
@@ -1,79 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", {
|
|
3
|
-
value: true
|
|
4
|
-
});
|
|
5
|
-
function _export(target, all) {
|
|
6
|
-
for(var name in all)Object.defineProperty(target, name, {
|
|
7
|
-
enumerable: true,
|
|
8
|
-
get: all[name]
|
|
9
|
-
});
|
|
10
|
-
}
|
|
11
|
-
_export(exports, {
|
|
12
|
-
isLuhnValid: ()=>isLuhnValid,
|
|
13
|
-
validationScope: ()=>validationScope,
|
|
14
|
-
validation: ()=>validation
|
|
15
|
-
});
|
|
16
|
-
const _numericLiteralsTs = require("../utils/numericLiterals.js");
|
|
17
|
-
const _scopeTs = require("./scope.js");
|
|
18
|
-
const isLuhnValid = (creditCardInput)=>{
|
|
19
|
-
const sanitized = creditCardInput.replace(/[- ]+/g, "");
|
|
20
|
-
let sum = 0;
|
|
21
|
-
let digit;
|
|
22
|
-
let tmpNum;
|
|
23
|
-
let shouldDouble;
|
|
24
|
-
for(let i = sanitized.length - 1; i >= 0; i--){
|
|
25
|
-
digit = sanitized.substring(i, i + 1);
|
|
26
|
-
tmpNum = parseInt(digit, 10);
|
|
27
|
-
if (shouldDouble) {
|
|
28
|
-
tmpNum *= 2;
|
|
29
|
-
if (tmpNum >= 10) {
|
|
30
|
-
sum += tmpNum % 10 + 1;
|
|
31
|
-
} else {
|
|
32
|
-
sum += tmpNum;
|
|
33
|
-
}
|
|
34
|
-
} else {
|
|
35
|
-
sum += tmpNum;
|
|
36
|
-
}
|
|
37
|
-
shouldDouble = !shouldDouble;
|
|
38
|
-
}
|
|
39
|
-
return !!(sum % 10 === 0 ? sanitized : false);
|
|
40
|
-
};
|
|
41
|
-
const validationScope = (0, _scopeTs.scope)({
|
|
42
|
-
// Character sets
|
|
43
|
-
alpha: /^[A-Za-z]*$/,
|
|
44
|
-
alphanumeric: /^[A-Za-z\d]*$/,
|
|
45
|
-
lowercase: /^[a-z]*$/,
|
|
46
|
-
uppercase: /^[A-Z]*$/,
|
|
47
|
-
// https://github.com/validatorjs/validator.js
|
|
48
|
-
creditCard: [
|
|
49
|
-
/^(?:4[0-9]{12}(?:[0-9]{3,6})?|5[1-5][0-9]{14}|(222[1-9]|22[3-9][0-9]|2[3-6][0-9]{2}|27[01][0-9]|2720)[0-9]{12}|6(?:011|5[0-9][0-9])[0-9]{12,15}|3[47][0-9]{13}|3(?:0[0-5]|[68][0-9])[0-9]{11}|(?:2131|1800|35\d{3})\d{11}|6[27][0-9]{14}|^(81[0-9]{14,17}))$/,
|
|
50
|
-
"=>",
|
|
51
|
-
(s, problems)=>isLuhnValid(s) || !problems.add("mustBe", "a valid credit card number")
|
|
52
|
-
],
|
|
53
|
-
// https://www.regular-expressions.info
|
|
54
|
-
email: /^[A-Za-z0-9._%+-]+@[A-Za-z0-9.-]+\.[A-Za-z]{2,}$/,
|
|
55
|
-
// https://github.com/validatorjs/validator.js
|
|
56
|
-
uuid: /^[0-9A-Fa-f]{8}-[0-9A-Fa-f]{4}-[0-9A-Fa-f]{4}-[0-9A-Fa-f]{4}-[0-9A-Fa-f]{12}$/,
|
|
57
|
-
parsedNumber: [
|
|
58
|
-
_numericLiteralsTs.wellFormedNumberMatcher,
|
|
59
|
-
"|>",
|
|
60
|
-
(s)=>parseFloat(s)
|
|
61
|
-
],
|
|
62
|
-
parsedInteger: [
|
|
63
|
-
_numericLiteralsTs.wellFormedIntegerMatcher,
|
|
64
|
-
"|>",
|
|
65
|
-
(s)=>parseInt(s)
|
|
66
|
-
],
|
|
67
|
-
integer: [
|
|
68
|
-
"node",
|
|
69
|
-
{
|
|
70
|
-
number: {
|
|
71
|
-
divisor: 1
|
|
72
|
-
}
|
|
73
|
-
}
|
|
74
|
-
]
|
|
75
|
-
}, {
|
|
76
|
-
name: "validation",
|
|
77
|
-
standard: false
|
|
78
|
-
});
|
|
79
|
-
const validation = validationScope.compile();
|
|
@@ -1,66 +0,0 @@
|
|
|
1
|
-
import { wellFormedIntegerMatcher, wellFormedNumberMatcher } from "../utils/numericLiterals.js";
|
|
2
|
-
import { scope } from "./scope.js";
|
|
3
|
-
// https://github.com/validatorjs/validator.js
|
|
4
|
-
export const isLuhnValid = (creditCardInput)=>{
|
|
5
|
-
const sanitized = creditCardInput.replace(/[- ]+/g, "");
|
|
6
|
-
let sum = 0;
|
|
7
|
-
let digit;
|
|
8
|
-
let tmpNum;
|
|
9
|
-
let shouldDouble;
|
|
10
|
-
for(let i = sanitized.length - 1; i >= 0; i--){
|
|
11
|
-
digit = sanitized.substring(i, i + 1);
|
|
12
|
-
tmpNum = parseInt(digit, 10);
|
|
13
|
-
if (shouldDouble) {
|
|
14
|
-
tmpNum *= 2;
|
|
15
|
-
if (tmpNum >= 10) {
|
|
16
|
-
sum += tmpNum % 10 + 1;
|
|
17
|
-
} else {
|
|
18
|
-
sum += tmpNum;
|
|
19
|
-
}
|
|
20
|
-
} else {
|
|
21
|
-
sum += tmpNum;
|
|
22
|
-
}
|
|
23
|
-
shouldDouble = !shouldDouble;
|
|
24
|
-
}
|
|
25
|
-
return !!(sum % 10 === 0 ? sanitized : false);
|
|
26
|
-
};
|
|
27
|
-
// Non-trivial expressions should have an explanation or attribution
|
|
28
|
-
export const validationScope = scope({
|
|
29
|
-
// Character sets
|
|
30
|
-
alpha: /^[A-Za-z]*$/,
|
|
31
|
-
alphanumeric: /^[A-Za-z\d]*$/,
|
|
32
|
-
lowercase: /^[a-z]*$/,
|
|
33
|
-
uppercase: /^[A-Z]*$/,
|
|
34
|
-
// https://github.com/validatorjs/validator.js
|
|
35
|
-
creditCard: [
|
|
36
|
-
/^(?:4[0-9]{12}(?:[0-9]{3,6})?|5[1-5][0-9]{14}|(222[1-9]|22[3-9][0-9]|2[3-6][0-9]{2}|27[01][0-9]|2720)[0-9]{12}|6(?:011|5[0-9][0-9])[0-9]{12,15}|3[47][0-9]{13}|3(?:0[0-5]|[68][0-9])[0-9]{11}|(?:2131|1800|35\d{3})\d{11}|6[27][0-9]{14}|^(81[0-9]{14,17}))$/,
|
|
37
|
-
"=>",
|
|
38
|
-
(s, problems)=>isLuhnValid(s) || !problems.add("mustBe", "a valid credit card number")
|
|
39
|
-
],
|
|
40
|
-
// https://www.regular-expressions.info
|
|
41
|
-
email: /^[A-Za-z0-9._%+-]+@[A-Za-z0-9.-]+\.[A-Za-z]{2,}$/,
|
|
42
|
-
// https://github.com/validatorjs/validator.js
|
|
43
|
-
uuid: /^[0-9A-Fa-f]{8}-[0-9A-Fa-f]{4}-[0-9A-Fa-f]{4}-[0-9A-Fa-f]{4}-[0-9A-Fa-f]{12}$/,
|
|
44
|
-
parsedNumber: [
|
|
45
|
-
wellFormedNumberMatcher,
|
|
46
|
-
"|>",
|
|
47
|
-
(s)=>parseFloat(s)
|
|
48
|
-
],
|
|
49
|
-
parsedInteger: [
|
|
50
|
-
wellFormedIntegerMatcher,
|
|
51
|
-
"|>",
|
|
52
|
-
(s)=>parseInt(s)
|
|
53
|
-
],
|
|
54
|
-
integer: [
|
|
55
|
-
"node",
|
|
56
|
-
{
|
|
57
|
-
number: {
|
|
58
|
-
divisor: 1
|
|
59
|
-
}
|
|
60
|
-
}
|
|
61
|
-
]
|
|
62
|
-
}, {
|
|
63
|
-
name: "validation",
|
|
64
|
-
standard: false
|
|
65
|
-
});
|
|
66
|
-
export const validation = validationScope.compile();
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
export declare const isLuhnValid: (creditCardInput: string) => boolean;
|
|
2
|
-
export declare const validationScope: import("./scope.js").Scope<[{
|
|
3
|
-
alpha: string;
|
|
4
|
-
alphanumeric: string;
|
|
5
|
-
lowercase: string;
|
|
6
|
-
uppercase: string;
|
|
7
|
-
creditCard: string;
|
|
8
|
-
email: string;
|
|
9
|
-
uuid: string;
|
|
10
|
-
parsedNumber: (In: string) => import("../parse/ast/morph.js").Out<number>;
|
|
11
|
-
parsedInteger: (In: string) => import("../parse/ast/morph.js").Out<number>;
|
|
12
|
-
integer: number;
|
|
13
|
-
}, {}, false]>;
|
|
14
|
-
export declare const validation: import("./scope.js").Space<{
|
|
15
|
-
alpha: string;
|
|
16
|
-
alphanumeric: string;
|
|
17
|
-
lowercase: string;
|
|
18
|
-
uppercase: string;
|
|
19
|
-
creditCard: string;
|
|
20
|
-
email: string;
|
|
21
|
-
uuid: string;
|
|
22
|
-
parsedNumber: (In: string) => import("../parse/ast/morph.js").Out<number>;
|
|
23
|
-
parsedInteger: (In: string) => import("../parse/ast/morph.js").Out<number>;
|
|
24
|
-
integer: number;
|
|
25
|
-
}>;
|