@sinclair/typebox 0.34.31 → 0.34.32

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.
@@ -1,715 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", { value: true });
4
- exports.Module = void 0;
5
- const index_1 = require("../parser/index");
6
- const t = require("../type/index");
7
- // ------------------------------------------------------------------
8
- // Tokens
9
- // ------------------------------------------------------------------
10
- const Newline = '\n';
11
- const LBracket = '[';
12
- const RBracket = ']';
13
- const LParen = '(';
14
- const RParen = ')';
15
- const LBrace = '{';
16
- const RBrace = '}';
17
- const LAngle = '<';
18
- const RAngle = '>';
19
- const Question = '?';
20
- const Colon = ':';
21
- const Comma = ',';
22
- const SemiColon = ';';
23
- const SingleQuote = "'";
24
- const DoubleQuote = '"';
25
- const Tilde = '`';
26
- const Equals = '=';
27
- // ------------------------------------------------------------------
28
- // DestructureRight
29
- // ------------------------------------------------------------------
30
- // prettier-ignore
31
- function DestructureRight(values) {
32
- return (values.length > 0)
33
- ? [values.slice(0, values.length - 1), values[values.length - 1]]
34
- : [values, undefined];
35
- }
36
- // ------------------------------------------------------------------
37
- // Delimit
38
- // ------------------------------------------------------------------
39
- // prettier-ignore
40
- const DelimitHeadMapping = (results) => results.reduce((result, value) => {
41
- const [element, _delimiter] = value;
42
- return [...result, element];
43
- }, []);
44
- // prettier-ignore
45
- const DelimitHead = (element, delimiter) => (index_1.Runtime.Array(index_1.Runtime.Tuple([element, delimiter]), DelimitHeadMapping));
46
- // prettier-ignore
47
- const DelimitTail = (element) => index_1.Runtime.Union([
48
- index_1.Runtime.Tuple([element]),
49
- index_1.Runtime.Tuple([]),
50
- ]);
51
- // prettier-ignore
52
- const DelimitMapping = (results) => {
53
- return [...results[0], ...results[1]];
54
- };
55
- // prettier-ignore
56
- const Delimit = (element, delimiter) => index_1.Runtime.Tuple([
57
- DelimitHead(element, delimiter),
58
- DelimitTail(element),
59
- ], DelimitMapping);
60
- // ------------------------------------------------------------------
61
- // Dereference
62
- // ------------------------------------------------------------------
63
- const Dereference = (context, key) => {
64
- return key in context ? context[key] : t.Ref(key);
65
- };
66
- // ------------------------------------------------------------------
67
- // GenericArgumentsList
68
- // ------------------------------------------------------------------
69
- // prettier-ignore
70
- const GenericArgumentsList = Delimit(index_1.Runtime.Ident(), index_1.Runtime.Const(Comma));
71
- // ------------------------------------------------------------------
72
- // GenericArguments
73
- // ------------------------------------------------------------------
74
- // prettier-ignore
75
- const GenericArgumentsContext = (args, context) => {
76
- return args.reduce((result, arg, index) => {
77
- return { ...result, [arg]: t.Argument(index) };
78
- }, context);
79
- };
80
- // prettier-ignore
81
- const GenericArgumentsMapping = (results, context) => {
82
- return results.length === 3
83
- ? GenericArgumentsContext(results[1], context)
84
- : {};
85
- };
86
- // prettier-ignore
87
- const GenericArguments = index_1.Runtime.Tuple([
88
- index_1.Runtime.Const(LAngle),
89
- index_1.Runtime.Ref('GenericArgumentsList'),
90
- index_1.Runtime.Const(RAngle),
91
- ], (results, context) => GenericArgumentsMapping(results, context));
92
- // ------------------------------------------------------------------
93
- // GenericReference
94
- // ------------------------------------------------------------------
95
- function GenericReferenceMapping(results, context) {
96
- const type = Dereference(context, results[0]);
97
- const args = results[2];
98
- return t.Instantiate(type, args);
99
- }
100
- const GenericReferenceParameters = Delimit(index_1.Runtime.Ref('Type'), index_1.Runtime.Const(Comma));
101
- // prettier-ignore
102
- const GenericReference = index_1.Runtime.Tuple([
103
- index_1.Runtime.Ident(),
104
- index_1.Runtime.Const(LAngle),
105
- index_1.Runtime.Ref('GenericReferenceParameters'),
106
- index_1.Runtime.Const(RAngle)
107
- ], (results, context) => GenericReferenceMapping(results, context));
108
- // ------------------------------------------------------------------
109
- // Reference
110
- // ------------------------------------------------------------------
111
- function ReferenceMapping(result, context) {
112
- const target = Dereference(context, result);
113
- return target;
114
- }
115
- // prettier-ignore
116
- const Reference = index_1.Runtime.Ident((result, context) => ReferenceMapping(result, context));
117
- // ------------------------------------------------------------------
118
- // Literal
119
- // ------------------------------------------------------------------
120
- // prettier-ignore
121
- const Literal = index_1.Runtime.Union([
122
- index_1.Runtime.Union([index_1.Runtime.Const('true'), index_1.Runtime.Const('false')], value => t.Literal(value === 'true')),
123
- index_1.Runtime.Number(value => t.Literal(parseFloat(value))),
124
- index_1.Runtime.String([SingleQuote, DoubleQuote, Tilde], value => t.Literal(value))
125
- ]);
126
- // ------------------------------------------------------------------
127
- // Keyword
128
- // ------------------------------------------------------------------
129
- // prettier-ignore
130
- const Keyword = index_1.Runtime.Union([
131
- index_1.Runtime.Const('string', index_1.Runtime.As(t.String())),
132
- index_1.Runtime.Const('number', index_1.Runtime.As(t.Number())),
133
- index_1.Runtime.Const('boolean', index_1.Runtime.As(t.Boolean())),
134
- index_1.Runtime.Const('undefined', index_1.Runtime.As(t.Undefined())),
135
- index_1.Runtime.Const('null', index_1.Runtime.As(t.Null())),
136
- index_1.Runtime.Const('integer', index_1.Runtime.As(t.Integer())),
137
- index_1.Runtime.Const('bigint', index_1.Runtime.As(t.BigInt())),
138
- index_1.Runtime.Const('unknown', index_1.Runtime.As(t.Unknown())),
139
- index_1.Runtime.Const('any', index_1.Runtime.As(t.Any())),
140
- index_1.Runtime.Const('never', index_1.Runtime.As(t.Never())),
141
- index_1.Runtime.Const('symbol', index_1.Runtime.As(t.Symbol())),
142
- index_1.Runtime.Const('void', index_1.Runtime.As(t.Void())),
143
- ]);
144
- // ------------------------------------------------------------------
145
- // KeyOf
146
- // ------------------------------------------------------------------
147
- // prettier-ignore
148
- const KeyOfMapping = (values) => (values.length > 0);
149
- // prettier-ignore
150
- const KeyOf = index_1.Runtime.Union([
151
- index_1.Runtime.Tuple([index_1.Runtime.Const('keyof')]), index_1.Runtime.Tuple([])
152
- ], KeyOfMapping);
153
- // ------------------------------------------------------------------
154
- // IndexArray
155
- // ------------------------------------------------------------------
156
- // prettier-ignore
157
- const IndexArrayMapping = (results) => {
158
- return results.reduce((result, current) => {
159
- return current.length === 3
160
- ? [...result, [current[1]]]
161
- : [...result, []];
162
- }, []);
163
- };
164
- // prettier-ignore
165
- const IndexArray = index_1.Runtime.Array(index_1.Runtime.Union([
166
- index_1.Runtime.Tuple([index_1.Runtime.Const(LBracket), index_1.Runtime.Ref('Type'), index_1.Runtime.Const(RBracket)]),
167
- index_1.Runtime.Tuple([index_1.Runtime.Const(LBracket), index_1.Runtime.Const(RBracket)]),
168
- ]), IndexArrayMapping);
169
- // ------------------------------------------------------------------
170
- // Extends
171
- // ------------------------------------------------------------------
172
- // prettier-ignore
173
- const ExtendsMapping = (values) => {
174
- return values.length === 6
175
- ? [values[1], values[3], values[5]]
176
- : [];
177
- };
178
- // prettier-ignore
179
- const Extends = index_1.Runtime.Union([
180
- index_1.Runtime.Tuple([index_1.Runtime.Const('extends'), index_1.Runtime.Ref('Type'), index_1.Runtime.Const(Question), index_1.Runtime.Ref('Type'), index_1.Runtime.Const(Colon), index_1.Runtime.Ref('Type')]),
181
- index_1.Runtime.Tuple([])
182
- ], ExtendsMapping);
183
- // ------------------------------------------------------------------
184
- // Base
185
- // ------------------------------------------------------------------
186
- // prettier-ignore
187
- const BaseMapping = (value) => {
188
- return t.ValueGuard.IsArray(value) && value.length === 3
189
- ? value[1]
190
- : value;
191
- };
192
- // prettier-ignore
193
- const Base = index_1.Runtime.Union([
194
- index_1.Runtime.Tuple([index_1.Runtime.Const(LParen), index_1.Runtime.Ref('Type'), index_1.Runtime.Const(RParen)]),
195
- index_1.Runtime.Ref('Keyword'),
196
- index_1.Runtime.Ref('Object'),
197
- index_1.Runtime.Ref('Tuple'),
198
- index_1.Runtime.Ref('Literal'),
199
- index_1.Runtime.Ref('Constructor'),
200
- index_1.Runtime.Ref('Function'),
201
- index_1.Runtime.Ref('Mapped'),
202
- index_1.Runtime.Ref('AsyncIterator'),
203
- index_1.Runtime.Ref('Iterator'),
204
- index_1.Runtime.Ref('ConstructorParameters'),
205
- index_1.Runtime.Ref('FunctionParameters'),
206
- index_1.Runtime.Ref('InstanceType'),
207
- index_1.Runtime.Ref('ReturnType'),
208
- index_1.Runtime.Ref('Argument'),
209
- index_1.Runtime.Ref('Awaited'),
210
- index_1.Runtime.Ref('Array'),
211
- index_1.Runtime.Ref('Record'),
212
- index_1.Runtime.Ref('Promise'),
213
- index_1.Runtime.Ref('Partial'),
214
- index_1.Runtime.Ref('Required'),
215
- index_1.Runtime.Ref('Pick'),
216
- index_1.Runtime.Ref('Omit'),
217
- index_1.Runtime.Ref('Exclude'),
218
- index_1.Runtime.Ref('Extract'),
219
- index_1.Runtime.Ref('Uppercase'),
220
- index_1.Runtime.Ref('Lowercase'),
221
- index_1.Runtime.Ref('Capitalize'),
222
- index_1.Runtime.Ref('Uncapitalize'),
223
- index_1.Runtime.Ref('Date'),
224
- index_1.Runtime.Ref('Uint8Array'),
225
- index_1.Runtime.Ref('GenericReference'),
226
- index_1.Runtime.Ref('Reference')
227
- ], BaseMapping);
228
- // ------------------------------------------------------------------
229
- // Factor
230
- // ------------------------------------------------------------------
231
- // prettier-ignore
232
- const FactorExtends = (Type, Extends) => {
233
- return Extends.length === 3
234
- ? t.Extends(Type, Extends[0], Extends[1], Extends[2])
235
- : Type;
236
- };
237
- // prettier-ignore
238
- const FactorIndexArray = (Type, IndexArray) => {
239
- const [Left, Right] = DestructureRight(IndexArray);
240
- return (!t.ValueGuard.IsUndefined(Right) ? (
241
- // note: Indexed types require reimplementation to replace `[number]` indexers
242
- Right.length === 1 ? t.Index(FactorIndexArray(Type, Left), Right[0]) :
243
- Right.length === 0 ? t.Array(FactorIndexArray(Type, Left)) :
244
- t.Never()) : Type);
245
- };
246
- // prettier-ignore
247
- const FactorMapping = (KeyOf, Type, IndexArray, Extends) => {
248
- return KeyOf
249
- ? FactorExtends(t.KeyOf(FactorIndexArray(Type, IndexArray)), Extends)
250
- : FactorExtends(FactorIndexArray(Type, IndexArray), Extends);
251
- };
252
- // prettier-ignore
253
- const Factor = index_1.Runtime.Tuple([
254
- index_1.Runtime.Ref('KeyOf'),
255
- index_1.Runtime.Ref('Base'),
256
- index_1.Runtime.Ref('IndexArray'),
257
- index_1.Runtime.Ref('Extends')
258
- ], results => FactorMapping(...results));
259
- // ------------------------------------------------------------------
260
- // Expr
261
- // ------------------------------------------------------------------
262
- // prettier-ignore
263
- function ExprBinaryMapping(Left, Rest) {
264
- return (Rest.length === 3 ? (() => {
265
- const [Operator, Right, Next] = Rest;
266
- const Schema = ExprBinaryMapping(Right, Next);
267
- if (Operator === '&') {
268
- return t.TypeGuard.IsIntersect(Schema)
269
- ? t.Intersect([Left, ...Schema.allOf])
270
- : t.Intersect([Left, Schema]);
271
- }
272
- if (Operator === '|') {
273
- return t.TypeGuard.IsUnion(Schema)
274
- ? t.Union([Left, ...Schema.anyOf])
275
- : t.Union([Left, Schema]);
276
- }
277
- throw 1;
278
- })() : Left);
279
- }
280
- // prettier-ignore
281
- const ExprTermTail = index_1.Runtime.Union([
282
- index_1.Runtime.Tuple([index_1.Runtime.Const('&'), index_1.Runtime.Ref('Factor'), index_1.Runtime.Ref('ExprTermTail')]),
283
- index_1.Runtime.Tuple([])
284
- ]);
285
- // prettier-ignore
286
- const ExprTerm = index_1.Runtime.Tuple([
287
- index_1.Runtime.Ref('Factor'), index_1.Runtime.Ref('ExprTermTail')
288
- ], results => ExprBinaryMapping(...results));
289
- // prettier-ignore
290
- const ExprTail = index_1.Runtime.Union([
291
- index_1.Runtime.Tuple([index_1.Runtime.Const('|'), index_1.Runtime.Ref('ExprTerm'), index_1.Runtime.Ref('ExprTail')]),
292
- index_1.Runtime.Tuple([])
293
- ]);
294
- // prettier-ignore
295
- const Expr = index_1.Runtime.Tuple([
296
- index_1.Runtime.Ref('ExprTerm'), index_1.Runtime.Ref('ExprTail')
297
- ], results => ExprBinaryMapping(...results));
298
- // ------------------------------------------------------------------
299
- // Type
300
- // ------------------------------------------------------------------
301
- // prettier-ignore
302
- const Type = index_1.Runtime.Union([
303
- index_1.Runtime.Context(index_1.Runtime.Ref('GenericArguments'), index_1.Runtime.Ref('Expr')),
304
- index_1.Runtime.Ref('Expr')
305
- ]);
306
- // ------------------------------------------------------------------
307
- // Property
308
- // ------------------------------------------------------------------
309
- const PropertyKey = index_1.Runtime.Union([index_1.Runtime.Ident(), index_1.Runtime.String([SingleQuote, DoubleQuote])]);
310
- const Readonly = index_1.Runtime.Union([index_1.Runtime.Tuple([index_1.Runtime.Const('readonly')]), index_1.Runtime.Tuple([])], (value) => value.length > 0);
311
- const Optional = index_1.Runtime.Union([index_1.Runtime.Tuple([index_1.Runtime.Const(Question)]), index_1.Runtime.Tuple([])], (value) => value.length > 0);
312
- // prettier-ignore
313
- const PropertyMapping = (IsReadonly, Key, IsOptional, _, Type) => ({
314
- [Key]: (IsReadonly && IsOptional ? t.ReadonlyOptional(Type) :
315
- IsReadonly && !IsOptional ? t.Readonly(Type) :
316
- !IsReadonly && IsOptional ? t.Optional(Type) :
317
- Type)
318
- });
319
- // prettier-ignore
320
- const Property = index_1.Runtime.Tuple([
321
- index_1.Runtime.Ref('Readonly'),
322
- index_1.Runtime.Ref('PropertyKey'),
323
- index_1.Runtime.Ref('Optional'),
324
- index_1.Runtime.Const(Colon),
325
- index_1.Runtime.Ref('Type'),
326
- ], results => PropertyMapping(...results));
327
- // ------------------------------------------------------------------
328
- // PropertyDelimiter
329
- // ------------------------------------------------------------------
330
- // prettier-ignore
331
- const PropertyDelimiter = index_1.Runtime.Union([
332
- index_1.Runtime.Tuple([index_1.Runtime.Const(Comma), index_1.Runtime.Const(Newline)]),
333
- index_1.Runtime.Tuple([index_1.Runtime.Const(SemiColon), index_1.Runtime.Const(Newline)]),
334
- index_1.Runtime.Tuple([index_1.Runtime.Const(Comma)]),
335
- index_1.Runtime.Tuple([index_1.Runtime.Const(SemiColon)]),
336
- index_1.Runtime.Tuple([index_1.Runtime.Const(Newline)]),
337
- ]);
338
- // ------------------------------------------------------------------
339
- // PropertyList
340
- // ------------------------------------------------------------------
341
- const PropertyList = Delimit(index_1.Runtime.Ref('Property'), index_1.Runtime.Ref('PropertyDelimiter'));
342
- // ------------------------------------------------------------------
343
- // Object
344
- // ------------------------------------------------------------------
345
- // prettier-ignore
346
- const ObjectMapping = (results) => {
347
- const propertyList = results[1];
348
- return t.Object(propertyList.reduce((result, property) => {
349
- return { ...result, ...property };
350
- }, {}));
351
- };
352
- // prettier-ignore
353
- const _Object = index_1.Runtime.Tuple([
354
- index_1.Runtime.Const(LBrace),
355
- index_1.Runtime.Ref('PropertyList'),
356
- index_1.Runtime.Const(RBrace)
357
- ], ObjectMapping);
358
- // ------------------------------------------------------------------
359
- // ElementList
360
- // ------------------------------------------------------------------
361
- const ElementList = Delimit(index_1.Runtime.Ref('Type'), index_1.Runtime.Const(Comma));
362
- // ------------------------------------------------------------------
363
- // Tuple
364
- // ------------------------------------------------------------------
365
- // prettier-ignore
366
- const Tuple = index_1.Runtime.Tuple([
367
- index_1.Runtime.Const(LBracket),
368
- index_1.Runtime.Ref('ElementList'),
369
- index_1.Runtime.Const(RBracket)
370
- ], results => t.Tuple(results[1]));
371
- // ------------------------------------------------------------------
372
- // Parameters
373
- // ------------------------------------------------------------------
374
- // prettier-ignore
375
- const Parameter = index_1.Runtime.Tuple([
376
- index_1.Runtime.Ident(), index_1.Runtime.Const(Colon), index_1.Runtime.Ref('Type')
377
- ], results => results[2]);
378
- // ------------------------------------------------------------------
379
- // ParameterList
380
- // ------------------------------------------------------------------
381
- const ParameterList = Delimit(index_1.Runtime.Ref('Parameter'), index_1.Runtime.Const(Comma));
382
- // ------------------------------------------------------------------
383
- // Constructor
384
- // ------------------------------------------------------------------
385
- // prettier-ignore
386
- const Constructor = index_1.Runtime.Tuple([
387
- index_1.Runtime.Const('new'),
388
- index_1.Runtime.Const(LParen),
389
- index_1.Runtime.Ref('ParameterList'),
390
- index_1.Runtime.Const(RParen),
391
- index_1.Runtime.Const('=>'),
392
- index_1.Runtime.Ref('Type')
393
- ], results => t.Constructor(results[2], results[5]));
394
- // ------------------------------------------------------------------
395
- // Function
396
- // ------------------------------------------------------------------
397
- // prettier-ignore
398
- const Function = index_1.Runtime.Tuple([
399
- index_1.Runtime.Const(LParen),
400
- index_1.Runtime.Ref('ParameterList'),
401
- index_1.Runtime.Const(RParen),
402
- index_1.Runtime.Const('=>'),
403
- index_1.Runtime.Ref('Type')
404
- ], results => t.Function(results[1], results[4]));
405
- // ------------------------------------------------------------------
406
- // Mapped (requires deferred types)
407
- // ------------------------------------------------------------------
408
- // prettier-ignore
409
- const MappedMapping = (results) => {
410
- return t.Literal('Mapped types not supported');
411
- };
412
- // prettier-ignore
413
- const Mapped = index_1.Runtime.Tuple([
414
- index_1.Runtime.Const(LBrace),
415
- index_1.Runtime.Const(LBracket),
416
- index_1.Runtime.Ident(),
417
- index_1.Runtime.Const('in'),
418
- index_1.Runtime.Ref('Type'),
419
- index_1.Runtime.Const(RBracket),
420
- index_1.Runtime.Const(Colon),
421
- index_1.Runtime.Ref('Type'),
422
- index_1.Runtime.Const(RBrace)
423
- ], MappedMapping);
424
- // ------------------------------------------------------------------
425
- // AsyncIterator
426
- // ------------------------------------------------------------------
427
- // prettier-ignore
428
- const AsyncIterator = index_1.Runtime.Tuple([
429
- index_1.Runtime.Const('AsyncIterator'),
430
- index_1.Runtime.Const(LAngle),
431
- index_1.Runtime.Ref('Type'),
432
- index_1.Runtime.Const(RAngle),
433
- ], results => t.AsyncIterator(results[2]));
434
- // ------------------------------------------------------------------
435
- // Iterator
436
- // ------------------------------------------------------------------
437
- // prettier-ignore
438
- const Iterator = index_1.Runtime.Tuple([
439
- index_1.Runtime.Const('Iterator'),
440
- index_1.Runtime.Const(LAngle),
441
- index_1.Runtime.Ref('Type'),
442
- index_1.Runtime.Const(RAngle),
443
- ], results => t.Iterator(results[2]));
444
- // ------------------------------------------------------------------
445
- // ConstructorParameters
446
- // ------------------------------------------------------------------
447
- // prettier-ignore
448
- const ConstructorParameters = index_1.Runtime.Tuple([
449
- index_1.Runtime.Const('ConstructorParameters'),
450
- index_1.Runtime.Const(LAngle),
451
- index_1.Runtime.Ref('Type'),
452
- index_1.Runtime.Const(RAngle),
453
- ], results => t.ConstructorParameters(results[2]));
454
- // ------------------------------------------------------------------
455
- // Parameters
456
- // ------------------------------------------------------------------
457
- // prettier-ignore
458
- const FunctionParameters = index_1.Runtime.Tuple([
459
- index_1.Runtime.Const('Parameters'),
460
- index_1.Runtime.Const(LAngle),
461
- index_1.Runtime.Ref('Type'),
462
- index_1.Runtime.Const(RAngle),
463
- ], results => t.Parameters(results[2]));
464
- // ------------------------------------------------------------------
465
- // InstanceType
466
- // ------------------------------------------------------------------
467
- // prettier-ignore
468
- const InstanceType = index_1.Runtime.Tuple([
469
- index_1.Runtime.Const('InstanceType'),
470
- index_1.Runtime.Const(LAngle),
471
- index_1.Runtime.Ref('Type'),
472
- index_1.Runtime.Const(RAngle),
473
- ], results => t.InstanceType(results[2]));
474
- // ------------------------------------------------------------------
475
- // ReturnType
476
- // ------------------------------------------------------------------
477
- // prettier-ignore
478
- const ReturnType = index_1.Runtime.Tuple([
479
- index_1.Runtime.Const('ReturnType'),
480
- index_1.Runtime.Const(LAngle),
481
- index_1.Runtime.Ref('Type'),
482
- index_1.Runtime.Const(RAngle),
483
- ], results => t.ReturnType(results[2]));
484
- // ------------------------------------------------------------------
485
- // Argument
486
- // ------------------------------------------------------------------
487
- // prettier-ignore
488
- const Argument = index_1.Runtime.Tuple([
489
- index_1.Runtime.Const('Argument'),
490
- index_1.Runtime.Const(LAngle),
491
- index_1.Runtime.Ref('Type'),
492
- index_1.Runtime.Const(RAngle),
493
- ], results => {
494
- return t.KindGuard.IsLiteralNumber(results[2])
495
- ? t.Argument(Math.trunc(results[2].const))
496
- : t.Never();
497
- });
498
- // ------------------------------------------------------------------
499
- // Awaited
500
- // ------------------------------------------------------------------
501
- // prettier-ignore
502
- const Awaited = index_1.Runtime.Tuple([
503
- index_1.Runtime.Const('Awaited'),
504
- index_1.Runtime.Const(LAngle),
505
- index_1.Runtime.Ref('Type'),
506
- index_1.Runtime.Const(RAngle),
507
- ], results => t.Awaited(results[2]));
508
- // ------------------------------------------------------------------
509
- // Array
510
- // ------------------------------------------------------------------
511
- // prettier-ignore
512
- const Array = index_1.Runtime.Tuple([
513
- index_1.Runtime.Const('Array'),
514
- index_1.Runtime.Const(LAngle),
515
- index_1.Runtime.Ref('Type'),
516
- index_1.Runtime.Const(RAngle),
517
- ], results => t.Array(results[2]));
518
- // ------------------------------------------------------------------
519
- // Record
520
- // ------------------------------------------------------------------
521
- // prettier-ignore
522
- const Record = index_1.Runtime.Tuple([
523
- index_1.Runtime.Const('Record'),
524
- index_1.Runtime.Const(LAngle),
525
- index_1.Runtime.Ref('Type'),
526
- index_1.Runtime.Const(Comma),
527
- index_1.Runtime.Ref('Type'),
528
- index_1.Runtime.Const(RAngle),
529
- ], results => t.Record(results[2], results[4]));
530
- // ------------------------------------------------------------------
531
- // Promise
532
- // ------------------------------------------------------------------
533
- // prettier-ignore
534
- const Promise = index_1.Runtime.Tuple([
535
- index_1.Runtime.Const('Promise'),
536
- index_1.Runtime.Const(LAngle),
537
- index_1.Runtime.Ref('Type'),
538
- index_1.Runtime.Const(RAngle),
539
- ], results => t.Promise(results[2]));
540
- // ------------------------------------------------------------------
541
- // Partial
542
- // ------------------------------------------------------------------
543
- // prettier-ignore
544
- const Partial = index_1.Runtime.Tuple([
545
- index_1.Runtime.Const('Partial'),
546
- index_1.Runtime.Const(LAngle),
547
- index_1.Runtime.Ref('Type'),
548
- index_1.Runtime.Const(RAngle),
549
- ], results => t.Partial(results[2]));
550
- // ------------------------------------------------------------------
551
- // Required
552
- // ------------------------------------------------------------------
553
- // prettier-ignore
554
- const Required = index_1.Runtime.Tuple([
555
- index_1.Runtime.Const('Required'),
556
- index_1.Runtime.Const(LAngle),
557
- index_1.Runtime.Ref('Type'),
558
- index_1.Runtime.Const(RAngle),
559
- ], results => t.Required(results[2]));
560
- // ------------------------------------------------------------------
561
- // Pick
562
- // ------------------------------------------------------------------
563
- // prettier-ignore
564
- const Pick = index_1.Runtime.Tuple([
565
- index_1.Runtime.Const('Pick'),
566
- index_1.Runtime.Const(LAngle),
567
- index_1.Runtime.Ref('Type'),
568
- index_1.Runtime.Const(Comma),
569
- index_1.Runtime.Ref('Type'),
570
- index_1.Runtime.Const(RAngle),
571
- ], results => t.Pick(results[2], results[4]));
572
- // ------------------------------------------------------------------
573
- // Omit
574
- // ------------------------------------------------------------------
575
- // prettier-ignore
576
- const Omit = index_1.Runtime.Tuple([
577
- index_1.Runtime.Const('Omit'),
578
- index_1.Runtime.Const(LAngle),
579
- index_1.Runtime.Ref('Type'),
580
- index_1.Runtime.Const(Comma),
581
- index_1.Runtime.Ref('Type'),
582
- index_1.Runtime.Const(RAngle),
583
- ], results => t.Omit(results[2], results[4]));
584
- // ------------------------------------------------------------------
585
- // Exclude
586
- // ------------------------------------------------------------------
587
- // prettier-ignore
588
- const Exclude = index_1.Runtime.Tuple([
589
- index_1.Runtime.Const('Exclude'),
590
- index_1.Runtime.Const(LAngle),
591
- index_1.Runtime.Ref('Type'),
592
- index_1.Runtime.Const(Comma),
593
- index_1.Runtime.Ref('Type'),
594
- index_1.Runtime.Const(RAngle),
595
- ], results => t.Exclude(results[2], results[4]));
596
- // ------------------------------------------------------------------
597
- // Extract
598
- // ------------------------------------------------------------------
599
- // prettier-ignore
600
- const Extract = index_1.Runtime.Tuple([
601
- index_1.Runtime.Const('Extract'),
602
- index_1.Runtime.Const(LAngle),
603
- index_1.Runtime.Ref('Type'),
604
- index_1.Runtime.Const(Comma),
605
- index_1.Runtime.Ref('Type'),
606
- index_1.Runtime.Const(RAngle),
607
- ], results => t.Extract(results[2], results[4]));
608
- // ------------------------------------------------------------------
609
- // Uppercase
610
- // ------------------------------------------------------------------
611
- // prettier-ignore
612
- const Uppercase = index_1.Runtime.Tuple([
613
- index_1.Runtime.Const('Uppercase'),
614
- index_1.Runtime.Const(LAngle),
615
- index_1.Runtime.Ref('Type'),
616
- index_1.Runtime.Const(RAngle),
617
- ], results => t.Uppercase(results[2]));
618
- // ------------------------------------------------------------------
619
- // Lowercase
620
- // ------------------------------------------------------------------
621
- // prettier-ignore
622
- const Lowercase = index_1.Runtime.Tuple([
623
- index_1.Runtime.Const('Lowercase'),
624
- index_1.Runtime.Const(LAngle),
625
- index_1.Runtime.Ref('Type'),
626
- index_1.Runtime.Const(RAngle),
627
- ], results => t.Lowercase(results[2]));
628
- // ------------------------------------------------------------------
629
- // Capitalize
630
- // ------------------------------------------------------------------
631
- // prettier-ignore
632
- const Capitalize = index_1.Runtime.Tuple([
633
- index_1.Runtime.Const('Capitalize'),
634
- index_1.Runtime.Const(LAngle),
635
- index_1.Runtime.Ref('Type'),
636
- index_1.Runtime.Const(RAngle),
637
- ], results => t.Capitalize(results[2]));
638
- // ------------------------------------------------------------------
639
- // Uncapitalize
640
- // ------------------------------------------------------------------
641
- // prettier-ignore
642
- const Uncapitalize = index_1.Runtime.Tuple([
643
- index_1.Runtime.Const('Uncapitalize'),
644
- index_1.Runtime.Const(LAngle),
645
- index_1.Runtime.Ref('Type'),
646
- index_1.Runtime.Const(RAngle),
647
- ], results => t.Uncapitalize(results[2]));
648
- // ------------------------------------------------------------------
649
- // Date
650
- // ------------------------------------------------------------------
651
- const Date = index_1.Runtime.Const('Date', index_1.Runtime.As(t.Date()));
652
- // ------------------------------------------------------------------
653
- // Uint8Array
654
- // ------------------------------------------------------------------
655
- const Uint8Array = index_1.Runtime.Const('Uint8Array', index_1.Runtime.As(t.Uint8Array()));
656
- // ------------------------------------------------------------------
657
- // Module
658
- // ------------------------------------------------------------------
659
- // prettier-ignore
660
- exports.Module = new index_1.Runtime.Module({
661
- GenericArgumentsList,
662
- GenericArguments,
663
- Literal,
664
- Keyword,
665
- KeyOf,
666
- IndexArray,
667
- Extends,
668
- Base,
669
- Factor,
670
- ExprTermTail,
671
- ExprTerm,
672
- ExprTail,
673
- Expr,
674
- Type,
675
- PropertyKey,
676
- Readonly,
677
- Optional,
678
- Property,
679
- PropertyDelimiter,
680
- PropertyList,
681
- Object: _Object,
682
- ElementList,
683
- Tuple,
684
- Parameter,
685
- ParameterList,
686
- Function,
687
- Constructor,
688
- Mapped,
689
- AsyncIterator,
690
- Iterator,
691
- Argument,
692
- Awaited,
693
- Array,
694
- Record,
695
- Promise,
696
- ConstructorParameters,
697
- FunctionParameters,
698
- InstanceType,
699
- ReturnType,
700
- Partial,
701
- Required,
702
- Pick,
703
- Omit,
704
- Exclude,
705
- Extract,
706
- Uppercase,
707
- Lowercase,
708
- Capitalize,
709
- Uncapitalize,
710
- Date,
711
- Uint8Array,
712
- GenericReferenceParameters,
713
- GenericReference,
714
- Reference,
715
- });