typebox 1.2.4 → 1.2.6

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.
@@ -12,5 +12,5 @@ export function IsDependencies(schema) {
12
12
  return Guard.HasPropertyKey(schema, 'dependencies')
13
13
  && Guard.IsObject(schema.dependencies)
14
14
  && Object.values(schema.dependencies).every(value => IsSchema(value)
15
- || Guard.IsArray(value) && value.every(value => Guard.IsString(value)));
15
+ || (Guard.IsArray(value) && value.every(value => Guard.IsString(value))));
16
16
  }
@@ -1,12 +1,13 @@
1
1
  import { type TSchemaOptions } from '../types/schema.mjs';
2
2
  import { type TProperties } from '../types/properties.mjs';
3
3
  import { type TDeferred } from '../types/deferred.mjs';
4
- import { type TInstantiate } from '../engine/instantiate.mjs';
4
+ import { type TState } from '../engine/instantiate.mjs';
5
+ import { type TModuleInstantiate } from '../engine/module/instantiate.mjs';
5
6
  /** Creates a deferred Module action. */
6
- export type TModuleDeferred<Context extends TProperties> = (TDeferred<'Module', [Context]>);
7
+ export type TModuleDeferred<Declarations extends TProperties> = (TDeferred<'Module', [Declarations]>);
7
8
  /** Creates a deferred Module action. */
8
- export declare function ModuleDeferred<Context extends TProperties>(context: Context, options?: TSchemaOptions): TModuleDeferred<Context>;
9
- /** Applies a Module transformation action to the embedded property types. */
10
- export type TModule<Context extends TProperties> = (TInstantiate<{}, TModuleDeferred<Context>>);
11
- /** Applies a Module transformation action to the embedded property types. */
12
- export declare function Module<Context extends TProperties>(context: Context, options?: TSchemaOptions): TModule<Context>;
9
+ export declare function ModuleDeferred<Declarations extends TProperties>(declarations: Declarations, options?: TSchemaOptions): TModuleDeferred<Declarations>;
10
+ /** Creates a Module with the given declarations */
11
+ export type TModule<Declarations extends TProperties> = (TModuleInstantiate<{}, TState<[], []>, Declarations>);
12
+ /** Creates a Module with the given declarations */
13
+ export declare function Module<Declarations extends TProperties>(declarations: Declarations, options?: TSchemaOptions): TModule<Declarations>;
@@ -1,12 +1,13 @@
1
1
  // deno-lint-ignore-file ban-types
2
2
  // deno-fmt-ignore-file
3
3
  import { Deferred } from '../types/deferred.mjs';
4
- import { Instantiate } from '../engine/instantiate.mjs';
4
+ import { State } from '../engine/instantiate.mjs';
5
+ import { ModuleInstantiate } from '../engine/module/instantiate.mjs';
5
6
  /** Creates a deferred Module action. */
