@@ -68,4 +68,4 @@ import { Memory } from '../../system/memory/index.mjs'; | ||
| ] extends ['Uppercase', [infer Type extends T.TSchema]] ? S.TUppercaseDeferred<Type> : T.TCallConstruct<T.TRef<Target>, Parameters>); | ||
| type TDelimitedDecode<Input extends ([unknown, unknown] | unknown)[], Result extends unknown[] = []> = (Input extends [infer Left, ...infer Right] ? Left extends [infer Item, infer _] ? TDelimitedDecode<Right, [...Result, Item]> : TDelimitedDecode<Right, [...Result, Left]> : Result); | ||
| type TDelimited<Input extends [unknown, unknown]> = Input extends [infer Left extends unknown[], infer Right extends unknown[]] ? TDelimitedDecode<[...Left, ...Right]> : []; | ||
| type TDelimitedDecode<Input extends [unknown, unknown][], Result extends unknown[] = []> = (Input extends [infer Left extends [unknown, unknown], ...infer Right extends [unknown, unknown][]] ? TDelimitedDecode<Right, [...Result, Left[1]]> : Result); | ||
| type TDelimited<Input extends [unknown, unknown, unknown] | []> = (Input extends [infer Left extends unknown, infer Right extends [unknown, unknown][], infer _ extends unknown[]] ? [Left, ...TDelimitedDecode<Right>] : []); | ||
| export type TGenericParameterExtendsEqualsMapping<Input extends [unknown, unknown, unknown, unknown, unknown]> = (Input extends [infer Name extends string, 'extends', infer Extends extends T.TSchema, '=', infer Equals extends T.TSchema] ? T.TParameter<Name, Extends, Equals> : never); | ||
@@ -81,8 +81,8 @@ export declare function GenericParameterExtendsEqualsMapping(input: [unknown, unknown, unknown, unknown, unknown]): unknown; | ||
| export declare function GenericParameterMapping(input: unknown): unknown; | ||
| export type TGenericParameterListMapping<Input extends [unknown, unknown]> = (TDelimited<Input>); | ||
| export declare function GenericParameterListMapping(input: [unknown, unknown]): unknown; | ||
| export type TGenericParameterListMapping<Input extends [unknown, unknown, unknown] | []> = (TDelimited<Input>); | ||
| export declare function GenericParameterListMapping(input: [unknown, unknown, unknown] | []): unknown; | ||
| export type TGenericParametersMapping<Input extends [unknown, unknown, unknown]> = (Input extends ['<', infer Parameters extends T.TParameter[], '>'] ? Parameters : never); | ||
| export declare function GenericParametersMapping(input: [unknown, unknown, unknown]): unknown; | ||
| export type TGenericCallArgumentListMapping<Input extends [unknown, unknown]> = (TDelimited<Input>); | ||
| export declare function GenericCallArgumentListMapping(input: [unknown, unknown]): unknown; | ||
| export type TGenericCallArgumentListMapping<Input extends [unknown, unknown, unknown] | []> = (TDelimited<Input>); | ||
| export declare function GenericCallArgumentListMapping(input: [unknown, unknown, unknown] | []): unknown; | ||
| export type TGenericCallArgumentsMapping<Input extends [unknown, unknown, unknown]> = (Input extends ['<', infer Arguments extends T.TSchema[], '>'] ? Arguments : never); | ||
@@ -207,4 +207,4 @@ export declare function GenericCallArgumentsMapping(input: [unknown, unknown, unknown]): unknown; | ||
| export declare function PropertyDelimiterMapping(input: [unknown, unknown] | [unknown]): unknown; | ||
| export type TPropertyListMapping<Input extends [unknown, unknown]> = (TDelimited<Input>); | ||
| export declare function PropertyListMapping(input: [unknown, unknown]): unknown; | ||
| export type TPropertyListMapping<Input extends [unknown, unknown, unknown] | []> = (TDelimited<Input>); | ||
| export declare function PropertyListMapping(input: [unknown, unknown, unknown] | []): unknown; | ||
| type TPropertiesReduce<PropertiesList extends T.TProperties[], Result extends [properties: T.TProperties, patternProperties: T.TProperties] = [{}, {}]> = (PropertiesList extends [infer Left extends T.TProperties, ...infer Right extends T.TProperties[]] ? (Left extends { | ||
@@ -225,14 +225,17 @@ [_ in T.TIntegerKey]: T.TSchema; | ||
| export declare function ElementNamedMapping(input: [unknown, unknown, unknown, unknown, unknown] | [unknown, unknown, unknown, unknown] | [unknown, unknown, unknown]): unknown; | ||
| export type TElementReadonlyOptionalMapping<Input extends [unknown, unknown, unknown]> = (Input extends ['readonly', infer Type extends T.TSchema, '?'] ? S.TAddReadonlyDeferred<S.TAddOptionalDeferred<Type>> : never); | ||
| export declare function ElementReadonlyOptionalMapping(input: [unknown, unknown, unknown]): unknown; | ||
| export type TElementReadonlyMapping<Input extends [unknown, unknown]> = (Input extends ['readonly', infer Type extends T.TSchema] ? S.TAddReadonlyDeferred<Type> : never); | ||
| export declare function ElementReadonlyMapping(input: [unknown, unknown]): unknown; | ||
| export type TElementOptionalMapping<Input extends [unknown, unknown]> = (Input extends [infer Type extends T.TSchema, '?'] ? S.TAddOptionalDeferred<Type> : never); | ||
| export declare function ElementOptionalMapping(input: [unknown, unknown]): unknown; | ||
| export type TElementBaseMapping<Input extends unknown> = (Input); | ||
| export declare function ElementBaseMapping(input: unknown): unknown; | ||
| export type TElementBaseMapping<Input extends unknown | [unknown, unknown, unknown]> = (Input extends [infer IsReadonly extends boolean, infer Type extends T.TSchema, infer IsOptional extends boolean] ? ([ | ||
| IsReadonly, | ||
| IsOptional | ||
| ] extends [true, true] ? S.TAddReadonlyDeferred<S.TAddOptionalDeferred<Type>> : [ | ||
| IsReadonly, | ||
| IsOptional | ||
| ] extends [true, false] ? S.TAddReadonlyDeferred<Type> : [ | ||
| IsReadonly, | ||
| IsOptional | ||
| ] extends [false, true] ? S.TAddOptionalDeferred<Type> : Type) : Input); | ||
| export declare function ElementBaseMapping(input: unknown | [unknown, unknown, unknown]): unknown; | ||
| export type TElementMapping<Input extends [unknown, unknown] | [unknown]> = (Input extends ['...', infer Type extends T.TSchema] ? T.TRest<Type> : Input extends [infer Type extends T.TSchema] ? Type : never); | ||
| export declare function ElementMapping(input: [unknown, unknown] | [unknown]): unknown; | ||
| export type TElementListMapping<Input extends [unknown, unknown]> = (TDelimited<Input>); | ||
| export declare function ElementListMapping(input: [unknown, unknown]): unknown; | ||
| export type TElementListMapping<Input extends [unknown, unknown, unknown] | []> = (TDelimited<Input>); | ||
| export declare function ElementListMapping(input: [unknown, unknown, unknown] | []): unknown; | ||
| export type T_Tuple_Mapping<Input extends [unknown, unknown, unknown]> = (Input extends ['[', infer Types extends T.TSchema[], ']'] ? T.TTuple<Types> : never); | ||
@@ -252,4 +255,4 @@ export declare function _Tuple_Mapping(input: [unknown, unknown, unknown]): unknown; | ||
| export declare function ParameterMapping(input: [unknown, unknown] | [unknown]): unknown; | ||
| export type TParameterListMapping<Input extends [unknown, unknown]> = (TDelimited<Input>); | ||
| export declare function ParameterListMapping(input: [unknown, unknown]): unknown; | ||
| export type TParameterListMapping<Input extends [unknown, unknown, unknown] | []> = (TDelimited<Input>); | ||
| export declare function ParameterListMapping(input: [unknown, unknown, unknown] | []): unknown; | ||
| export type T_Function_Mapping<Input extends [unknown, unknown, unknown, unknown, unknown]> = (Input extends ['(', infer ParameterList extends T.TSchema[], ')', '=>', infer ReturnType extends T.TSchema] ? T.TFunction<ParameterList, ReturnType> : never); | ||
@@ -288,4 +291,4 @@ export declare function _Function_Mapping(input: [unknown, unknown, unknown, unknown, unknown]): unknown; | ||
| export declare function WithPropertyMapping(input: [unknown, unknown, unknown]): unknown; | ||
| export type TWithPropertyListMapping<Input extends [unknown, unknown]> = (TDelimited<Input>); | ||
| export declare function WithPropertyListMapping(input: [unknown, unknown]): unknown; | ||
| export type TWithPropertyListMapping<Input extends [unknown, unknown, unknown] | []> = (TDelimited<Input>); | ||
| export declare function WithPropertyListMapping(input: [unknown, unknown, unknown] | []): unknown; | ||
| 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>> : { | ||
@@ -296,4 +299,4 @@ [Key in keyof Result]: Result[Key]; | ||
| export declare function WithObjectMapping(input: [unknown, unknown, unknown]): unknown; | ||
| export type TWithElementListMapping<Input extends [unknown, unknown]> = (TDelimited<Input>); | ||
| export declare function WithElementListMapping(input: [unknown, unknown]): unknown; | ||
| export type TWithElementListMapping<Input extends [unknown, unknown, unknown] | []> = (TDelimited<Input>); | ||
| export declare function WithElementListMapping(input: [unknown, unknown, unknown] | []): unknown; | ||
| export type TWithArrayMapping<Input extends [unknown, unknown, unknown]> = (Input extends ['[', infer Elements extends unknown[], ']'] ? Elements : never); | ||
@@ -328,4 +331,4 @@ export declare function WithArrayMapping(input: [unknown, unknown, unknown]): unknown; | ||
| export declare function PatternMapping(input: [unknown, unknown, unknown]): unknown; | ||
| export type TInterfaceDeclarationHeritageListMapping<Input extends [unknown, unknown]> = (TDelimited<Input>); | ||
| export declare function InterfaceDeclarationHeritageListMapping(input: [unknown, unknown]): unknown; | ||
| export type TInterfaceDeclarationHeritageListMapping<Input extends [unknown, unknown, unknown] | []> = (TDelimited<Input>); | ||
| export declare function InterfaceDeclarationHeritageListMapping(input: [unknown, unknown, unknown] | []): unknown; | ||
| export type TInterfaceDeclarationHeritageMapping<Input extends [unknown, unknown] | []> = (Input extends ['extends', infer Heritage extends T.TSchema[]] ? Heritage : []); | ||
@@ -353,7 +356,7 @@ export declare function InterfaceDeclarationHeritageMapping(input: [unknown, unknown] | []): unknown; | ||
| export declare function ModuleDeclarationDelimiterMapping(input: [unknown, unknown] | [unknown]): unknown; | ||
| export type TModuleDeclarationListMapping<Input extends [unknown, unknown]> = (TPropertiesReduce<TDelimited<Input>>); | ||
| export declare function ModuleDeclarationListMapping(input: [unknown, unknown]): unknown; | ||
| export type TModuleDeclarationListMapping<Input extends [unknown, unknown, unknown] | []> = (TDelimited<Input>); | ||
| export declare function ModuleDeclarationListMapping(input: [unknown, unknown, unknown] | []): unknown; | ||
| export type TModuleDeclarationMapping<Input extends [unknown, unknown, unknown]> = (Input extends [null, infer ModuleDeclaration extends T.TProperties, null] ? ModuleDeclaration : never); | ||
| export declare function ModuleDeclarationMapping(input: [unknown, unknown, unknown]): unknown; | ||
| export type TModuleMapping<Input extends [unknown, unknown]> = (Input extends [infer ModuleDeclaration extends T.TProperties, infer ModuleDeclarationList extends [T.TProperties, T.TProperties]] ? S.TModuleDeferred<Memory.TAssign<ModuleDeclaration, ModuleDeclarationList[0]>> : never); | ||
| export type TModuleMapping<Input extends [unknown, unknown]> = (Input extends [infer ModuleDeclaration extends T.TProperties, infer ModuleDeclarationList extends T.TProperties[]] ? S.TModuleDeferred<Memory.TAssign<ModuleDeclaration, TPropertiesReduce<ModuleDeclarationList>[0]>> : never); | ||
| export declare function ModuleMapping(input: [unknown, unknown]): unknown; | ||
@@ -360,0 +363,0 @@ export type TScriptMapping<Input extends unknown> = (Input); |
@@ -42,13 +42,10 @@ // deno-fmt-ignore-file | ||
| } | ||
| const DelimitedDecode = (input, result = []) => { | ||
| return input.reduce((result, left) => { | ||
| return Guard.IsArray(left) && Guard.IsEqual(left.length, 2) | ||
| ? [...result, left[0]] | ||
| : [...result, left]; | ||
| }, []); | ||
| }; | ||
| const Delimited = (input) => { | ||
| const [left, right] = input; | ||
| return DelimitedDecode([...left, ...right]); | ||
| }; | ||
| function DelimitedDecode(input, result = []) { | ||
| return Guard.ShiftLeft(input, (left, right) => DelimitedDecode(right, [...result, left[1]]), () => result); | ||
| } | ||
| function Delimited(input) { | ||
| return Guard.IsEqual(input.length, 3) | ||
| ? [input[0], ...DelimitedDecode(input[1])] | ||
| : []; | ||
| } | ||
| export function GenericParameterExtendsEqualsMapping(input) { | ||
@@ -326,13 +323,10 @@ return T.Parameter(input[0], input[2], input[4]); | ||
| } | ||
| export function ElementReadonlyOptionalMapping(input) { | ||
| return S.AddReadonlyDeferred(S.AddOptionalDeferred(input[1])); | ||
| } | ||
| export function ElementReadonlyMapping(input) { | ||
| return S.AddReadonlyDeferred(input[1]); | ||
| } | ||
| export function ElementOptionalMapping(input) { | ||
| return S.AddOptionalDeferred(input[0]); | ||
| } | ||
| export function ElementBaseMapping(input) { | ||
| return input; | ||
| if (!Guard.IsArray(input) || !Guard.IsEqual(input.length, 3)) | ||
| return input; | ||
| const [isReadonly, type, isOptional] = input; | ||
| return (isReadonly && isOptional ? S.AddReadonlyDeferred(S.AddOptionalDeferred(type)) : | ||
| isReadonly && !isOptional ? S.AddReadonlyDeferred(type) : | ||
| !isReadonly && isOptional ? S.AddOptionalDeferred(type) : | ||
| type); | ||
| } | ||
@@ -525,3 +519,3 @@ // deno-coverage-ignore-start | ||
| export function ModuleDeclarationListMapping(input) { | ||
| return PropertiesReduce(Delimited(input)); | ||
| return Delimited(input); | ||
| } | ||
@@ -532,5 +526,4 @@ export function ModuleDeclarationMapping(input) { | ||
| export function ModuleMapping(input) { | ||
| const moduleDeclaration = input[0]; | ||
| const moduleDeclarationList = input[1]; | ||
| return S.ModuleDeferred(Memory.Assign(moduleDeclaration, moduleDeclarationList[0])); | ||
| const [moduleDeclaration, moduleDeclarationList] = [input[0], input[1]]; | ||
| return S.ModuleDeferred(Memory.Assign(moduleDeclaration, PropertiesReduce(moduleDeclarationList)[0])); | ||
| } | ||
@@ -537,0 +530,0 @@ export function ScriptMapping(input) { |
@@ -12,7 +12,7 @@ // deno-fmt-ignore-file | ||
| export const GenericParameter = (input) => If(If(GenericParameterExtendsEquals(input), ([_0, input]) => [_0, input], () => If(GenericParameterExtends(input), ([_0, input]) => [_0, input], () => If(GenericParameterEquals(input), ([_0, input]) => [_0, input], () => If(GenericParameterIdentifier(input), ([_0, input]) => [_0, input], () => [])))), ([_0, input]) => [S.GenericParameterMapping(_0), input]); | ||
| export const GenericParameterList_0 = (input, result = []) => If(If(GenericParameter(input), ([_0, input]) => If(Token.Const(',', input), ([_1, input]) => [[_0, _1], input])), ([_0, input]) => GenericParameterList_0(input, [...result, _0]), () => [result, input]); | ||
| export const GenericParameterList = (input) => If(If(GenericParameterList_0(input), ([_0, input]) => If(If(If(GenericParameter(input), ([_0, input]) => [[_0], input]), ([_0, input]) => [_0, input], () => If([[], input], ([_0, input]) => [_0, input], () => [])), ([_1, input]) => [[_0, _1], input])), ([_0, input]) => [S.GenericParameterListMapping(_0), input]); | ||
| export const GenericParameterList_0 = (input, result = []) => If(If(Token.Const(',', input), ([_0, input]) => If(GenericParameter(input), ([_1, input]) => [[_0, _1], input])), ([_0, input]) => GenericParameterList_0(input, [...result, _0]), () => [result, input]); | ||
| export const GenericParameterList = (input) => If(If(If(GenericParameter(input), ([_0, input]) => If(GenericParameterList_0(input), ([_1, input]) => If(If(Token.Const(',', input), ([_0, input]) => [[_0], input], () => [[], input]), ([_2, input]) => [[_0, _1, _2], input]))), ([_0, input]) => [_0, input], () => If([[], input], ([_0, input]) => [_0, input], () => [])), ([_0, input]) => [S.GenericParameterListMapping(_0), input]); | ||
| export const GenericParameters = (input) => If(If(Token.Const('<', input), ([_0, input]) => If(GenericParameterList(input), ([_1, input]) => If(Token.Const('>', input), ([_2, input]) => [[_0, _1, _2], input]))), ([_0, input]) => [S.GenericParametersMapping(_0), input]); | ||
| export const GenericCallArgumentList_0 = (input, result = []) => If(If(Type(input), ([_0, input]) => If(Token.Const(',', input), ([_1, input]) => [[_0, _1], input])), ([_0, input]) => GenericCallArgumentList_0(input, [...result, _0]), () => [result, input]); | ||
| export const GenericCallArgumentList = (input) => If(If(GenericCallArgumentList_0(input), ([_0, input]) => If(If(If(Type(input), ([_0, input]) => [[_0], input]), ([_0, input]) => [_0, input], () => If([[], input], ([_0, input]) => [_0, input], () => [])), ([_1, input]) => [[_0, _1], input])), ([_0, input]) => [S.GenericCallArgumentListMapping(_0), input]); | ||
| export const GenericCallArgumentList_0 = (input, result = []) => If(If(Token.Const(',', input), ([_0, input]) => If(Type(input), ([_1, input]) => [[_0, _1], input])), ([_0, input]) => GenericCallArgumentList_0(input, [...result, _0]), () => [result, input]); | ||
| export const GenericCallArgumentList = (input) => If(If(If(Type(input), ([_0, input]) => If(GenericCallArgumentList_0(input), ([_1, input]) => If(If(Token.Const(',', input), ([_0, input]) => [[_0], input], () => [[], input]), ([_2, input]) => [[_0, _1, _2], input]))), ([_0, input]) => [_0, input], () => If([[], input], ([_0, input]) => [_0, input], () => [])), ([_0, input]) => [S.GenericCallArgumentListMapping(_0), input]); | ||
| export const GenericCallArguments = (input) => If(If(Token.Const('<', input), ([_0, input]) => If(GenericCallArgumentList(input), ([_1, input]) => If(Token.Const('>', input), ([_2, input]) => [[_0, _1, _2], input]))), ([_0, input]) => [S.GenericCallArgumentsMapping(_0), input]); | ||
@@ -70,14 +70,11 @@ export const GenericCall = (input) => If(If(Token.Ident(input), ([_0, input]) => If(GenericCallArguments(input), ([_1, input]) => [[_0, _1], input])), ([_0, input]) => [S.GenericCallMapping(_0), input]); | ||
| export const PropertyDelimiter = (input) => If(If(If(Token.Const(',', input), ([_0, input]) => If(Token.Const('\n', input), ([_1, input]) => [[_0, _1], input])), ([_0, input]) => [_0, input], () => If(If(Token.Const(';', input), ([_0, input]) => If(Token.Const('\n', input), ([_1, input]) => [[_0, _1], input])), ([_0, input]) => [_0, input], () => If(If(Token.Const(',', input), ([_0, input]) => [[_0], input]), ([_0, input]) => [_0, input], () => If(If(Token.Const(';', input), ([_0, input]) => [[_0], input]), ([_0, input]) => [_0, input], () => If(If(Token.Const('\n', input), ([_0, input]) => [[_0], input]), ([_0, input]) => [_0, input], () => []))))), ([_0, input]) => [S.PropertyDelimiterMapping(_0), input]); | ||
| export const PropertyList_0 = (input, result = []) => If(If(Property(input), ([_0, input]) => If(PropertyDelimiter(input), ([_1, input]) => [[_0, _1], input])), ([_0, input]) => PropertyList_0(input, [...result, _0]), () => [result, input]); | ||
| export const PropertyList = (input) => If(If(PropertyList_0(input), ([_0, input]) => If(If(If(Property(input), ([_0, input]) => [[_0], input]), ([_0, input]) => [_0, input], () => If([[], input], ([_0, input]) => [_0, input], () => [])), ([_1, input]) => [[_0, _1], input])), ([_0, input]) => [S.PropertyListMapping(_0), input]); | ||
| export const PropertyList_0 = (input, result = []) => If(If(PropertyDelimiter(input), ([_0, input]) => If(Property(input), ([_1, input]) => [[_0, _1], input])), ([_0, input]) => PropertyList_0(input, [...result, _0]), () => [result, input]); | ||
| export const PropertyList = (input) => If(If(If(Property(input), ([_0, input]) => If(PropertyList_0(input), ([_1, input]) => If(If(PropertyDelimiter(input), ([_0, input]) => [[_0], input], () => [[], input]), ([_2, input]) => [[_0, _1, _2], input]))), ([_0, input]) => [_0, input], () => If([[], input], ([_0, input]) => [_0, input], () => [])), ([_0, input]) => [S.PropertyListMapping(_0), input]); | ||
| export const Properties = (input) => If(If(Token.Const('{', input), ([_0, input]) => If(PropertyList(input), ([_1, input]) => If(Token.Const('}', input), ([_2, input]) => [[_0, _1, _2], input]))), ([_0, input]) => [S.PropertiesMapping(_0), input]); | ||
| export const _Object_ = (input) => If(Properties(input), ([_0, input]) => [S._Object_Mapping(_0), input]); | ||
| export const ElementNamed = (input) => If(If(If(Token.Ident(input), ([_0, input]) => If(Token.Const('?', input), ([_1, input]) => If(Token.Const(':', input), ([_2, input]) => If(Token.Const('readonly', input), ([_3, input]) => If(Type(input), ([_4, input]) => [[_0, _1, _2, _3, _4], input]))))), ([_0, input]) => [_0, input], () => If(If(Token.Ident(input), ([_0, input]) => If(Token.Const(':', input), ([_1, input]) => If(Token.Const('readonly', input), ([_2, input]) => If(Type(input), ([_3, input]) => [[_0, _1, _2, _3], input])))), ([_0, input]) => [_0, input], () => If(If(Token.Ident(input), ([_0, input]) => If(Token.Const('?', input), ([_1, input]) => If(Token.Const(':', input), ([_2, input]) => If(Type(input), ([_3, input]) => [[_0, _1, _2, _3], input])))), ([_0, input]) => [_0, input], () => If(If(Token.Ident(input), ([_0, input]) => If(Token.Const(':', input), ([_1, input]) => If(Type(input), ([_2, input]) => [[_0, _1, _2], input]))), ([_0, input]) => [_0, input], () => [])))), ([_0, input]) => [S.ElementNamedMapping(_0), input]); | ||
| export const ElementReadonlyOptional = (input) => If(If(Token.Const('readonly', input), ([_0, input]) => If(Type(input), ([_1, input]) => If(Token.Const('?', input), ([_2, input]) => [[_0, _1, _2], input]))), ([_0, input]) => [S.ElementReadonlyOptionalMapping(_0), input]); | ||
| export const ElementReadonly = (input) => If(If(Token.Const('readonly', input), ([_0, input]) => If(Type(input), ([_1, input]) => [[_0, _1], input])), ([_0, input]) => [S.ElementReadonlyMapping(_0), input]); | ||
| export const ElementOptional = (input) => If(If(Type(input), ([_0, input]) => If(Token.Const('?', input), ([_1, input]) => [[_0, _1], input])), ([_0, input]) => [S.ElementOptionalMapping(_0), input]); | ||
| export const ElementBase = (input) => If(If(ElementNamed(input), ([_0, input]) => [_0, input], () => If(ElementReadonlyOptional(input), ([_0, input]) => [_0, input], () => If(ElementReadonly(input), ([_0, input]) => [_0, input], () => If(ElementOptional(input), ([_0, input]) => [_0, input], () => If(Type(input), ([_0, input]) => [_0, input], () => []))))), ([_0, input]) => [S.ElementBaseMapping(_0), input]); | ||
| export const ElementBase = (input) => If(If(ElementNamed(input), ([_0, input]) => [_0, input], () => If(If(Readonly(input), ([_0, input]) => If(Type(input), ([_1, input]) => If(Optional(input), ([_2, input]) => [[_0, _1, _2], input]))), ([_0, input]) => [_0, input], () => [])), ([_0, input]) => [S.ElementBaseMapping(_0), input]); | ||
| export const Element = (input) => If(If(If(Token.Const('...', input), ([_0, input]) => If(ElementBase(input), ([_1, input]) => [[_0, _1], input])), ([_0, input]) => [_0, input], () => If(If(ElementBase(input), ([_0, input]) => [[_0], input]), ([_0, input]) => [_0, input], () => [])), ([_0, input]) => [S.ElementMapping(_0), input]); | ||
| export const ElementList_0 = (input, result = []) => If(If(Element(input), ([_0, input]) => If(Token.Const(',', input), ([_1, input]) => [[_0, _1], input])), ([_0, input]) => ElementList_0(input, [...result, _0]), () => [result, input]); | ||
| export const ElementList = (input) => If(If(ElementList_0(input), ([_0, input]) => If(If(If(Element(input), ([_0, input]) => [[_0], input]), ([_0, input]) => [_0, input], () => If([[], input], ([_0, input]) => [_0, input], () => [])), ([_1, input]) => [[_0, _1], input])), ([_0, input]) => [S.ElementListMapping(_0), input]); | ||
| export const ElementList_0 = (input, result = []) => If(If(Token.Const(',', input), ([_0, input]) => If(Element(input), ([_1, input]) => [[_0, _1], input])), ([_0, input]) => ElementList_0(input, [...result, _0]), () => [result, input]); | ||
| export const ElementList = (input) => If(If(If(Element(input), ([_0, input]) => If(ElementList_0(input), ([_1, input]) => If(If(Token.Const(',', input), ([_0, input]) => [[_0], input], () => [[], input]), ([_2, input]) => [[_0, _1, _2], input]))), ([_0, input]) => [_0, input], () => If([[], input], ([_0, input]) => [_0, input], () => [])), ([_0, input]) => [S.ElementListMapping(_0), input]); | ||
| export const _Tuple_ = (input) => If(If(Token.Const('[', input), ([_0, input]) => If(ElementList(input), ([_1, input]) => If(Token.Const(']', input), ([_2, input]) => [[_0, _1, _2], input]))), ([_0, input]) => [S._Tuple_Mapping(_0), input]); | ||
@@ -90,4 +87,4 @@ export const ParameterReadonlyOptional = (input) => If(If(Token.Ident(input), ([_0, input]) => If(Token.Const('?', input), ([_1, input]) => If(Token.Const(':', input), ([_2, input]) => If(Token.Const('readonly', input), ([_3, input]) => If(Type(input), ([_4, input]) => [[_0, _1, _2, _3, _4], input]))))), ([_0, input]) => [S.ParameterReadonlyOptionalMapping(_0), input]); | ||
| export const Parameter = (input) => If(If(If(Token.Const('...', input), ([_0, input]) => If(ParameterBase(input), ([_1, input]) => [[_0, _1], input])), ([_0, input]) => [_0, input], () => If(If(ParameterBase(input), ([_0, input]) => [[_0], input]), ([_0, input]) => [_0, input], () => [])), ([_0, input]) => [S.ParameterMapping(_0), input]); | ||
| export const ParameterList_0 = (input, result = []) => If(If(Parameter(input), ([_0, input]) => If(Token.Const(',', input), ([_1, input]) => [[_0, _1], input])), ([_0, input]) => ParameterList_0(input, [...result, _0]), () => [result, input]); | ||
| export const ParameterList = (input) => If(If(ParameterList_0(input), ([_0, input]) => If(If(If(Parameter(input), ([_0, input]) => [[_0], input]), ([_0, input]) => [_0, input], () => If([[], input], ([_0, input]) => [_0, input], () => [])), ([_1, input]) => [[_0, _1], input])), ([_0, input]) => [S.ParameterListMapping(_0), input]); | ||
| export const ParameterList_0 = (input, result = []) => If(If(Token.Const(',', input), ([_0, input]) => If(Parameter(input), ([_1, input]) => [[_0, _1], input])), ([_0, input]) => ParameterList_0(input, [...result, _0]), () => [result, input]); | ||
| export const ParameterList = (input) => If(If(If(Parameter(input), ([_0, input]) => If(ParameterList_0(input), ([_1, input]) => If(If(Token.Const(',', input), ([_0, input]) => [[_0], input], () => [[], input]), ([_2, input]) => [[_0, _1, _2], input]))), ([_0, input]) => [_0, input], () => If([[], input], ([_0, input]) => [_0, input], () => [])), ([_0, input]) => [S.ParameterListMapping(_0), input]); | ||
| export const _Function_ = (input) => If(If(Token.Const('(', input), ([_0, input]) => If(ParameterList(input), ([_1, input]) => If(Token.Const(')', input), ([_2, input]) => If(Token.Const('=>', input), ([_3, input]) => If(Type(input), ([_4, input]) => [[_0, _1, _2, _3, _4], input]))))), ([_0, input]) => [S._Function_Mapping(_0), input]); | ||
@@ -107,7 +104,7 @@ export const _Constructor_ = (input) => If(If(Token.Const('new', input), ([_0, input]) => If(Token.Const('(', input), ([_1, input]) => If(ParameterList(input), ([_2, input]) => If(Token.Const(')', input), ([_3, input]) => If(Token.Const('=>', input), ([_4, input]) => If(Type(input), ([_5, input]) => [[_0, _1, _2, _3, _4, _5], input])))))), ([_0, input]) => [S._Constructor_Mapping(_0), input]); | ||
| 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]); | ||
| 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]); | ||
| 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]); | ||
| export const WithPropertyList_0 = (input, result = []) => If(If(PropertyDelimiter(input), ([_0, input]) => If(WithProperty(input), ([_1, input]) => [[_0, _1], input])), ([_0, input]) => WithPropertyList_0(input, [...result, _0]), () => [result, input]); | ||
| export const WithPropertyList = (input) => If(If(If(WithProperty(input), ([_0, input]) => If(WithPropertyList_0(input), ([_1, input]) => If(If(PropertyDelimiter(input), ([_0, input]) => [[_0], input], () => [[], input]), ([_2, input]) => [[_0, _1, _2], input]))), ([_0, input]) => [_0, input], () => If([[], input], ([_0, input]) => [_0, input], () => [])), ([_0, input]) => [S.WithPropertyListMapping(_0), input]); | ||
| 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]); | ||
| 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]); | ||
| 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]); | ||
| export const WithElementList_0 = (input, result = []) => If(If(Token.Const(',', input), ([_0, input]) => If(WithValue(input), ([_1, input]) => [[_0, _1], input])), ([_0, input]) => WithElementList_0(input, [...result, _0]), () => [result, input]); | ||
| export const WithElementList = (input) => If(If(If(WithValue(input), ([_0, input]) => If(WithElementList_0(input), ([_1, input]) => If(If(Token.Const(',', input), ([_0, input]) => [[_0], input], () => [[], input]), ([_2, input]) => [[_0, _1, _2], input]))), ([_0, input]) => [_0, input], () => If([[], input], ([_0, input]) => [_0, input], () => [])), ([_0, input]) => [S.WithElementListMapping(_0), input]); | ||
| 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]); | ||
@@ -127,4 +124,4 @@ 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]); | ||
| export const Pattern = (input) => If(If(Token.Const('^', input), ([_0, input]) => If(PatternBody(input), ([_1, input]) => If(Token.Const('$', input), ([_2, input]) => [[_0, _1, _2], input]))), ([_0, input]) => [S.PatternMapping(_0), input]); | ||
| export const InterfaceDeclarationHeritageList_0 = (input, result = []) => If(If(Type(input), ([_0, input]) => If(Token.Const(',', input), ([_1, input]) => [[_0, _1], input])), ([_0, input]) => InterfaceDeclarationHeritageList_0(input, [...result, _0]), () => [result, input]); | ||
| export const InterfaceDeclarationHeritageList = (input) => If(If(InterfaceDeclarationHeritageList_0(input), ([_0, input]) => If(If(If(Type(input), ([_0, input]) => [[_0], input]), ([_0, input]) => [_0, input], () => If([[], input], ([_0, input]) => [_0, input], () => [])), ([_1, input]) => [[_0, _1], input])), ([_0, input]) => [S.InterfaceDeclarationHeritageListMapping(_0), input]); | ||
| export const InterfaceDeclarationHeritageList_0 = (input, result = []) => If(If(Token.Const(',', input), ([_0, input]) => If(Type(input), ([_1, input]) => [[_0, _1], input])), ([_0, input]) => InterfaceDeclarationHeritageList_0(input, [...result, _0]), () => [result, input]); | ||
| export const InterfaceDeclarationHeritageList = (input) => If(If(If(Type(input), ([_0, input]) => If(InterfaceDeclarationHeritageList_0(input), ([_1, input]) => If(If(Token.Const(',', input), ([_0, input]) => [[_0], input], () => [[], input]), ([_2, input]) => [[_0, _1, _2], input]))), ([_0, input]) => [_0, input], () => If([[], input], ([_0, input]) => [_0, input], () => [])), ([_0, input]) => [S.InterfaceDeclarationHeritageListMapping(_0), input]); | ||
| export const InterfaceDeclarationHeritage = (input) => If(If(If(Token.Const('extends', input), ([_0, input]) => If(InterfaceDeclarationHeritageList(input), ([_1, input]) => [[_0, _1], input])), ([_0, input]) => [_0, input], () => If([[], input], ([_0, input]) => [_0, input], () => [])), ([_0, input]) => [S.InterfaceDeclarationHeritageMapping(_0), input]); | ||
@@ -137,6 +134,6 @@ export const InterfaceDeclarationGeneric = (input) => If(If(Token.Const('interface', input), ([_0, input]) => If(Token.Ident(input), ([_1, input]) => If(GenericParameters(input), ([_2, input]) => If(InterfaceDeclarationHeritage(input), ([_3, input]) => If(Properties(input), ([_4, input]) => [[_0, _1, _2, _3, _4], input]))))), ([_0, input]) => [S.InterfaceDeclarationGenericMapping(_0), input]); | ||
| export const ModuleDeclarationDelimiter = (input) => If(If(If(Token.Const(';', input), ([_0, input]) => If(Token.Const('\n', input), ([_1, input]) => [[_0, _1], input])), ([_0, input]) => [_0, input], () => If(If(Token.Const(';', input), ([_0, input]) => [[_0], input]), ([_0, input]) => [_0, input], () => If(If(Token.Const('\n', input), ([_0, input]) => [[_0], input]), ([_0, input]) => [_0, input], () => []))), ([_0, input]) => [S.ModuleDeclarationDelimiterMapping(_0), input]); | ||
| export const ModuleDeclarationList_0 = (input, result = []) => If(If(ModuleDeclaration(input), ([_0, input]) => If(ModuleDeclarationDelimiter(input), ([_1, input]) => [[_0, _1], input])), ([_0, input]) => ModuleDeclarationList_0(input, [...result, _0]), () => [result, input]); | ||
| export const ModuleDeclarationList = (input) => If(If(ModuleDeclarationList_0(input), ([_0, input]) => If(If(If(ModuleDeclaration(input), ([_0, input]) => [[_0], input]), ([_0, input]) => [_0, input], () => If([[], input], ([_0, input]) => [_0, input], () => [])), ([_1, input]) => [[_0, _1], input])), ([_0, input]) => [S.ModuleDeclarationListMapping(_0), input]); | ||
| export const ModuleDeclarationList_0 = (input, result = []) => If(If(ModuleDeclarationDelimiter(input), ([_0, input]) => If(ModuleDeclaration(input), ([_1, input]) => [[_0, _1], input])), ([_0, input]) => ModuleDeclarationList_0(input, [...result, _0]), () => [result, input]); | ||
| export const ModuleDeclarationList = (input) => If(If(If(ModuleDeclaration(input), ([_0, input]) => If(ModuleDeclarationList_0(input), ([_1, input]) => If(If(ModuleDeclarationDelimiter(input), ([_0, input]) => [[_0], input], () => [[], input]), ([_2, input]) => [[_0, _1, _2], input]))), ([_0, input]) => [_0, input], () => If([[], input], ([_0, input]) => [_0, input], () => [])), ([_0, input]) => [S.ModuleDeclarationListMapping(_0), input]); | ||
| export const ModuleDeclaration = (input) => If(If(ExportKeyword(input), ([_0, input]) => If(If(InterfaceDeclarationGeneric(input), ([_0, input]) => [_0, input], () => If(InterfaceDeclaration(input), ([_0, input]) => [_0, input], () => If(TypeAliasDeclarationGeneric(input), ([_0, input]) => [_0, input], () => If(TypeAliasDeclaration(input), ([_0, input]) => [_0, input], () => [])))), ([_1, input]) => If(OptionalSemiColon(input), ([_2, input]) => [[_0, _1, _2], input]))), ([_0, input]) => [S.ModuleDeclarationMapping(_0), input]); | ||
| export const Module = (input) => If(If(ModuleDeclaration(input), ([_0, input]) => If(ModuleDeclarationList(input), ([_1, input]) => [[_0, _1], input])), ([_0, input]) => [S.ModuleMapping(_0), input]); | ||
| export const Script = (input) => If(If(Module(input), ([_0, input]) => [_0, input], () => If(GenericType(input), ([_0, input]) => [_0, input], () => If(Type(input), ([_0, input]) => [_0, input], () => []))), ([_0, input]) => [S.ScriptMapping(_0), input]); |
+28
-28
| { | ||
| "name": "typebox", | ||
| "description": "Json Schema Type Builder with Static Type Resolution for TypeScript", | ||
| "version": "1.3.8", | ||
| "version": "1.3.9", | ||
| "keywords": [ | ||
@@ -19,2 +19,6 @@ "typescript", | ||
| "exports": { | ||
| "./compile": { | ||
| "import": "./build/compile/index.mjs", | ||
| "default": "./build/compile/index.mjs" | ||
| }, | ||
| "./error": { | ||
@@ -24,10 +28,6 @@ "import": "./build/error/index.mjs", | ||
| }, | ||
| "./value": { | ||
| "import": "./build/value/index.mjs", | ||
| "default": "./build/value/index.mjs" | ||
| "./format": { | ||
| "import": "./build/format/index.mjs", | ||
| "default": "./build/format/index.mjs" | ||
| }, | ||
| "./system": { | ||
| "import": "./build/system/index.mjs", | ||
| "default": "./build/system/index.mjs" | ||
| }, | ||
| "./guard": { | ||
@@ -37,9 +37,9 @@ "import": "./build/guard/index.mjs", | ||
| }, | ||
| "./format": { | ||
| "import": "./build/format/index.mjs", | ||
| "default": "./build/format/index.mjs" | ||
| "./schema": { | ||
| "import": "./build/schema/index.mjs", | ||
| "default": "./build/schema/index.mjs" | ||
| }, | ||
| "./compile": { | ||
| "import": "./build/compile/index.mjs", | ||
| "default": "./build/compile/index.mjs" | ||
| "./system": { | ||
| "import": "./build/system/index.mjs", | ||
| "default": "./build/system/index.mjs" | ||
| }, | ||
@@ -50,5 +50,5 @@ "./type": { | ||
| }, | ||
| "./schema": { | ||
| "import": "./build/schema/index.mjs", | ||
| "default": "./build/schema/index.mjs" | ||
| "./value": { | ||
| "import": "./build/value/index.mjs", | ||
| "default": "./build/value/index.mjs" | ||
| }, | ||
@@ -62,19 +62,19 @@ ".": { | ||
| "*": { | ||
| "compile": [ | ||
| "./build/compile/index.d.mts" | ||
| ], | ||
| "error": [ | ||
| "./build/error/index.d.mts" | ||
| ], | ||
| "value": [ | ||
| "./build/value/index.d.mts" | ||
| "format": [ | ||
| "./build/format/index.d.mts" | ||
| ], | ||
| "system": [ | ||
| "./build/system/index.d.mts" | ||
| ], | ||
| "guard": [ | ||
| "./build/guard/index.d.mts" | ||
| ], | ||
| "format": [ | ||
| "./build/format/index.d.mts" | ||
| "schema": [ | ||
| "./build/schema/index.d.mts" | ||
| ], | ||
| "compile": [ | ||
| "./build/compile/index.d.mts" | ||
| "system": [ | ||
| "./build/system/index.d.mts" | ||
| ], | ||
@@ -84,4 +84,4 @@ "type": [ | ||
| ], | ||
| "schema": [ | ||
| "./build/schema/index.d.mts" | ||
| "value": [ | ||
| "./build/value/index.d.mts" | ||
| ], | ||
@@ -88,0 +88,0 @@ ".": [ |
Sorry, the diff of this file is too big to display
AI-detected potential code anomaly
Supply chain riskAI has identified unusual behaviors that may pose a security risk.
AI-detected potential code anomaly
Supply chain riskAI has identified unusual behaviors that may pose a security risk.
1465493
-0.05%16738
-0.06%