6
- export function ModuleDeferred(context, options = {}) {
7
- return Deferred('Module', [context], options);
7
+ export function ModuleDeferred(declarations, options = {}) {
8
+ return Deferred('Module', [declarations], options);
8
9
  }
9
- /** Applies a Module transformation action to the embedded property types. */
10
- export function Module(context, options = {}) {
11
- return Instantiate({}, ModuleDeferred(context, options));
10
+ /** Creates a Module with the given declarations */
11
+ export function Module(declarations, options = {}) {
12
+ return ModuleInstantiate({}, State([], []), declarations, options);
12
13
  }
@@ -131,7 +131,7 @@ type TInstantiateDeferred<Context extends TProperties, State extends TState, Act
131
131
  ] extends ['Mapped', [infer Name extends TIdentifier, infer Key extends TSchema, infer As extends TSchema, infer Property extends TSchema]] ? TMappedInstantiate<Context, State, Name, Key, As, Property> : [
132
132
  Action,
133
133
  Parameters
134
- ] extends ['Module', [infer Properties extends TProperties]] ? TModuleInstantiate<Context, State, Properties> : [
134
+ ] extends ['Module', [infer Declarations extends TProperties]] ? TModuleInstantiate<Context, State, Declarations> : [
135
135
  Action,
136
136
  Parameters
137
137
  ] extends ['NonNullable', [infer Type extends TSchema]] ? TNonNullableInstantiate<Context, State, Type> : [
@@ -5,15 +5,15 @@ import { type TState } from '../instantiate.mjs';
5
5
  import { type TCyclicCandidates } from '../cyclic/candidates.mjs';
6
6
  import { type TInstantiateCyclic } from '../cyclic/instantiate.mjs';
7
7
  import { type TInstantiateType } from '../instantiate.mjs';
8
- type TInstantiateCyclics<Context extends TProperties, CyclicKeys extends string[], Result extends TProperties = {
9
- [Key in Extract<keyof Context, CyclicKeys[number]>]: TInstantiateCyclic<Context, Key, Context[Key]>;
8
+ type TInstantiateCyclics<Context extends TProperties, Declarations extends TProperties, CyclicKeys extends string[], DeclarationContext extends TProperties = Memory.TAssign<Context, Declarations>, Result extends TProperties = {
9
+ [Key in Extract<keyof Declarations, CyclicKeys[number]>]: TInstantiateCyclic<DeclarationContext, Key, Declarations[Key]>;
10
10
  }> = Result;
11
- type TInstantiateNonCyclics<Context extends TProperties, CyclicKeys extends string[], Result extends TProperties = {
12
- [Key in Exclude<keyof Context, CyclicKeys[number]>]: TInstantiateType<Context, TState<[], []>, Context[Key]>;
11
+ type TInstantiateNonCyclics<Context extends TProperties, Declarations extends TProperties, CyclicKeys extends string[], DeclarationContext extends TProperties = Memory.TAssign<Context, Declarations>, Result extends TProperties = {
12
+ [Key in Exclude<keyof Declarations, CyclicKeys[number]>]: TInstantiateType<DeclarationContext, TState<[], []>, Declarations[Key]>;
13
13
  }> = Result;
14
- type TInstantiateModule<Context extends TProperties, CyclicCandidates extends string[] = TCyclicCandidates<Context>, InstantiatedCyclics extends TProperties = TInstantiateCyclics<Context, CyclicCandidates>, InstantiatedNonCyclics extends TProperties = TInstantiateNonCyclics<Context, CyclicCandidates>, InstantiatedModule extends TProperties = InstantiatedCyclics & InstantiatedNonCyclics> = {
14
+ type TInstantiateModule<Context extends TProperties, Declarations extends TProperties, CyclicCandidates extends string[] = TCyclicCandidates<Declarations>, InstantiatedCyclics extends TProperties = TInstantiateCyclics<Context, Declarations, CyclicCandidates>, InstantiatedNonCyclics extends TProperties = TInstantiateNonCyclics<Context, Declarations, CyclicCandidates>, InstantiatedModule extends TProperties = InstantiatedCyclics & InstantiatedNonCyclics> = {
15
15
  [Key in keyof InstantiatedModule]: InstantiatedModule[Key];
16
16
  } & {};
17
- export type TModuleInstantiate<Context extends TProperties, _State extends TState, Properties extends TProperties, ModuleContext extends TProperties = Memory.TAssign<Context, Properties>, InstantiatedModule extends TProperties = TInstantiateModule<ModuleContext>> = InstantiatedModule;
18
- export declare function ModuleInstantiate<Context extends TProperties, State extends TState, Properties extends TProperties>(context: Context, _state: State, properties: Properties, options: TSchemaOptions): TModuleInstantiate<Context, State, Properties>;
17
+ export type TModuleInstantiate<Context extends TProperties, _State extends TState, Declarations extends TProperties, InstantiatedModule extends TProperties = TInstantiateModule<Context, Declarations>> = InstantiatedModule;
18
+ export declare function ModuleInstantiate<Context extends TProperties, State extends TState, Declarations extends TProperties>(context: Context, _state: State, declarations: Declarations, options: TSchemaOptions): TModuleInstantiate<Context, State, Declarations>;
19
19
  export {};
@@ -9,27 +9,28 @@ import { State } from '../instantiate.mjs';
9
9
  import { CyclicCandidates } from '../cyclic/candidates.mjs';
10
10
  import { InstantiateCyclic } from '../cyclic/instantiate.mjs';
11
11
  import { InstantiateType } from '../instantiate.mjs';
12
- function InstantiateCyclics(context, cyclicKeys) {
13
- const keys = Guard.Keys(context).filter(key => cyclicKeys.includes(key));
14
- return keys.reduce((result, key) => {
15
- return { ...result, [key]: InstantiateCyclic(context, key, context[key]) };
12
+ function InstantiateCyclics(context, declarations, cyclicKeys) {
13
+ const declarationContext = Memory.Assign(context, declarations);
14
+ const declarationKeys = Guard.Keys(declarations).filter(key => cyclicKeys.includes(key));
15
+ return declarationKeys.reduce((result, key) => {
16
+ return { ...result, [key]: InstantiateCyclic(declarationContext, key, declarations[key]) };
16
17
  }, {});
17
18
  }
18
- function InstantiateNonCyclics(context, cyclicKeys) {
19
- const keys = Guard.Keys(context).filter(key => !cyclicKeys.includes(key));
20
- return keys.reduce((result, key) => {
21
- return { ...result, [key]: InstantiateType(context, State([], []), context[key]) };
19
+ function InstantiateNonCyclics(context, declarations, cyclicKeys) {
20
+ const declarationContext = Memory.Assign(context, declarations);
21
+ const declarationKeys = Guard.Keys(declarations).filter(key => !cyclicKeys.includes(key));
22
+ return declarationKeys.reduce((result, key) => {
23
+ return { ...result, [key]: InstantiateType(declarationContext, State([], []), declarations[key]) };
22
24
  }, {});
23
25
  }
24
- function InstantiateModule(context, options) {
25
- const cyclicCandidates = CyclicCandidates(context);
26
- const instantiatedCyclics = InstantiateCyclics(context, cyclicCandidates);
27
- const instantiatedNonCyclics = InstantiateNonCyclics(context, cyclicCandidates);
26
+ function InstantiateModule(context, declarations, options) {
27
+ const cyclicCandidates = CyclicCandidates(declarations);
28
+ const instantiatedCyclics = InstantiateCyclics(context, declarations, cyclicCandidates);
29
+ const instantiatedNonCyclics = InstantiateNonCyclics(context, declarations, cyclicCandidates);
28
30
  const instantiatedModule = { ...instantiatedCyclics, ...instantiatedNonCyclics };
29
31
  return Memory.Update(instantiatedModule, {}, options);
30
32
  }
31
- export function ModuleInstantiate(context, _state, properties, options) {
32
- const moduleContext = Memory.Assign(context, properties);
33
- const instantiatedModule = InstantiateModule(moduleContext, options);
33
+ export function ModuleInstantiate(context, _state, declarations, options) {
34
+ const instantiatedModule = InstantiateModule(context, declarations, options);
34
35
  return instantiatedModule;
35
36
  }
@@ -159,7 +159,7 @@ export type TExtendsMapping<Input extends [unknown, unknown, unknown, unknown, u
159
159
  export declare function ExtendsMapping(input: [unknown, unknown, unknown, unknown, unknown, unknown] | []): unknown;
160
160
  export type TBaseMapping<Input extends [unknown, unknown, unknown] | unknown> = (Input extends ['(', infer Type extends T.TSchema, ')'] ? Type : Input extends infer Type extends T.TSchema ? Type : never);
161
161
  export declare function BaseMapping(input: [unknown, unknown, unknown] | unknown): unknown;
162
- export type TWithMapping<Input extends [unknown, unknown] | []> = (Input extends ['with', infer JsonObject extends Record<PropertyKey, unknown>] ? JsonObject : []);
162
+ export type TWithMapping<Input extends [unknown, unknown] | []> = (Input extends ['with', infer WithObject extends Record<PropertyKey, unknown>] ? WithObject : []);
163
163
  export declare function WithMapping(input: [unknown, unknown] | []): unknown;
164
164
  type TFactorIndexArray<Type extends T.TSchema, IndexArray extends unknown[]> = (IndexArray extends [infer Left extends T.TSchema[], ...infer Right extends unknown[]] ? (Left extends [infer Indexer extends T.TSchema] ? TFactorIndexArray<S.TIndexDeferred<Type, Indexer>, Right> : Left extends [] ? TFactorIndexArray<T.TArray<Type>, Right> : T.TNever) : Type);
165
165
  type TFactorExtends<Type extends T.TSchema, Extends extends unknown[]> = (Extends extends [infer Right extends T.TSchema, infer True extends T.TSchema, infer False extends T.TSchema] ? S.TConditionalDeferred<Type, Right, True, False> : Type);
@@ -276,31 +276,35 @@ export type T_Mapped_Mapping<Input extends [unknown, unknown, unknown, unknown,
276
276
  export declare function _Mapped_Mapping(input: [unknown, unknown, unknown, unknown, unknown, unknown, unknown, unknown, unknown, unknown, unknown, unknown, unknown]): unknown;
277
277
  export type TReferenceMapping<Input extends string, Result extends T.TSchema = T.TRef<Input>> = Result;
278
278
  export declare function ReferenceMapping(input: string): unknown;
279
- export type TJsonNumberMapping<Input extends string> = (Input extends `${infer Value extends number}` ? Value : never);
280
- export declare function JsonNumberMapping(input: string): unknown;
281
- export type TJsonBooleanMapping<Input extends 'true' | 'false'> = (Input extends 'true' ? true : false);
282
- export declare function JsonBooleanMapping(input: 'true' | 'false'): unknown;
283
- export type TJsonStringMapping<Input extends string> = (Input);
284
- export declare function JsonStringMapping(input: string): unknown;
285
- export type TJsonNullMapping<Input extends 'null'> = (null);
286
- export declare function JsonNullMapping(input: 'null'): unknown;
287
- export type TJsonPropertyMapping<Input extends [unknown, unknown, unknown]> = (Input extends [infer Key extends string, ':', infer Value extends unknown] ? {
279
+ export type TWithBigIntMapping<Input extends string> = (Input extends `${infer Value extends bigint}` ? Value : never);
280
+ export declare function WithBigIntMapping(input: string): unknown;
281
+ export type TWithNumberMapping<Input extends string> = (Input extends `${infer Value extends number}` ? Value : never);
282
+ export declare function WithNumberMapping(input: string): unknown;
283
+ export type TWithBooleanMapping<Input extends 'true' | 'false'> = (Input extends 'true' ? true : false);
284
+ export declare function WithBooleanMapping(input: 'true' | 'false'): unknown;
285
+ export type TWithStringMapping<Input extends string> = (Input);
286
+ export declare function WithStringMapping(input: string): unknown;
287
+ export type TWithNullMapping<Input extends 'null'> = (null);
288
+ export declare function WithNullMapping(input: 'null'): unknown;
289
+ export type TWithUndefinedMapping<Input extends 'undefined'> = undefined;
290
+ export declare function WithUndefinedMapping(input: 'undefined'): unknown;
291
+ export type TWithPropertyMapping<Input extends [unknown, unknown, unknown]> = (Input extends [infer Key extends string, ':', infer Value extends unknown] ? {
288
292
  [_ in Key]: Value;
289
293
  } : never);
290
- export declare function JsonPropertyMapping(input: [unknown, unknown, unknown]): unknown;
291
- export type TJsonPropertyListMapping<Input extends [unknown, unknown]> = (TDelimited<Input>);
292
- export declare function JsonPropertyListMapping(input: [unknown, unknown]): unknown;
293
- type TJsonObjectMappingReduce<PropertyList extends Record<PropertyKey, unknown>[], Result extends Record<PropertyKey, unknown> = {}> = (PropertyList extends [infer Left extends Record<PropertyKey, unknown>, ...infer Right extends Record<PropertyKey, unknown>[]] ? TJsonObjectMappingReduce<Right, Memory.TAssign<Result, Left>> : {
294
+ export declare function WithPropertyMapping(input: [unknown, unknown, unknown]): unknown;
295
+ export type TWithPropertyListMapping<Input extends [unknown, unknown]> = (TDelimited<Input>);
296
+ export declare function WithPropertyListMapping(input: [unknown, unknown]): unknown;
297
+ type TWithObjectMappingReduce<PropertyList extends Record<PropertyKey, unknown>[], Result extends Record<PropertyKey, unknown> = {}> = (PropertyList extends [infer Left extends Record<PropertyKey, unknown>, ...infer Right extends Record<PropertyKey, unknown>[]] ? TWithObjectMappingReduce<Right, Memory.TAssign<Result, Left>> : {
294
298
  [Key in keyof Result]: Result[Key];
295
299
  });
296
- export type TJsonObjectMapping<Input extends [unknown, unknown, unknown]> = (Input extends ['{', infer PropertyList extends Record<PropertyKey, unknown>[], '}'] ? TJsonObjectMappingReduce<PropertyList> : {});
297
- export declare function JsonObjectMapping(input: [unknown, unknown, unknown]): unknown;
298
- export type TJsonElementListMapping<Input extends [unknown, unknown]> = (TDelimited<Input>);
299
- export declare function JsonElementListMapping(input: [unknown, unknown]): unknown;
300
- export type TJsonArrayMapping<Input extends [unknown, unknown, unknown]> = (Input extends ['[', infer Elements extends unknown[], ']'] ? Elements : never);
301
- export declare function JsonArrayMapping(input: [unknown, unknown, unknown]): unknown;
302
- export type TJsonMapping<Input extends unknown> = (Input);
303
- export declare function JsonMapping(input: unknown): unknown;
300
+ export type TWithObjectMapping<Input extends [unknown, unknown, unknown]> = (Input extends ['{', infer PropertyList extends Record<PropertyKey, unknown>[], '}'] ? TWithObjectMappingReduce<PropertyList> : {});
301
+ export declare function WithObjectMapping(input: [unknown, unknown, unknown]): unknown;
302
+ export type TWithElementListMapping<Input extends [unknown, unknown]> = (TDelimited<Input>);
303
+ export declare function WithElementListMapping(input: [unknown, unknown]): unknown;
304
+ export type TWithArrayMapping<Input extends [unknown, unknown, unknown]> = (Input extends ['[', infer Elements extends unknown[], ']'] ? Elements : never);
305
+ export declare function WithArrayMapping(input: [unknown, unknown, unknown]): unknown;
306
+ export type TWithValueMapping<Input extends unknown> = (Input);
307
+ export declare function WithValueMapping(input: unknown): unknown;
304
308
  export type TPatternBigIntMapping<Input extends '-?(?:0|[1-9][0-9]*)n'> = (T.TBigInt);
305
309
  export declare function PatternBigIntMapping(input: '-?(?:0|[1-9][0-9]*)n'): unknown;
306
310
  export type TPatternStringMapping<Input extends '.*'> = (T.TString);
@@ -413,39 +413,45 @@ export function _Mapped_Mapping(input) {
413
413
  export function ReferenceMapping(input) {
414
414
  return T.Ref(input);
415
415
  }
416
- export function JsonNumberMapping(input) {
416
+ export function WithBigIntMapping(input) {
417
+ return BigInt(input);
418
+ }
419
+ export function WithNumberMapping(input) {
417
420
  return parseFloat(input);
418
421
  }
419
- export function JsonBooleanMapping(input) {
422
+ export function WithBooleanMapping(input) {
420
423
  return Guard.IsEqual(input, 'true');
421
424
  }
422
- export function JsonStringMapping(input) {
425
+ export function WithStringMapping(input) {
423
426
  return input;
424
427
  }
425
- export function JsonNullMapping(input) {
428
+ export function WithNullMapping(input) {
426
429
  return null;
427
430
  }
428
- export function JsonPropertyMapping(input) {
431
+ export function WithUndefinedMapping(input) {
432
+ return undefined;
433
+ }
434
+ export function WithPropertyMapping(input) {
429
435
  return { [input[0]]: input[2] };
430
436
  }
431
- export function JsonPropertyListMapping(input) {
437
+ export function WithPropertyListMapping(input) {
432
438
  return Delimited(input);
433
439
  }
434
- function JsonObjectMappingReduce(propertyList) {
440
+ function WithObjectMappingReduce(propertyList) {
435
441
  return propertyList.reduce((result, left) => {
436
442
  return Memory.Assign(result, left);
437
443
  }, {});
438
444
  }
439
- export function JsonObjectMapping(input) {
440
- return JsonObjectMappingReduce(input[1]);
445
+ export function WithObjectMapping(input) {
446
+ return WithObjectMappingReduce(input[1]);
441
447
  }
442
- export function JsonElementListMapping(input) {
448
+ export function WithElementListMapping(input) {
443
449
  return Delimited(input);
444
450
  }
445
- export function JsonArrayMapping(input) {
451
+ export function WithArrayMapping(input) {
446
452
  return input[1];
447
453
  }
448
- export function JsonMapping(input) {
454
+ export function WithValueMapping(input) {
449
455
  return input;
450
456
  }
451
457
  export function PatternBigIntMapping(input) {
@@ -42,7 +42,7 @@ export type TIndexArray_0<Input extends string, Result extends unknown[] = []> =
42
42
  export type TIndexArray<Input extends string> = TIndexArray_0<Input> extends [infer _0 extends ([unknown, unknown, unknown] | [unknown, unknown])[], infer Input extends string] ? [S.TIndexArrayMapping<_0>, Input] : [];
43
43
  export type TExtends<Input extends string> = ((Token.TConst<'extends', Input> extends [infer _0, infer Input extends string] ? (TType<Input> extends [infer _1, infer Input extends string] ? (Token.TConst<'?', Input> extends [infer _2, infer Input extends string] ? (TType<Input> extends [infer _3, infer Input extends string] ? (Token.TConst<':', Input> extends [infer _4, infer Input extends string] ? (TType<Input> extends [infer _5, infer Input extends string] ? [[_0, _1, _2, _3, _4, _5], Input] : []) : []) : []) : []) : []) : []) extends [infer _0, infer Input extends string] ? [_0, Input] : [[], Input] extends [infer _0, infer Input extends string] ? [_0, Input] : []) extends [infer _0 extends [unknown, unknown, unknown, unknown, unknown, unknown] | [], infer Input extends string] ? [S.TExtendsMapping<_0>, Input] : [];
44
44
  export type TBase<Input extends string> = ((Token.TConst<'(', Input> extends [infer _0, infer Input extends string] ? (TType<Input> extends [infer _1, infer Input extends string] ? (Token.TConst<')', Input> extends [infer _2, infer Input extends string] ? [[_0, _1, _2], Input] : []) : []) : []) extends [infer _0, infer Input extends string] ? [_0, Input] : TKeywordString<Input> extends [infer _0, infer Input extends string] ? [_0, Input] : TKeywordNumber<Input> extends [infer _0, infer Input extends string] ? [_0, Input] : TKeywordBoolean<Input> extends [infer _0, infer Input extends string] ? [_0, Input] : TKeywordUndefined<Input> extends [infer _0, infer Input extends string] ? [_0, Input] : TKeywordNull<Input> extends [infer _0, infer Input extends string] ? [_0, Input] : TKeywordInteger<Input> extends [infer _0, infer Input extends string] ? [_0, Input] : TKeywordBigInt<Input> extends [infer _0, infer Input extends string] ? [_0, Input] : TKeywordUnknown<Input> extends [infer _0, infer Input extends string] ? [_0, Input] : TKeywordAny<Input> extends [infer _0, infer Input extends string] ? [_0, Input] : TKeywordObject<Input> extends [infer _0, infer Input extends string] ? [_0, Input] : TKeywordNever<Input> extends [infer _0, infer Input extends string] ? [_0, Input] : TKeywordSymbol<Input> extends [infer _0, infer Input extends string] ? [_0, Input] : TKeywordVoid<Input> extends [infer _0, infer Input extends string] ? [_0, Input] : TKeywordThis<Input> extends [infer _0, infer Input extends string] ? [_0, Input] : TLiteralBigInt<Input> extends [infer _0, infer Input extends string] ? [_0, Input] : TLiteralBoolean<Input> extends [infer _0, infer Input extends string] ? [_0, Input] : TLiteralNumber<Input> extends [infer _0, infer Input extends string] ? [_0, Input] : TLiteralString<Input> extends [infer _0, infer Input extends string] ? [_0, Input] : TTemplateLiteral<Input> extends [infer _0, infer Input extends string] ? [_0, Input] : TDependent<Input> extends [infer _0, infer Input extends string] ? [_0, Input] : T_Object_<Input> extends [infer _0, infer Input extends string] ? [_0, Input] : T_Tuple_<Input> extends [infer _0, infer Input extends string] ? [_0, Input] : T_Constructor_<Input> extends [infer _0, infer Input extends string] ? [_0, Input] : T_Function_<Input> extends [infer _0, infer Input extends string] ? [_0, Input] : T_Mapped_<Input> extends [infer _0, infer Input extends string] ? [_0, Input] : TGenericCall<Input> extends [infer _0, infer Input extends string] ? [_0, Input] : TReference<Input> extends [infer _0, infer Input extends string] ? [_0, Input] : []) extends [infer _0 extends [unknown, unknown, unknown] | unknown, infer Input extends string] ? [S.TBaseMapping<_0>, Input] : [];
45
- export type TWith<Input extends string> = ((Token.TConst<'with', Input> extends [infer _0, infer Input extends string] ? (TJsonObject<Input> extends [infer _1, infer Input extends string] ? [[_0, _1], Input] : []) : []) extends [infer _0, infer Input extends string] ? [_0, Input] : [[], Input] extends [infer _0, infer Input extends string] ? [_0, Input] : []) extends [infer _0 extends [unknown, unknown] | [], infer Input extends string] ? [S.TWithMapping<_0>, Input] : [];
45
+ export type TWith<Input extends string> = ((Token.TConst<'with', Input> extends [infer _0, infer Input extends string] ? (TWithObject<Input> extends [infer _1, infer Input extends string] ? [[_0, _1], Input] : []) : []) extends [infer _0, infer Input extends string] ? [_0, Input] : [[], Input] extends [infer _0, infer Input extends string] ? [_0, Input] : []) extends [infer _0 extends [unknown, unknown] | [], infer Input extends string] ? [S.TWithMapping<_0>, Input] : [];
46
46
  export type TFactor<Input extends string> = (TKeyOf<Input> extends [infer _0, infer Input extends string] ? (TBase<Input> extends [infer _1, infer Input extends string] ? (TIndexArray<Input> extends [infer _2, infer Input extends string] ? (TExtends<Input> extends [infer _3, infer Input extends string] ? (TWith<Input> extends [infer _4, infer Input extends string] ? [[_0, _1, _2, _3, _4], Input] : []) : []) : []) : []) : []) extends [infer _0 extends [unknown, unknown, unknown, unknown, unknown], infer Input extends string] ? [S.TFactorMapping<_0>, Input] : [];
47
47
  export type TExprTermTail<Input extends string> = ((Token.TConst<'&', Input> extends [infer _0, infer Input extends string] ? (TFactor<Input> extends [infer _1, infer Input extends string] ? (TExprTermTail<Input> extends [infer _2, infer Input extends string] ? [[_0, _1, _2], Input] : []) : []) : []) extends [infer _0, infer Input extends string] ? [_0, Input] : [[], Input] extends [infer _0, infer Input extends string] ? [_0, Input] : []) extends [infer _0 extends [unknown, unknown, unknown] | [], infer Input extends string] ? [S.TExprTermTailMapping<_0>, Input] : [];
48
48
  export type TExprTerm<Input extends string> = (TFactor<Input> extends [infer _0, infer Input extends string] ? (TExprTermTail<Input> extends [infer _1, infer Input extends string] ? [[_0, _1], Input] : []) : []) extends [infer _0 extends [unknown, unknown], infer Input extends string] ? [S.TExprTermMapping<_0>, Input] : [];
@@ -90,18 +90,20 @@ export type TMappedOptional<Input extends string> = ((Token.TConst<'+', Input> e
90
90
  export type TMappedAs<Input extends string> = ((Token.TConst<'as', Input> extends [infer _0, infer Input extends string] ? (TType<Input> extends [infer _1, infer Input extends string] ? [[_0, _1], Input] : []) : []) extends [infer _0, infer Input extends string] ? [_0, Input] : [[], Input] extends [infer _0, infer Input extends string] ? [_0, Input] : []) extends [infer _0 extends [unknown, unknown] | [], infer Input extends string] ? [S.TMappedAsMapping<_0>, Input] : [];
91
91
  export type T_Mapped_<Input extends string> = (Token.TConst<'{', Input> extends [infer _0, infer Input extends string] ? (TMappedReadonly<Input> extends [infer _1, infer Input extends string] ? (Token.TConst<'[', Input> extends [infer _2, infer Input extends string] ? (Token.TIdent<Input> extends [infer _3, infer Input extends string] ? (Token.TConst<'in', Input> extends [infer _4, infer Input extends string] ? (TType<Input> extends [infer _5, infer Input extends string] ? (TMappedAs<Input> extends [infer _6, infer Input extends string] ? (Token.TConst<']', Input> extends [infer _7, infer Input extends string] ? (TMappedOptional<Input> extends [infer _8, infer Input extends string] ? (Token.TConst<':', Input> extends [infer _9, infer Input extends string] ? (TType<Input> extends [infer _10, infer Input extends string] ? (TOptionalSemiColon<Input> extends [infer _11, infer Input extends string] ? (Token.TConst<'}', Input> extends [infer _12, infer Input extends string] ? [[_0, _1, _2, _3, _4, _5, _6, _7, _8, _9, _10, _11, _12], Input] : []) : []) : []) : []) : []) : []) : []) : []) : []) : []) : []) : []) : []) extends [infer _0 extends [unknown, unknown, unknown, unknown, unknown, unknown, unknown, unknown, unknown, unknown, unknown, unknown, unknown], infer Input extends string] ? [S.T_Mapped_Mapping<_0>, Input] : [];
92
92
  export type TReference<Input extends string> = Token.TIdent<Input> extends [infer _0 extends string, infer Input extends string] ? [S.TReferenceMapping<_0>, Input] : [];
93
- export type TJsonNumber<Input extends string> = Token.TNumber<Input> extends [infer _0 extends string, infer Input extends string] ? [S.TJsonNumberMapping<_0>, Input] : [];
94
- export type TJsonBoolean<Input extends string> = (Token.TConst<'true', Input> extends [infer _0, infer Input extends string] ? [_0, Input] : Token.TConst<'false', Input> extends [infer _0, infer Input extends string] ? [_0, Input] : []) extends [infer _0 extends 'true' | 'false', infer Input extends string] ? [S.TJsonBooleanMapping<_0>, Input] : [];
95
- export type TJsonString<Input extends string> = Token.TString<['\"', '\''], Input> extends [infer _0 extends string, infer Input extends string] ? [S.TJsonStringMapping<_0>, Input] : [];
96
- export type TJsonNull<Input extends string> = Token.TConst<'null', Input> extends [infer _0 extends 'null', infer Input extends string] ? [S.TJsonNullMapping<_0>, Input] : [];
97
- export type TJsonProperty<Input extends string> = (TPropertyKey<Input> extends [infer _0, infer Input extends string] ? (Token.TConst<':', Input> extends [infer _1, infer Input extends string] ? (TJson<Input> extends [infer _2, infer Input extends string] ? [[_0, _1, _2], Input] : []) : []) : []) extends [infer _0 extends [unknown, unknown, unknown], infer Input extends string] ? [S.TJsonPropertyMapping<_0>, Input] : [];
98
- export type TJsonPropertyList_0<Input extends string, Result extends unknown[] = []> = (TJsonProperty<Input> extends [infer _0, infer Input extends string] ? (TPropertyDelimiter<Input> extends [infer _1, infer Input extends string] ? [[_0, _1], Input] : []) : []) extends [infer _0, infer Input extends string] ? TJsonPropertyList_0<Input, [...Result, _0]> : [Result, Input];
99
- export type TJsonPropertyList<Input extends string> = (TJsonPropertyList_0<Input> extends [infer _0, infer Input extends string] ? (((TJsonProperty<Input> extends [infer _0, infer Input extends string] ? [[_0], Input] : []) extends [infer _0, infer Input extends string] ? [_0, Input] : [[], Input] extends [infer _0, infer Input extends string] ? [_0, Input] : []) extends [infer _1, infer Input extends string] ? [[_0, _1], Input] : []) : []) extends [infer _0 extends [unknown, unknown], infer Input extends string] ? [S.TJsonPropertyListMapping<_0>, Input] : [];
100
- export type TJsonObject<Input extends string> = (Token.TConst<'{', Input> extends [infer _0, infer Input extends string] ? (TJsonPropertyList<Input> extends [infer _1, infer Input extends string] ? (Token.TConst<'}', Input> extends [infer _2, infer Input extends string] ? [[_0, _1, _2], Input] : []) : []) : []) extends [infer _0 extends [unknown, unknown, unknown], infer Input extends string] ? [S.TJsonObjectMapping<_0>, Input] : [];
101
- export type TJsonElementList_0<Input extends string, Result extends unknown[] = []> = (TJson<Input> extends [infer _0, infer Input extends string] ? (Token.TConst<',', Input> extends [infer _1, infer Input extends string] ? [[_0, _1], Input] : []) : []) extends [infer _0, infer Input extends string] ? TJsonElementList_0<Input, [...Result, _0]> : [Result, Input];
102
- export type TJsonElementList<Input extends string> = (TJsonElementList_0<Input> extends [infer _0, infer Input extends string] ? (((TJson<Input> extends [infer _0, infer Input extends string] ? [[_0], Input] : []) extends [infer _0, infer Input extends string] ? [_0, Input] : [[], Input] extends [infer _0, infer Input extends string] ? [_0, Input] : []) extends [infer _1, infer Input extends string] ? [[_0, _1], Input] : []) : []) extends [infer _0 extends [unknown, unknown], infer Input extends string] ? [S.TJsonElementListMapping<_0>, Input] : [];
103
- export type TJsonArray<Input extends string> = (Token.TConst<'[', Input> extends [infer _0, infer Input extends string] ? (TJsonElementList<Input> extends [infer _1, infer Input extends string] ? (Token.TConst<']', Input> extends [infer _2, infer Input extends string] ? [[_0, _1, _2], Input] : []) : []) : []) extends [infer _0 extends [unknown, unknown, unknown], infer Input extends string] ? [S.TJsonArrayMapping<_0>, Input] : [];
104
- export type TJson<Input extends string> = (TJsonNumber<Input> extends [infer _0, infer Input extends string] ? [_0, Input] : TJsonBoolean<Input> extends [infer _0, infer Input extends string] ? [_0, Input] : TJsonString<Input> extends [infer _0, infer Input extends string] ? [_0, Input] : TJsonNull<Input> extends [infer _0, infer Input extends string] ? [_0, Input] : TJsonObject<Input> extends [infer _0, infer Input extends string] ? [_0, Input] : TJsonArray<Input> extends [infer _0, infer Input extends string] ? [_0, Input] : []) extends [infer _0 extends unknown, infer Input extends string] ? [S.TJsonMapping<_0>, Input] : [];
93
+ export type TWithBigInt<Input extends string> = Token.TBigInt<Input> extends [infer _0 extends string, infer Input extends string] ? [S.TWithBigIntMapping<_0>, Input] : [];
94
+ export type TWithNumber<Input extends string> = Token.TNumber<Input> extends [infer _0 extends string, infer Input extends string] ? [S.TWithNumberMapping<_0>, Input] : [];
95
+ export type TWithBoolean<Input extends string> = (Token.TConst<'true', Input> extends [infer _0, infer Input extends string] ? [_0, Input] : Token.TConst<'false', Input> extends [infer _0, infer Input extends string] ? [_0, Input] : []) extends [infer _0 extends 'true' | 'false', infer Input extends string] ? [S.TWithBooleanMapping<_0>, Input] : [];
96
+ export type TWithString<Input extends string> = Token.TString<['\"', '\''], Input> extends [infer _0 extends string, infer Input extends string] ? [S.TWithStringMapping<_0>, Input] : [];
97
+ export type TWithNull<Input extends string> = Token.TConst<'null', Input> extends [infer _0 extends 'null', infer Input extends string] ? [S.TWithNullMapping<_0>, Input] : [];
98
+ export type TWithUndefined<Input extends string> = Token.TConst<'undefined', Input> extends [infer _0 extends 'undefined', infer Input extends string] ? [S.TWithUndefinedMapping<_0>, Input] : [];
99
+ export type TWithProperty<Input extends string> = (TPropertyKey<Input> extends [infer _0, infer Input extends string] ? (Token.TConst<':', Input> extends [infer _1, infer Input extends string] ? (TWithValue<Input> extends [infer _2, infer Input extends string] ? [[_0, _1, _2], Input] : []) : []) : []) extends [infer _0 extends [unknown, unknown, unknown], infer Input extends string] ? [S.TWithPropertyMapping<_0>, Input] : [];
100
+ export type TWithPropertyList_0<Input extends string, Result extends unknown[] = []> = (TWithProperty<Input> extends [infer _0, infer Input extends string] ? (TPropertyDelimiter<Input> extends [infer _1, infer Input extends string] ? [[_0, _1], Input] : []) : []) extends [infer _0, infer Input extends string] ? TWithPropertyList_0<Input, [...Result, _0]> : [Result, Input];
101
+ export type TWithPropertyList<Input extends string> = (TWithPropertyList_0<Input> extends [infer _0, infer Input extends string] ? (((TWithProperty<Input> extends [infer _0, infer Input extends string] ? [[_0], Input] : []) extends [infer _0, infer Input extends string] ? [_0, Input] : [[], Input] extends [infer _0, infer Input extends string] ? [_0, Input] : []) extends [infer _1, infer Input extends string] ? [[_0, _1], Input] : []) : []) extends [infer _0 extends [unknown, unknown], infer Input extends string] ? [S.TWithPropertyListMapping<_0>, Input] : [];
102
+ export type TWithObject<Input extends string> = (Token.TConst<'{', Input> extends [infer _0, infer Input extends string] ? (TWithPropertyList<Input> extends [infer _1, infer Input extends string] ? (Token.TConst<'}', Input> extends [infer _2, infer Input extends string] ? [[_0, _1, _2], Input] : []) : []) : []) extends [infer _0 extends [unknown, unknown, unknown], infer Input extends string] ? [S.TWithObjectMapping<_0>, Input] : [];
103
+ export type TWithElementList_0<Input extends string, Result extends unknown[] = []> = (TWithValue<Input> extends [infer _0, infer Input extends string] ? (Token.TConst<',', Input> extends [infer _1, infer Input extends string] ? [[_0, _1], Input] : []) : []) extends [infer _0, infer Input extends string] ? TWithElementList_0<Input, [...Result, _0]> : [Result, Input];
104
+ export type TWithElementList<Input extends string> = (TWithElementList_0<Input> extends [infer _0, infer Input extends string] ? (((TWithValue<Input> extends [infer _0, infer Input extends string] ? [[_0], Input] : []) extends [infer _0, infer Input extends string] ? [_0, Input] : [[], Input] extends [infer _0, infer Input extends string] ? [_0, Input] : []) extends [infer _1, infer Input extends string] ? [[_0, _1], Input] : []) : []) extends [infer _0 extends [unknown, unknown], infer Input extends string] ? [S.TWithElementListMapping<_0>, Input] : [];
105
+ export type TWithArray<Input extends string> = (Token.TConst<'[', Input> extends [infer _0, infer Input extends string] ? (TWithElementList<Input> extends [infer _1, infer Input extends string] ? (Token.TConst<']', Input> extends [infer _2, infer Input extends string] ? [[_0, _1, _2], Input] : []) : []) : []) extends [infer _0 extends [unknown, unknown, unknown], infer Input extends string] ? [S.TWithArrayMapping<_0>, Input] : [];
106
+ export type TWithValue<Input extends string> = (TWithBigInt<Input> extends [infer _0, infer Input extends string] ? [_0, Input] : TWithNumber<Input> extends [infer _0, infer Input extends string] ? [_0, Input] : TWithBoolean<Input> extends [infer _0, infer Input extends string] ? [_0, Input] : TWithString<Input> extends [infer _0, infer Input extends string] ? [_0, Input] : TWithNull<Input> extends [infer _0, infer Input extends string] ? [_0, Input] : TWithUndefined<Input> extends [infer _0, infer Input extends string] ? [_0, Input] : TWithObject<Input> extends [infer _0, infer Input extends string] ? [_0, Input] : TWithArray<Input> extends [infer _0, infer Input extends string] ? [_0, Input] : []) extends [infer _0 extends unknown, infer Input extends string] ? [S.TWithValueMapping<_0>, Input] : [];
105
107
  export type TPatternBigInt<Input extends string> = Token.TConst<'-?(?:0|[1-9][0-9]*)n', Input> extends [infer _0 extends '-?(?:0|[1-9][0-9]*)n', infer Input extends string] ? [S.TPatternBigIntMapping<_0>, Input] : [];
106
108
  export type TPatternString<Input extends string> = Token.TConst<'.*', Input> extends [infer _0 extends '.*', infer Input extends string] ? [S.TPatternStringMapping<_0>, Input] : [];
107
109
  export type TPatternNumber<Input extends string> = Token.TConst<'-?(?:0|[1-9][0-9]*)(?:\\.[0-9]+)?', Input> extends [infer _0 extends '-?(?:0|[1-9][0-9]*)(?:\\.[0-9]+)?', infer Input extends string] ? [S.TPatternNumberMapping<_0>, Input] : [];
@@ -218,18 +220,20 @@ export declare const MappedOptional: (input: string) => [unknown, string] | [];
218
220
  export declare const MappedAs: (input: string) => [unknown, string] | [];
219
221
  export declare const _Mapped_: (input: string) => [unknown, string] | [];
220
222
  export declare const Reference: (input: string) => [unknown, string] | [];
221
- export declare const JsonNumber: (input: string) => [unknown, string] | [];
222
- export declare const JsonBoolean: (input: string) => [unknown, string] | [];
223
- export declare const JsonString: (input: string) => [unknown, string] | [];
224
- export declare const JsonNull: (input: string) => [unknown, string] | [];
225
- export declare const JsonProperty: (input: string) => [unknown, string] | [];
226
- export declare const JsonPropertyList_0: (input: string, result?: unknown[]) => [unknown[], string];
227
- export declare const JsonPropertyList: (input: string) => [unknown, string] | [];
228
- export declare const JsonObject: (input: string) => [unknown, string] | [];
229
- export declare const JsonElementList_0: (input: string, result?: unknown[]) => [unknown[], string];
230
- export declare const JsonElementList: (input: string) => [unknown, string] | [];
231
- export declare const JsonArray: (input: string) => [unknown, string] | [];
232
- export declare const Json: (input: string) => [unknown, string] | [];
223
+ export declare const WithBigInt: (input: string) => [unknown, string] | [];
224
+ export declare const WithNumber: (input: string) => [unknown, string] | [];
225
+ export declare const WithBoolean: (input: string) => [unknown, string] | [];
226
+ export declare const WithString: (input: string) => [unknown, string] | [];
227
+ export declare const WithNull: (input: string) => [unknown, string] | [];
228
+ export declare const WithUndefined: (input: string) => [unknown, string] | [];
229
+ export declare const WithProperty: (input: string) => [unknown, string] | [];
230
+ export declare const WithPropertyList_0: (input: string, result?: unknown[]) => [unknown[], string];
231
+ export declare const WithPropertyList: (input: string) => [unknown, string] | [];
232
+ export declare const WithObject: (input: string) => [unknown, string] | [];
233
+ export declare const WithElementList_0: (input: string, result?: unknown[]) => [unknown[], string];
234
+ export declare const WithElementList: (input: string) => [unknown, string] | [];
235
+ export declare const WithArray: (input: string) => [unknown, string] | [];
236
+ export declare const WithValue: (input: string) => [unknown, string] | [];
233
237
  export declare const PatternBigInt: (input: string) => [unknown, string] | [];
234
238
  export declare const PatternString: (input: string) => [unknown, string] | [];
235
239
  export declare const PatternNumber: (input: string) => [unknown, string] | [];
@@ -46,7 +46,7 @@ export const IndexArray_0 = (input, result = []) => If(If(If(Token.Const('[', in
46
46
  export const IndexArray = (input) => If(IndexArray_0(input), ([_0, input]) => [S.IndexArrayMapping(_0), input]);
47
47
  export const Extends = (input) => If(If(If(Token.Const('extends', input), ([_0, input]) => If(Type(input), ([_1, input]) => If(Token.Const('?', input), ([_2, input]) => If(Type(input), ([_3, input]) => If(Token.Const(':', input), ([_4, input]) => If(Type(input), ([_5, input]) => [[_0, _1, _2, _3, _4, _5], input])))))), ([_0, input]) => [_0, input], () => If([[], input], ([_0, input]) => [_0, input], () => [])), ([_0, input]) => [S.ExtendsMapping(_0), input]);
48
48
  export const Base = (input) => If(If(If(Token.Const('(', input), ([_0, input]) => If(Type(input), ([_1, input]) => If(Token.Const(')', input), ([_2, input]) => [[_0, _1, _2], input]))), ([_0, input]) => [_0, input], () => If(KeywordString(input), ([_0, input]) => [_0, input], () => If(KeywordNumber(input), ([_0, input]) => [_0, input], () => If(KeywordBoolean(input), ([_0, input]) => [_0, input], () => If(KeywordUndefined(input), ([_0, input]) => [_0, input], () => If(KeywordNull(input), ([_0, input]) => [_0, input], () => If(KeywordInteger(input), ([_0, input]) => [_0, input], () => If(KeywordBigInt(input), ([_0, input]) => [_0, input], () => If(KeywordUnknown(input), ([_0, input]) => [_0, input], () => If(KeywordAny(input), ([_0, input]) => [_0, input], () => If(KeywordObject(input), ([_0, input]) => [_0, input], () => If(KeywordNever(input), ([_0, input]) => [_0, input], () => If(KeywordSymbol(input), ([_0, input]) => [_0, input], () => If(KeywordVoid(input), ([_0, input]) => [_0, input], () => If(KeywordThis(input), ([_0, input]) => [_0, input], () => If(LiteralBigInt(input), ([_0, input]) => [_0, input], () => If(LiteralBoolean(input), ([_0, input]) => [_0, input], () => If(LiteralNumber(input), ([_0, input]) => [_0, input], () => If(LiteralString(input), ([_0, input]) => [_0, input], () => If(TemplateLiteral(input), ([_0, input]) => [_0, input], () => If(Dependent(input), ([_0, input]) => [_0, input], () => If(_Object_(input), ([_0, input]) => [_0, input], () => If(_Tuple_(input), ([_0, input]) => [_0, input], () => If(_Constructor_(input), ([_0, input]) => [_0, input], () => If(_Function_(input), ([_0, input]) => [_0, input], () => If(_Mapped_(input), ([_0, input]) => [_0, input], () => If(GenericCall(input), ([_0, input]) => [_0, input], () => If(Reference(input), ([_0, input]) => [_0, input], () => [])))))))))))))))))))))))))))), ([_0, input]) => [S.BaseMapping(_0), input]);
49
- export const With = (input) => If(If(If(Token.Const('with', input), ([_0, input]) => If(JsonObject(input), ([_1, input]) => [[_0, _1], input])), ([_0, input]) => [_0, input], () => If([[], input], ([_0, input]) => [_0, input], () => [])), ([_0, input]) => [S.WithMapping(_0), input]);
49
+ export const With = (input) => If(If(If(Token.Const('with', input), ([_0, input]) => If(WithObject(input), ([_1, input]) => [[_0, _1], input])), ([_0, input]) => [_0, input], () => If([[], input], ([_0, input]) => [_0, input], () => [])), ([_0, input]) => [S.WithMapping(_0), input]);
50
50
  export const Factor = (input) => If(If(KeyOf(input), ([_0, input]) => If(Base(input), ([_1, input]) => If(IndexArray(input), ([_2, input]) => If(Extends(input), ([_3, input]) => If(With(input), ([_4, input]) => [[_0, _1, _2, _3, _4], input]))))), ([_0, input]) => [S.FactorMapping(_0), input]);
51
51
  export const ExprTermTail = (input) => If(If(If(Token.Const('&', input), ([_0, input]) => If(Factor(input), ([_1, input]) => If(ExprTermTail(input), ([_2, input]) => [[_0, _1, _2], input]))), ([_0, input]) => [_0, input], () => If([[], input], ([_0, input]) => [_0, input], () => [])), ([_0, input]) => [S.ExprTermTailMapping(_0), input]);
52
52
  export const ExprTerm = (input) => If(If(Factor(input), ([_0, input]) => If(ExprTermTail(input), ([_1, input]) => [[_0, _1], input])), ([_0, input]) => [S.ExprTermMapping(_0), input]);
@@ -94,18 +94,20 @@ export const MappedOptional = (input) => If(If(If(Token.Const('+', input), ([_0,
94
94
  export const MappedAs = (input) => If(If(If(Token.Const('as', input), ([_0, input]) => If(Type(input), ([_1, input]) => [[_0, _1], input])), ([_0, input]) => [_0, input], () => If([[], input], ([_0, input]) => [_0, input], () => [])), ([_0, input]) => [S.MappedAsMapping(_0), input]);
95
95
  export const _Mapped_ = (input) => If(If(Token.Const('{', input), ([_0, input]) => If(MappedReadonly(input), ([_1, input]) => If(Token.Const('[', input), ([_2, input]) => If(Token.Ident(input), ([_3, input]) => If(Token.Const('in', input), ([_4, input]) => If(Type(input), ([_5, input]) => If(MappedAs(input), ([_6, input]) => If(Token.Const(']', input), ([_7, input]) => If(MappedOptional(input), ([_8, input]) => If(Token.Const(':', input), ([_9, input]) => If(Type(input), ([_10, input]) => If(OptionalSemiColon(input), ([_11, input]) => If(Token.Const('}', input), ([_12, input]) => [[_0, _1, _2, _3, _4, _5, _6, _7, _8, _9, _10, _11, _12], input]))))))))))))), ([_0, input]) => [S._Mapped_Mapping(_0), input]);
96
96
  export const Reference = (input) => If(Token.Ident(input), ([_0, input]) => [S.ReferenceMapping(_0), input]);
97
- export const JsonNumber = (input) => If(Token.Number(input), ([_0, input]) => [S.JsonNumberMapping(_0), input]);
98
- export const JsonBoolean = (input) => If(If(Token.Const('true', input), ([_0, input]) => [_0, input], () => If(Token.Const('false', input), ([_0, input]) => [_0, input], () => [])), ([_0, input]) => [S.JsonBooleanMapping(_0), input]);
99
- export const JsonString = (input) => If(Token.String(['\"', '\''], input), ([_0, input]) => [S.JsonStringMapping(_0), input]);
100
- export const JsonNull = (input) => If(Token.Const('null', input), ([_0, input]) => [S.JsonNullMapping(_0), input]);
101
- export const JsonProperty = (input) => If(If(PropertyKey(input), ([_0, input]) => If(Token.Const(':', input), ([_1, input]) => If(Json(input), ([_2, input]) => [[_0, _1, _2], input]))), ([_0, input]) => [S.JsonPropertyMapping(_0), input]);
102
- export const JsonPropertyList_0 = (input, result = []) => If(If(JsonProperty(input), ([_0, input]) => If(PropertyDelimiter(input), ([_1, input]) => [[_0, _1], input])), ([_0, input]) => JsonPropertyList_0(input, [...result, _0]), () => [result, input]);
103
- export const JsonPropertyList = (input) => If(If(JsonPropertyList_0(input), ([_0, input]) => If(If(If(JsonProperty(input), ([_0, input]) => [[_0], input]), ([_0, input]) => [_0, input], () => If([[], input], ([_0, input]) => [_0, input], () => [])), ([_1, input]) => [[_0, _1], input])), ([_0, input]) => [S.JsonPropertyListMapping(_0), input]);
104
- export const JsonObject = (input) => If(If(Token.Const('{', input), ([_0, input]) => If(JsonPropertyList(input), ([_1, input]) => If(Token.Const('}', input), ([_2, input]) => [[_0, _1, _2], input]))), ([_0, input]) => [S.JsonObjectMapping(_0), input]);
105
- export const JsonElementList_0 = (input, result = []) => If(If(Json(input), ([_0, input]) => If(Token.Const(',', input), ([_1, input]) => [[_0, _1], input])), ([_0, input]) => JsonElementList_0(input, [...result, _0]), () => [result, input]);
106
- export const JsonElementList = (input) => If(If(JsonElementList_0(input), ([_0, input]) => If(If(If(Json(input), ([_0, input]) => [[_0], input]), ([_0, input]) => [_0, input], () => If([[], input], ([_0, input]) => [_0, input], () => [])), ([_1, input]) => [[_0, _1], input])), ([_0, input]) => [S.JsonElementListMapping(_0), input]);
107
- export const JsonArray = (input) => If(If(Token.Const('[', input), ([_0, input]) => If(JsonElementList(input), ([_1, input]) => If(Token.Const(']', input), ([_2, input]) => [[_0, _1, _2], input]))), ([_0, input]) => [S.JsonArrayMapping(_0), input]);
108
- export const Json = (input) => If(If(JsonNumber(input), ([_0, input]) => [_0, input], () => If(JsonBoolean(input), ([_0, input]) => [_0, input], () => If(JsonString(input), ([_0, input]) => [_0, input], () => If(JsonNull(input), ([_0, input]) => [_0, input], () => If(JsonObject(input), ([_0, input]) => [_0, input], () => If(JsonArray(input), ([_0, input]) => [_0, input], () => [])))))), ([_0, input]) => [S.JsonMapping(_0), input]);
97
+ export const WithBigInt = (input) => If(Token.BigInt(input), ([_0, input]) => [S.WithBigIntMapping(_0), input]);
98
+ export const WithNumber = (input) => If(Token.Number(input), ([_0, input]) => [S.WithNumberMapping(_0), input]);
99
+ export const WithBoolean = (input) => If(If(Token.Const('true', input), ([_0, input]) => [_0, input], () => If(Token.Const('false', input), ([_0, input]) => [_0, input], () => [])), ([_0, input]) => [S.WithBooleanMapping(_0), input]);
100
+ export const WithString = (input) => If(Token.String(['\"', '\''], input), ([_0, input]) => [S.WithStringMapping(_0), input]);
101
+ export const WithNull = (input) => If(Token.Const('null', input), ([_0, input]) => [S.WithNullMapping(_0), input]);
102
+ export const WithUndefined = (input) => If(Token.Const('undefined', input), ([_0, input]) => [S.WithUndefinedMapping(_0), input]);
103
+ export const WithProperty = (input) => If(If(PropertyKey(input), ([_0, input]) => If(Token.Const(':', input), ([_1, input]) => If(WithValue(input), ([_2, input]) => [[_0, _1, _2], input]))), ([_0, input]) => [S.WithPropertyMapping(_0), input]);
104
+ export const WithPropertyList_0 = (input, result = []) => If(If(WithProperty(input), ([_0, input]) => If(PropertyDelimiter(input), ([_1, input]) => [[_0, _1], input])), ([_0, input]) => WithPropertyList_0(input, [...result, _0]), () => [result, input]);
105
+ export const WithPropertyList = (input) => If(If(WithPropertyList_0(input), ([_0, input]) => If(If(If(WithProperty(input), ([_0, input]) => [[_0], input]), ([_0, input]) => [_0, input], () => If([[], input], ([_0, input]) => [_0, input], () => [])), ([_1, input]) => [[_0, _1], input])), ([_0, input]) => [S.WithPropertyListMapping(_0), input]);
106
+ export const WithObject = (input) => If(If(Token.Const('{', input), ([_0, input]) => If(WithPropertyList(input), ([_1, input]) => If(Token.Const('}', input), ([_2, input]) => [[_0, _1, _2], input]))), ([_0, input]) => [S.WithObjectMapping(_0), input]);
107
+ export const WithElementList_0 = (input, result = []) => If(If(WithValue(input), ([_0, input]) => If(Token.Const(',', input), ([_1, input]) => [[_0, _1], input])), ([_0, input]) => WithElementList_0(input, [...result, _0]), () => [result, input]);
108
+ export const WithElementList = (input) => If(If(WithElementList_0(input), ([_0, input]) => If(If(If(WithValue(input), ([_0, input]) => [[_0], input]), ([_0, input]) => [_0, input], () => If([[], input], ([_0, input]) => [_0, input], () => [])), ([_1, input]) => [[_0, _1], input])), ([_0, input]) => [S.WithElementListMapping(_0), input]);
109
+ export const WithArray = (input) => If(If(Token.Const('[', input), ([_0, input]) => If(WithElementList(input), ([_1, input]) => If(Token.Const(']', input), ([_2, input]) => [[_0, _1, _2], input]))), ([_0, input]) => [S.WithArrayMapping(_0), input]);
110
+ export const WithValue = (input) => If(If(WithBigInt(input), ([_0, input]) => [_0, input], () => If(WithNumber(input), ([_0, input]) => [_0, input], () => If(WithBoolean(input), ([_0, input]) => [_0, input], () => If(WithString(input), ([_0, input]) => [_0, input], () => If(WithNull(input), ([_0, input]) => [_0, input], () => If(WithUndefined(input), ([_0, input]) => [_0, input], () => If(WithObject(input), ([_0, input]) => [_0, input], () => If(WithArray(input), ([_0, input]) => [_0, input], () => [])))))))), ([_0, input]) => [S.WithValueMapping(_0), input]);
109
111
  export const PatternBigInt = (input) => If(Token.Const('-?(?:0|[1-9][0-9]*)n', input), ([_0, input]) => [S.PatternBigIntMapping(_0), input]);
110
112
  export const PatternString = (input) => If(Token.Const('.*', input), ([_0, input]) => [S.PatternStringMapping(_0), input]);
111
113
  export const PatternNumber = (input) => If(Token.Const('-?(?:0|[1-9][0-9]*)(?:\\.[0-9]+)?', input), ([_0, input]) => [S.PatternNumberMapping(_0), input]);
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "typebox",
3
3
  "description": "Json Schema Type Builder with Static Type Resolution for TypeScript",
4
- "version": "1.2.4",
4
+ "version": "1.2.6",
5
5
  "keywords": [
6
6
  "typescript",
7
7
  "jsonschema"