jet-schema
Advanced tools
Comparing version 1.0.4 to 1.0.5
import jetSchema from './jetSchema'; | ||
export type { TSchemaFnObjArg as TJetSchema, PublicInferType as inferType, } from './jetSchema'; | ||
export { transform } from './util'; | ||
export declare const schema: <T, U extends import("./jetSchema").TSchemaFnObjArg<T> = import("./jetSchema").TSchemaFnObjArg<T>, R extends unknown extends T ? [isOptional?: boolean | undefined, isNullable?: boolean | undefined, defaultVal?: boolean | null | undefined] : undefined extends T ? null extends T ? [isOptional: true, isNullable: true, defaultVal?: boolean | (T & null) | undefined] : [isOptional: true, isNullable?: false | undefined, defaultVal?: boolean | undefined] : null extends T ? [isOptional: true, isNullable?: false | undefined, defaultVal?: true | (T & null) | undefined] : [isOptional?: false | undefined, isNullable?: false | undefined, defaultVal?: true | undefined] = unknown extends T ? [isOptional?: boolean | undefined, isNullable?: boolean | undefined, defaultVal?: boolean | null | undefined] : undefined extends T ? null extends T ? [isOptional: true, isNullable: true, defaultVal?: boolean | (T & null) | undefined] : [isOptional: true, isNullable?: false | undefined, defaultVal?: boolean | undefined] : null extends T ? [isOptional: true, isNullable?: false | undefined, defaultVal?: true | (T & null) | undefined] : [isOptional?: false | undefined, isNullable?: false | undefined, defaultVal?: true | undefined]>(schemaFnObjArg: U, ...rest: R) => import("./jetSchema").ISchema<unknown extends T ? R[0] extends infer T_1 ? T_1 extends R[0] ? T_1 extends true ? (R[1] extends infer T_2 ? T_2 extends R[1] ? T_2 extends true ? NonNullable<Exclude<{ [K_1 in keyof { [K in keyof U]: U[K] extends unknown[] ? U[K][0] : U[K] extends DateConstructor ? Date : U[K] extends import("./util").TFunc ? U[K] extends infer T_3 ? T_3 extends U[K] ? T_3 extends (x: any) => x is infer U_1 ? U_1 : never : never : never : U[K] extends import("./jetSchema").ISchema<unknown> ? U[K]["test"] extends infer T_4 ? T_4 extends U[K]["test"] ? T_4 extends (x: any) => x is infer U_1 ? U_1 : never : never : never : U[K] extends string | number ? { | ||
export declare const schema: <T, U extends import("./jetSchema").TSchemaFnObjArg<T> = import("./jetSchema").TSchemaFnObjArg<T>, R extends unknown extends T ? [isOptional?: boolean | undefined, isNullable?: boolean | undefined, defaultVal?: boolean | null | undefined] : undefined extends T ? null extends T ? [isOptional: true, isNullable: true, defaultVal?: boolean | (T & null) | undefined] : [isOptional: true, isNullable?: false | undefined, defaultVal?: boolean | undefined] : null extends T ? [isOptional: false, isNullable?: true | undefined, defaultVal?: true | (T & null) | undefined] : [isOptional?: false | undefined, isNullable?: false | undefined, defaultVal?: true | undefined] = unknown extends T ? [isOptional?: boolean | undefined, isNullable?: boolean | undefined, defaultVal?: boolean | null | undefined] : undefined extends T ? null extends T ? [isOptional: true, isNullable: true, defaultVal?: boolean | (T & null) | undefined] : [isOptional: true, isNullable?: false | undefined, defaultVal?: boolean | undefined] : null extends T ? [isOptional: false, isNullable?: true | undefined, defaultVal?: true | (T & null) | undefined] : [isOptional?: false | undefined, isNullable?: false | undefined, defaultVal?: true | undefined]>(schemaFnObjArg: U, ...rest: R) => import("./jetSchema").ISchema<unknown extends T ? R[0] extends infer T_1 ? T_1 extends R[0] ? T_1 extends true ? (R[1] extends infer T_2 ? T_2 extends R[1] ? T_2 extends true ? NonNullable<Exclude<{ [K_1 in keyof { [K in keyof U]: U[K] extends unknown[] ? U[K][0] : U[K] extends DateConstructor ? Date : U[K] extends import("./util").TFunc ? U[K] extends infer T_3 ? T_3 extends U[K] ? T_3 extends (x: any) => x is infer U_1 ? U_1 : never : never : never : U[K] extends import("./jetSchema").ISchema<unknown, {}> ? U[K]["test"] extends infer T_4 ? T_4 extends U[K]["test"] ? T_4 extends (x: any) => x is infer U_1 ? U_1 : never : never : never : U[K] extends string | number ? { | ||
[x: string]: string | number; | ||
} | (((arg: unknown) => arg is U[K]) | [U[K], (arg: unknown) => arg is U[K]]) : never; } as undefined extends { [K in keyof U]: U[K] extends unknown[] ? U[K][0] : U[K] extends DateConstructor ? Date : U[K] extends import("./util").TFunc ? U[K] extends infer T_3 ? T_3 extends U[K] ? T_3 extends (x: any) => x is infer U_1 ? U_1 : never : never : never : U[K] extends import("./jetSchema").ISchema<unknown> ? U[K]["test"] extends infer T_4 ? T_4 extends U[K]["test"] ? T_4 extends (x: any) => x is infer U_1 ? U_1 : never : never : never : U[K] extends string | number ? { | ||
} | (((arg: unknown) => arg is U[K]) | [U[K], (arg: unknown) => arg is U[K]]) : never; } as undefined extends { [K in keyof U]: U[K] extends unknown[] ? U[K][0] : U[K] extends DateConstructor ? Date : U[K] extends import("./util").TFunc ? U[K] extends infer T_3 ? T_3 extends U[K] ? T_3 extends (x: any) => x is infer U_1 ? U_1 : never : never : never : U[K] extends import("./jetSchema").ISchema<unknown, {}> ? U[K]["test"] extends infer T_4 ? T_4 extends U[K]["test"] ? T_4 extends (x: any) => x is infer U_1 ? U_1 : never : never : never : U[K] extends string | number ? { | ||
[x: string]: string | number; | ||
} | (((arg: unknown) => arg is U[K]) | [U[K], (arg: unknown) => arg is U[K]]) : never; }[K_1] ? K_1 : never]?: { [K in keyof U]: U[K] extends unknown[] ? U[K][0] : U[K] extends DateConstructor ? Date : U[K] extends import("./util").TFunc ? U[K] extends infer T_3 ? T_3 extends U[K] ? T_3 extends (x: any) => x is infer U_1 ? U_1 : never : never : never : U[K] extends import("./jetSchema").ISchema<unknown> ? U[K]["test"] extends infer T_4 ? T_4 extends U[K]["test"] ? T_4 extends (x: any) => x is infer U_1 ? U_1 : never : never : never : U[K] extends string | number ? { | ||
} | (((arg: unknown) => arg is U[K]) | [U[K], (arg: unknown) => arg is U[K]]) : never; }[K_1] ? K_1 : never]?: { [K in keyof U]: U[K] extends unknown[] ? U[K][0] : U[K] extends DateConstructor ? Date : U[K] extends import("./util").TFunc ? U[K] extends infer T_3 ? T_3 extends U[K] ? T_3 extends (x: any) => x is infer U_1 ? U_1 : never : never : never : U[K] extends import("./jetSchema").ISchema<unknown, {}> ? U[K]["test"] extends infer T_4 ? T_4 extends U[K]["test"] ? T_4 extends (x: any) => x is infer U_1 ? U_1 : never : never : never : U[K] extends string | number ? { | ||
[x: string]: string | number; | ||
} | (((arg: unknown) => arg is U[K]) | [U[K], (arg: unknown) => arg is U[K]]) : never; }[K_1] | undefined; } & { [K_2 in keyof { [K in keyof U]: U[K] extends unknown[] ? U[K][0] : U[K] extends DateConstructor ? Date : U[K] extends import("./util").TFunc ? U[K] extends infer T_3 ? T_3 extends U[K] ? T_3 extends (x: any) => x is infer U_1 ? U_1 : never : never : never : U[K] extends import("./jetSchema").ISchema<unknown> ? U[K]["test"] extends infer T_4 ? T_4 extends U[K]["test"] ? T_4 extends (x: any) => x is infer U_1 ? U_1 : never : never : never : U[K] extends string | number ? { | ||
} | (((arg: unknown) => arg is U[K]) | [U[K], (arg: unknown) => arg is U[K]]) : never; }[K_1] | undefined; } & { [K_2 in keyof { [K in keyof U]: U[K] extends unknown[] ? U[K][0] : U[K] extends DateConstructor ? Date : U[K] extends import("./util").TFunc ? U[K] extends infer T_3 ? T_3 extends U[K] ? T_3 extends (x: any) => x is infer U_1 ? U_1 : never : never : never : U[K] extends import("./jetSchema").ISchema<unknown, {}> ? U[K]["test"] extends infer T_4 ? T_4 extends U[K]["test"] ? T_4 extends (x: any) => x is infer U_1 ? U_1 : never : never : never : U[K] extends string | number ? { | ||
[x: string]: string | number; | ||
} | (((arg: unknown) => arg is U[K]) | [U[K], (arg: unknown) => arg is U[K]]) : never; } as undefined extends { [K in keyof U]: U[K] extends unknown[] ? U[K][0] : U[K] extends DateConstructor ? Date : U[K] extends import("./util").TFunc ? U[K] extends infer T_3 ? T_3 extends U[K] ? T_3 extends (x: any) => x is infer U_1 ? U_1 : never : never : never : U[K] extends import("./jetSchema").ISchema<unknown> ? U[K]["test"] extends infer T_4 ? T_4 extends U[K]["test"] ? T_4 extends (x: any) => x is infer U_1 ? U_1 : never : never : never : U[K] extends string | number ? { | ||
} | (((arg: unknown) => arg is U[K]) | [U[K], (arg: unknown) => arg is U[K]]) : never; } as undefined extends { [K in keyof U]: U[K] extends unknown[] ? U[K][0] : U[K] extends DateConstructor ? Date : U[K] extends import("./util").TFunc ? U[K] extends infer T_3 ? T_3 extends U[K] ? T_3 extends (x: any) => x is infer U_1 ? U_1 : never : never : never : U[K] extends import("./jetSchema").ISchema<unknown, {}> ? U[K]["test"] extends infer T_4 ? T_4 extends U[K]["test"] ? T_4 extends (x: any) => x is infer U_1 ? U_1 : never : never : never : U[K] extends string | number ? { | ||
[x: string]: string | number; | ||
} | (((arg: unknown) => arg is U[K]) | [U[K], (arg: unknown) => arg is U[K]]) : never; }[K_2] ? never : K_2]: { [K in keyof U]: U[K] extends unknown[] ? U[K][0] : U[K] extends DateConstructor ? Date : U[K] extends import("./util").TFunc ? U[K] extends infer T_3 ? T_3 extends U[K] ? T_3 extends (x: any) => x is infer U_1 ? U_1 : never : never : never : U[K] extends import("./jetSchema").ISchema<unknown> ? U[K]["test"] extends infer T_4 ? T_4 extends U[K]["test"] ? T_4 extends (x: any) => x is infer U_1 ? U_1 : never : never : never : U[K] extends string | number ? { | ||
} | (((arg: unknown) => arg is U[K]) | [U[K], (arg: unknown) => arg is U[K]]) : never; }[K_2] ? never : K_2]: { [K in keyof U]: U[K] extends unknown[] ? U[K][0] : U[K] extends DateConstructor ? Date : U[K] extends import("./util").TFunc ? U[K] extends infer T_3 ? T_3 extends U[K] ? T_3 extends (x: any) => x is infer U_1 ? U_1 : never : never : never : U[K] extends import("./jetSchema").ISchema<unknown, {}> ? U[K]["test"] extends infer T_4 ? T_4 extends U[K]["test"] ? T_4 extends (x: any) => x is infer U_1 ? U_1 : never : never : never : U[K] extends string | number ? { | ||
[x: string]: string | number; | ||
} | (((arg: unknown) => arg is U[K]) | [U[K], (arg: unknown) => arg is U[K]]) : never; }[K_2]; }, undefined>> | null : NonNullable<Exclude<{ [K_1 in keyof { [K in keyof U]: U[K] extends unknown[] ? U[K][0] : U[K] extends DateConstructor ? Date : U[K] extends import("./util").TFunc ? U[K] extends infer T_3 ? T_3 extends U[K] ? T_3 extends (x: any) => x is infer U_1 ? U_1 : never : never : never : U[K] extends import("./jetSchema").ISchema<unknown> ? U[K]["test"] extends infer T_4 ? T_4 extends U[K]["test"] ? T_4 extends (x: any) => x is infer U_1 ? U_1 : never : never : never : U[K] extends string | number ? { | ||
} | (((arg: unknown) => arg is U[K]) | [U[K], (arg: unknown) => arg is U[K]]) : never; }[K_2]; }, undefined>> | null : NonNullable<Exclude<{ [K_1 in keyof { [K in keyof U]: U[K] extends unknown[] ? U[K][0] : U[K] extends DateConstructor ? Date : U[K] extends import("./util").TFunc ? U[K] extends infer T_3 ? T_3 extends U[K] ? T_3 extends (x: any) => x is infer U_1 ? U_1 : never : never : never : U[K] extends import("./jetSchema").ISchema<unknown, {}> ? U[K]["test"] extends infer T_4 ? T_4 extends U[K]["test"] ? T_4 extends (x: any) => x is infer U_1 ? U_1 : never : never : never : U[K] extends string | number ? { | ||
[x: string]: string | number; | ||
} | (((arg: unknown) => arg is U[K]) | [U[K], (arg: unknown) => arg is U[K]]) : never; } as undefined extends { [K in keyof U]: U[K] extends unknown[] ? U[K][0] : U[K] extends DateConstructor ? Date : U[K] extends import("./util").TFunc ? U[K] extends infer T_3 ? T_3 extends U[K] ? T_3 extends (x: any) => x is infer U_1 ? U_1 : never : never : never : U[K] extends import("./jetSchema").ISchema<unknown> ? U[K]["test"] extends infer T_4 ? T_4 extends U[K]["test"] ? T_4 extends (x: any) => x is infer U_1 ? U_1 : never : never : never : U[K] extends string | number ? { | ||
} | (((arg: unknown) => arg is U[K]) | [U[K], (arg: unknown) => arg is U[K]]) : never; } as undefined extends { [K in keyof U]: U[K] extends unknown[] ? U[K][0] : U[K] extends DateConstructor ? Date : U[K] extends import("./util").TFunc ? U[K] extends infer T_3 ? T_3 extends U[K] ? T_3 extends (x: any) => x is infer U_1 ? U_1 : never : never : never : U[K] extends import("./jetSchema").ISchema<unknown, {}> ? U[K]["test"] extends infer T_4 ? T_4 extends U[K]["test"] ? T_4 extends (x: any) => x is infer U_1 ? U_1 : never : never : never : U[K] extends string | number ? { | ||
[x: string]: string | number; | ||
} | (((arg: unknown) => arg is U[K]) | [U[K], (arg: unknown) => arg is U[K]]) : never; }[K_1] ? K_1 : never]?: { [K in keyof U]: U[K] extends unknown[] ? U[K][0] : U[K] extends DateConstructor ? Date : U[K] extends import("./util").TFunc ? U[K] extends infer T_3 ? T_3 extends U[K] ? T_3 extends (x: any) => x is infer U_1 ? U_1 : never : never : never : U[K] extends import("./jetSchema").ISchema<unknown> ? U[K]["test"] extends infer T_4 ? T_4 extends U[K]["test"] ? T_4 extends (x: any) => x is infer U_1 ? U_1 : never : never : never : U[K] extends string | number ? { | ||
} | (((arg: unknown) => arg is U[K]) | [U[K], (arg: unknown) => arg is U[K]]) : never; }[K_1] ? K_1 : never]?: { [K in keyof U]: U[K] extends unknown[] ? U[K][0] : U[K] extends DateConstructor ? Date : U[K] extends import("./util").TFunc ? U[K] extends infer T_3 ? T_3 extends U[K] ? T_3 extends (x: any) => x is infer U_1 ? U_1 : never : never : never : U[K] extends import("./jetSchema").ISchema<unknown, {}> ? U[K]["test"] extends infer T_4 ? T_4 extends U[K]["test"] ? T_4 extends (x: any) => x is infer U_1 ? U_1 : never : never : never : U[K] extends string | number ? { | ||
[x: string]: string | number; | ||
} | (((arg: unknown) => arg is U[K]) | [U[K], (arg: unknown) => arg is U[K]]) : never; }[K_1] | undefined; } & { [K_2 in keyof { [K in keyof U]: U[K] extends unknown[] ? U[K][0] : U[K] extends DateConstructor ? Date : U[K] extends import("./util").TFunc ? U[K] extends infer T_3 ? T_3 extends U[K] ? T_3 extends (x: any) => x is infer U_1 ? U_1 : never : never : never : U[K] extends import("./jetSchema").ISchema<unknown> ? U[K]["test"] extends infer T_4 ? T_4 extends U[K]["test"] ? T_4 extends (x: any) => x is infer U_1 ? U_1 : never : never : never : U[K] extends string | number ? { | ||
} | (((arg: unknown) => arg is U[K]) | [U[K], (arg: unknown) => arg is U[K]]) : never; }[K_1] | undefined; } & { [K_2 in keyof { [K in keyof U]: U[K] extends unknown[] ? U[K][0] : U[K] extends DateConstructor ? Date : U[K] extends import("./util").TFunc ? U[K] extends infer T_3 ? T_3 extends U[K] ? T_3 extends (x: any) => x is infer U_1 ? U_1 : never : never : never : U[K] extends import("./jetSchema").ISchema<unknown, {}> ? U[K]["test"] extends infer T_4 ? T_4 extends U[K]["test"] ? T_4 extends (x: any) => x is infer U_1 ? U_1 : never : never : never : U[K] extends string | number ? { | ||
[x: string]: string | number; | ||
} | (((arg: unknown) => arg is U[K]) | [U[K], (arg: unknown) => arg is U[K]]) : never; } as undefined extends { [K in keyof U]: U[K] extends unknown[] ? U[K][0] : U[K] extends DateConstructor ? Date : U[K] extends import("./util").TFunc ? U[K] extends infer T_3 ? T_3 extends U[K] ? T_3 extends (x: any) => x is infer U_1 ? U_1 : never : never : never : U[K] extends import("./jetSchema").ISchema<unknown> ? U[K]["test"] extends infer T_4 ? T_4 extends U[K]["test"] ? T_4 extends (x: any) => x is infer U_1 ? U_1 : never : never : never : U[K] extends string | number ? { | ||
} | (((arg: unknown) => arg is U[K]) | [U[K], (arg: unknown) => arg is U[K]]) : never; } as undefined extends { [K in keyof U]: U[K] extends unknown[] ? U[K][0] : U[K] extends DateConstructor ? Date : U[K] extends import("./util").TFunc ? U[K] extends infer T_3 ? T_3 extends U[K] ? T_3 extends (x: any) => x is infer U_1 ? U_1 : never : never : never : U[K] extends import("./jetSchema").ISchema<unknown, {}> ? U[K]["test"] extends infer T_4 ? T_4 extends U[K]["test"] ? T_4 extends (x: any) => x is infer U_1 ? U_1 : never : never : never : U[K] extends string | number ? { | ||
[x: string]: string | number; | ||
} | (((arg: unknown) => arg is U[K]) | [U[K], (arg: unknown) => arg is U[K]]) : never; }[K_2] ? never : K_2]: { [K in keyof U]: U[K] extends unknown[] ? U[K][0] : U[K] extends DateConstructor ? Date : U[K] extends import("./util").TFunc ? U[K] extends infer T_3 ? T_3 extends U[K] ? T_3 extends (x: any) => x is infer U_1 ? U_1 : never : never : never : U[K] extends import("./jetSchema").ISchema<unknown> ? U[K]["test"] extends infer T_4 ? T_4 extends U[K]["test"] ? T_4 extends (x: any) => x is infer U_1 ? U_1 : never : never : never : U[K] extends string | number ? { | ||
} | (((arg: unknown) => arg is U[K]) | [U[K], (arg: unknown) => arg is U[K]]) : never; }[K_2] ? never : K_2]: { [K in keyof U]: U[K] extends unknown[] ? U[K][0] : U[K] extends DateConstructor ? Date : U[K] extends import("./util").TFunc ? U[K] extends infer T_3 ? T_3 extends U[K] ? T_3 extends (x: any) => x is infer U_1 ? U_1 : never : never : never : U[K] extends import("./jetSchema").ISchema<unknown, {}> ? U[K]["test"] extends infer T_4 ? T_4 extends U[K]["test"] ? T_4 extends (x: any) => x is infer U_1 ? U_1 : never : never : never : U[K] extends string | number ? { | ||
[x: string]: string | number; | ||
} | (((arg: unknown) => arg is U[K]) | [U[K], (arg: unknown) => arg is U[K]]) : never; }[K_2]; }, undefined>> : never : never) | undefined : R[1] extends infer T_2 ? T_2 extends R[1] ? T_2 extends true ? NonNullable<Exclude<{ [K_1 in keyof { [K in keyof U]: U[K] extends unknown[] ? U[K][0] : U[K] extends DateConstructor ? Date : U[K] extends import("./util").TFunc ? U[K] extends infer T_3 ? T_3 extends U[K] ? T_3 extends (x: any) => x is infer U_1 ? U_1 : never : never : never : U[K] extends import("./jetSchema").ISchema<unknown> ? U[K]["test"] extends infer T_4 ? T_4 extends U[K]["test"] ? T_4 extends (x: any) => x is infer U_1 ? U_1 : never : never : never : U[K] extends string | number ? { | ||
} | (((arg: unknown) => arg is U[K]) | [U[K], (arg: unknown) => arg is U[K]]) : never; }[K_2]; }, undefined>> : never : never) | undefined : R[1] extends infer T_2 ? T_2 extends R[1] ? T_2 extends true ? NonNullable<Exclude<{ [K_1 in keyof { [K in keyof U]: U[K] extends unknown[] ? U[K][0] : U[K] extends DateConstructor ? Date : U[K] extends import("./util").TFunc ? U[K] extends infer T_3 ? T_3 extends U[K] ? T_3 extends (x: any) => x is infer U_1 ? U_1 : never : never : never : U[K] extends import("./jetSchema").ISchema<unknown, {}> ? U[K]["test"] extends infer T_4 ? T_4 extends U[K]["test"] ? T_4 extends (x: any) => x is infer U_1 ? U_1 : never : never : never : U[K] extends string | number ? { | ||
[x: string]: string | number; | ||
} | (((arg: unknown) => arg is U[K]) | [U[K], (arg: unknown) => arg is U[K]]) : never; } as undefined extends { [K in keyof U]: U[K] extends unknown[] ? U[K][0] : U[K] extends DateConstructor ? Date : U[K] extends import("./util").TFunc ? U[K] extends infer T_3 ? T_3 extends U[K] ? T_3 extends (x: any) => x is infer U_1 ? U_1 : never : never : never : U[K] extends import("./jetSchema").ISchema<unknown> ? U[K]["test"] extends infer T_4 ? T_4 extends U[K]["test"] ? T_4 extends (x: any) => x is infer U_1 ? U_1 : never : never : never : U[K] extends string | number ? { | ||
} | (((arg: unknown) => arg is U[K]) | [U[K], (arg: unknown) => arg is U[K]]) : never; } as undefined extends { [K in keyof U]: U[K] extends unknown[] ? U[K][0] : U[K] extends DateConstructor ? Date : U[K] extends import("./util").TFunc ? U[K] extends infer T_3 ? T_3 extends U[K] ? T_3 extends (x: any) => x is infer U_1 ? U_1 : never : never : never : U[K] extends import("./jetSchema").ISchema<unknown, {}> ? U[K]["test"] extends infer T_4 ? T_4 extends U[K]["test"] ? T_4 extends (x: any) => x is infer U_1 ? U_1 : never : never : never : U[K] extends string | number ? { | ||
[x: string]: string | number; | ||
} | (((arg: unknown) => arg is U[K]) | [U[K], (arg: unknown) => arg is U[K]]) : never; }[K_1] ? K_1 : never]?: { [K in keyof U]: U[K] extends unknown[] ? U[K][0] : U[K] extends DateConstructor ? Date : U[K] extends import("./util").TFunc ? U[K] extends infer T_3 ? T_3 extends U[K] ? T_3 extends (x: any) => x is infer U_1 ? U_1 : never : never : never : U[K] extends import("./jetSchema").ISchema<unknown> ? U[K]["test"] extends infer T_4 ? T_4 extends U[K]["test"] ? T_4 extends (x: any) => x is infer U_1 ? U_1 : never : never : never : U[K] extends string | number ? { | ||
} | (((arg: unknown) => arg is U[K]) | [U[K], (arg: unknown) => arg is U[K]]) : never; }[K_1] ? K_1 : never]?: { [K in keyof U]: U[K] extends unknown[] ? U[K][0] : U[K] extends DateConstructor ? Date : U[K] extends import("./util").TFunc ? U[K] extends infer T_3 ? T_3 extends U[K] ? T_3 extends (x: any) => x is infer U_1 ? U_1 : never : never : never : U[K] extends import("./jetSchema").ISchema<unknown, {}> ? U[K]["test"] extends infer T_4 ? T_4 extends U[K]["test"] ? T_4 extends (x: any) => x is infer U_1 ? U_1 : never : never : never : U[K] extends string | number ? { | ||
[x: string]: string | number; | ||
} | (((arg: unknown) => arg is U[K]) | [U[K], (arg: unknown) => arg is U[K]]) : never; }[K_1] | undefined; } & { [K_2 in keyof { [K in keyof U]: U[K] extends unknown[] ? U[K][0] : U[K] extends DateConstructor ? Date : U[K] extends import("./util").TFunc ? U[K] extends infer T_3 ? T_3 extends U[K] ? T_3 extends (x: any) => x is infer U_1 ? U_1 : never : never : never : U[K] extends import("./jetSchema").ISchema<unknown> ? U[K]["test"] extends infer T_4 ? T_4 extends U[K]["test"] ? T_4 extends (x: any) => x is infer U_1 ? U_1 : never : never : never : U[K] extends string | number ? { | ||
} | (((arg: unknown) => arg is U[K]) | [U[K], (arg: unknown) => arg is U[K]]) : never; }[K_1] | undefined; } & { [K_2 in keyof { [K in keyof U]: U[K] extends unknown[] ? U[K][0] : U[K] extends DateConstructor ? Date : U[K] extends import("./util").TFunc ? U[K] extends infer T_3 ? T_3 extends U[K] ? T_3 extends (x: any) => x is infer U_1 ? U_1 : never : never : never : U[K] extends import("./jetSchema").ISchema<unknown, {}> ? U[K]["test"] extends infer T_4 ? T_4 extends U[K]["test"] ? T_4 extends (x: any) => x is infer U_1 ? U_1 : never : never : never : U[K] extends string | number ? { | ||
[x: string]: string | number; | ||
} | (((arg: unknown) => arg is U[K]) | [U[K], (arg: unknown) => arg is U[K]]) : never; } as undefined extends { [K in keyof U]: U[K] extends unknown[] ? U[K][0] : U[K] extends DateConstructor ? Date : U[K] extends import("./util").TFunc ? U[K] extends infer T_3 ? T_3 extends U[K] ? T_3 extends (x: any) => x is infer U_1 ? U_1 : never : never : never : U[K] extends import("./jetSchema").ISchema<unknown> ? U[K]["test"] extends infer T_4 ? T_4 extends U[K]["test"] ? T_4 extends (x: any) => x is infer U_1 ? U_1 : never : never : never : U[K] extends string | number ? { | ||
} | (((arg: unknown) => arg is U[K]) | [U[K], (arg: unknown) => arg is U[K]]) : never; } as undefined extends { [K in keyof U]: U[K] extends unknown[] ? U[K][0] : U[K] extends DateConstructor ? Date : U[K] extends import("./util").TFunc ? U[K] extends infer T_3 ? T_3 extends U[K] ? T_3 extends (x: any) => x is infer U_1 ? U_1 : never : never : never : U[K] extends import("./jetSchema").ISchema<unknown, {}> ? U[K]["test"] extends infer T_4 ? T_4 extends U[K]["test"] ? T_4 extends (x: any) => x is infer U_1 ? U_1 : never : never : never : U[K] extends string | number ? { | ||
[x: string]: string | number; | ||
} | (((arg: unknown) => arg is U[K]) | [U[K], (arg: unknown) => arg is U[K]]) : never; }[K_2] ? never : K_2]: { [K in keyof U]: U[K] extends unknown[] ? U[K][0] : U[K] extends DateConstructor ? Date : U[K] extends import("./util").TFunc ? U[K] extends infer T_3 ? T_3 extends U[K] ? T_3 extends (x: any) => x is infer U_1 ? U_1 : never : never : never : U[K] extends import("./jetSchema").ISchema<unknown> ? U[K]["test"] extends infer T_4 ? T_4 extends U[K]["test"] ? T_4 extends (x: any) => x is infer U_1 ? U_1 : never : never : never : U[K] extends string | number ? { | ||
} | (((arg: unknown) => arg is U[K]) | [U[K], (arg: unknown) => arg is U[K]]) : never; }[K_2] ? never : K_2]: { [K in keyof U]: U[K] extends unknown[] ? U[K][0] : U[K] extends DateConstructor ? Date : U[K] extends import("./util").TFunc ? U[K] extends infer T_3 ? T_3 extends U[K] ? T_3 extends (x: any) => x is infer U_1 ? U_1 : never : never : never : U[K] extends import("./jetSchema").ISchema<unknown, {}> ? U[K]["test"] extends infer T_4 ? T_4 extends U[K]["test"] ? T_4 extends (x: any) => x is infer U_1 ? U_1 : never : never : never : U[K] extends string | number ? { | ||
[x: string]: string | number; | ||
} | (((arg: unknown) => arg is U[K]) | [U[K], (arg: unknown) => arg is U[K]]) : never; }[K_2]; }, undefined>> | null : NonNullable<Exclude<{ [K_1 in keyof { [K in keyof U]: U[K] extends unknown[] ? U[K][0] : U[K] extends DateConstructor ? Date : U[K] extends import("./util").TFunc ? U[K] extends infer T_3 ? T_3 extends U[K] ? T_3 extends (x: any) => x is infer U_1 ? U_1 : never : never : never : U[K] extends import("./jetSchema").ISchema<unknown> ? U[K]["test"] extends infer T_4 ? T_4 extends U[K]["test"] ? T_4 extends (x: any) => x is infer U_1 ? U_1 : never : never : never : U[K] extends string | number ? { | ||
} | (((arg: unknown) => arg is U[K]) | [U[K], (arg: unknown) => arg is U[K]]) : never; }[K_2]; }, undefined>> | null : NonNullable<Exclude<{ [K_1 in keyof { [K in keyof U]: U[K] extends unknown[] ? U[K][0] : U[K] extends DateConstructor ? Date : U[K] extends import("./util").TFunc ? U[K] extends infer T_3 ? T_3 extends U[K] ? T_3 extends (x: any) => x is infer U_1 ? U_1 : never : never : never : U[K] extends import("./jetSchema").ISchema<unknown, {}> ? U[K]["test"] extends infer T_4 ? T_4 extends U[K]["test"] ? T_4 extends (x: any) => x is infer U_1 ? U_1 : never : never : never : U[K] extends string | number ? { | ||
[x: string]: string | number; | ||
} | (((arg: unknown) => arg is U[K]) | [U[K], (arg: unknown) => arg is U[K]]) : never; } as undefined extends { [K in keyof U]: U[K] extends unknown[] ? U[K][0] : U[K] extends DateConstructor ? Date : U[K] extends import("./util").TFunc ? U[K] extends infer T_3 ? T_3 extends U[K] ? T_3 extends (x: any) => x is infer U_1 ? U_1 : never : never : never : U[K] extends import("./jetSchema").ISchema<unknown> ? U[K]["test"] extends infer T_4 ? T_4 extends U[K]["test"] ? T_4 extends (x: any) => x is infer U_1 ? U_1 : never : never : never : U[K] extends string | number ? { | ||
} | (((arg: unknown) => arg is U[K]) | [U[K], (arg: unknown) => arg is U[K]]) : never; } as undefined extends { [K in keyof U]: U[K] extends unknown[] ? U[K][0] : U[K] extends DateConstructor ? Date : U[K] extends import("./util").TFunc ? U[K] extends infer T_3 ? T_3 extends U[K] ? T_3 extends (x: any) => x is infer U_1 ? U_1 : never : never : never : U[K] extends import("./jetSchema").ISchema<unknown, {}> ? U[K]["test"] extends infer T_4 ? T_4 extends U[K]["test"] ? T_4 extends (x: any) => x is infer U_1 ? U_1 : never : never : never : U[K] extends string | number ? { | ||
[x: string]: string | number; | ||
} | (((arg: unknown) => arg is U[K]) | [U[K], (arg: unknown) => arg is U[K]]) : never; }[K_1] ? K_1 : never]?: { [K in keyof U]: U[K] extends unknown[] ? U[K][0] : U[K] extends DateConstructor ? Date : U[K] extends import("./util").TFunc ? U[K] extends infer T_3 ? T_3 extends U[K] ? T_3 extends (x: any) => x is infer U_1 ? U_1 : never : never : never : U[K] extends import("./jetSchema").ISchema<unknown> ? U[K]["test"] extends infer T_4 ? T_4 extends U[K]["test"] ? T_4 extends (x: any) => x is infer U_1 ? U_1 : never : never : never : U[K] extends string | number ? { | ||
} | (((arg: unknown) => arg is U[K]) | [U[K], (arg: unknown) => arg is U[K]]) : never; }[K_1] ? K_1 : never]?: { [K in keyof U]: U[K] extends unknown[] ? U[K][0] : U[K] extends DateConstructor ? Date : U[K] extends import("./util").TFunc ? U[K] extends infer T_3 ? T_3 extends U[K] ? T_3 extends (x: any) => x is infer U_1 ? U_1 : never : never : never : U[K] extends import("./jetSchema").ISchema<unknown, {}> ? U[K]["test"] extends infer T_4 ? T_4 extends U[K]["test"] ? T_4 extends (x: any) => x is infer U_1 ? U_1 : never : never : never : U[K] extends string | number ? { | ||
[x: string]: string | number; | ||
} | (((arg: unknown) => arg is U[K]) | [U[K], (arg: unknown) => arg is U[K]]) : never; }[K_1] | undefined; } & { [K_2 in keyof { [K in keyof U]: U[K] extends unknown[] ? U[K][0] : U[K] extends DateConstructor ? Date : U[K] extends import("./util").TFunc ? U[K] extends infer T_3 ? T_3 extends U[K] ? T_3 extends (x: any) => x is infer U_1 ? U_1 : never : never : never : U[K] extends import("./jetSchema").ISchema<unknown> ? U[K]["test"] extends infer T_4 ? T_4 extends U[K]["test"] ? T_4 extends (x: any) => x is infer U_1 ? U_1 : never : never : never : U[K] extends string | number ? { | ||
} | (((arg: unknown) => arg is U[K]) | [U[K], (arg: unknown) => arg is U[K]]) : never; }[K_1] | undefined; } & { [K_2 in keyof { [K in keyof U]: U[K] extends unknown[] ? U[K][0] : U[K] extends DateConstructor ? Date : U[K] extends import("./util").TFunc ? U[K] extends infer T_3 ? T_3 extends U[K] ? T_3 extends (x: any) => x is infer U_1 ? U_1 : never : never : never : U[K] extends import("./jetSchema").ISchema<unknown, {}> ? U[K]["test"] extends infer T_4 ? T_4 extends U[K]["test"] ? T_4 extends (x: any) => x is infer U_1 ? U_1 : never : never : never : U[K] extends string | number ? { | ||
[x: string]: string | number; | ||
} | (((arg: unknown) => arg is U[K]) | [U[K], (arg: unknown) => arg is U[K]]) : never; } as undefined extends { [K in keyof U]: U[K] extends unknown[] ? U[K][0] : U[K] extends DateConstructor ? Date : U[K] extends import("./util").TFunc ? U[K] extends infer T_3 ? T_3 extends U[K] ? T_3 extends (x: any) => x is infer U_1 ? U_1 : never : never : never : U[K] extends import("./jetSchema").ISchema<unknown> ? U[K]["test"] extends infer T_4 ? T_4 extends U[K]["test"] ? T_4 extends (x: any) => x is infer U_1 ? U_1 : never : never : never : U[K] extends string | number ? { | ||
} | (((arg: unknown) => arg is U[K]) | [U[K], (arg: unknown) => arg is U[K]]) : never; } as undefined extends { [K in keyof U]: U[K] extends unknown[] ? U[K][0] : U[K] extends DateConstructor ? Date : U[K] extends import("./util").TFunc ? U[K] extends infer T_3 ? T_3 extends U[K] ? T_3 extends (x: any) => x is infer U_1 ? U_1 : never : never : never : U[K] extends import("./jetSchema").ISchema<unknown, {}> ? U[K]["test"] extends infer T_4 ? T_4 extends U[K]["test"] ? T_4 extends (x: any) => x is infer U_1 ? U_1 : never : never : never : U[K] extends string | number ? { | ||
[x: string]: string | number; | ||
} | (((arg: unknown) => arg is U[K]) | [U[K], (arg: unknown) => arg is U[K]]) : never; }[K_2] ? never : K_2]: { [K in keyof U]: U[K] extends unknown[] ? U[K][0] : U[K] extends DateConstructor ? Date : U[K] extends import("./util").TFunc ? U[K] extends infer T_3 ? T_3 extends U[K] ? T_3 extends (x: any) => x is infer U_1 ? U_1 : never : never : never : U[K] extends import("./jetSchema").ISchema<unknown> ? U[K]["test"] extends infer T_4 ? T_4 extends U[K]["test"] ? T_4 extends (x: any) => x is infer U_1 ? U_1 : never : never : never : U[K] extends string | number ? { | ||
} | (((arg: unknown) => arg is U[K]) | [U[K], (arg: unknown) => arg is U[K]]) : never; }[K_2] ? never : K_2]: { [K in keyof U]: U[K] extends unknown[] ? U[K][0] : U[K] extends DateConstructor ? Date : U[K] extends import("./util").TFunc ? U[K] extends infer T_3 ? T_3 extends U[K] ? T_3 extends (x: any) => x is infer U_1 ? U_1 : never : never : never : U[K] extends import("./jetSchema").ISchema<unknown, {}> ? U[K]["test"] extends infer T_4 ? T_4 extends U[K]["test"] ? T_4 extends (x: any) => x is infer U_1 ? U_1 : never : never : never : U[K] extends string | number ? { | ||
[x: string]: string | number; | ||
} | (((arg: unknown) => arg is U[K]) | [U[K], (arg: unknown) => arg is U[K]]) : never; }[K_2]; }, undefined>> : never : never : never : never : T>; | ||
} | (((arg: unknown) => arg is U[K]) | [U[K], (arg: unknown) => arg is U[K]]) : never; }[K_2]; }, undefined>> : never : never : never : never : T, NonNullable<unknown extends T ? R[0] extends infer T_1 ? T_1 extends R[0] ? T_1 extends true ? (R[1] extends infer T_2 ? T_2 extends R[1] ? T_2 extends true ? NonNullable<Exclude<{ [K_1 in keyof { [K in keyof U]: U[K] extends unknown[] ? U[K][0] : U[K] extends DateConstructor ? Date : U[K] extends import("./util").TFunc ? U[K] extends infer T_3 ? T_3 extends U[K] ? T_3 extends (x: any) => x is infer U_1 ? U_1 : never : never : never : U[K] extends import("./jetSchema").ISchema<unknown, {}> ? U[K]["test"] extends infer T_4 ? T_4 extends U[K]["test"] ? T_4 extends (x: any) => x is infer U_1 ? U_1 : never : never : never : U[K] extends string | number ? { | ||
[x: string]: string | number; | ||
} | (((arg: unknown) => arg is U[K]) | [U[K], (arg: unknown) => arg is U[K]]) : never; } as undefined extends { [K in keyof U]: U[K] extends unknown[] ? U[K][0] : U[K] extends DateConstructor ? Date : U[K] extends import("./util").TFunc ? U[K] extends infer T_3 ? T_3 extends U[K] ? T_3 extends (x: any) => x is infer U_1 ? U_1 : never : never : never : U[K] extends import("./jetSchema").ISchema<unknown, {}> ? U[K]["test"] extends infer T_4 ? T_4 extends U[K]["test"] ? T_4 extends (x: any) => x is infer U_1 ? U_1 : never : never : never : U[K] extends string | number ? { | ||
[x: string]: string | number; | ||
} | (((arg: unknown) => arg is U[K]) | [U[K], (arg: unknown) => arg is U[K]]) : never; }[K_1] ? K_1 : never]?: { [K in keyof U]: U[K] extends unknown[] ? U[K][0] : U[K] extends DateConstructor ? Date : U[K] extends import("./util").TFunc ? U[K] extends infer T_3 ? T_3 extends U[K] ? T_3 extends (x: any) => x is infer U_1 ? U_1 : never : never : never : U[K] extends import("./jetSchema").ISchema<unknown, {}> ? U[K]["test"] extends infer T_4 ? T_4 extends U[K]["test"] ? T_4 extends (x: any) => x is infer U_1 ? U_1 : never : never : never : U[K] extends string | number ? { | ||
[x: string]: string | number; | ||
} | (((arg: unknown) => arg is U[K]) | [U[K], (arg: unknown) => arg is U[K]]) : never; }[K_1] | undefined; } & { [K_2 in keyof { [K in keyof U]: U[K] extends unknown[] ? U[K][0] : U[K] extends DateConstructor ? Date : U[K] extends import("./util").TFunc ? U[K] extends infer T_3 ? T_3 extends U[K] ? T_3 extends (x: any) => x is infer U_1 ? U_1 : never : never : never : U[K] extends import("./jetSchema").ISchema<unknown, {}> ? U[K]["test"] extends infer T_4 ? T_4 extends U[K]["test"] ? T_4 extends (x: any) => x is infer U_1 ? U_1 : never : never : never : U[K] extends string | number ? { | ||
[x: string]: string | number; | ||
} | (((arg: unknown) => arg is U[K]) | [U[K], (arg: unknown) => arg is U[K]]) : never; } as undefined extends { [K in keyof U]: U[K] extends unknown[] ? U[K][0] : U[K] extends DateConstructor ? Date : U[K] extends import("./util").TFunc ? U[K] extends infer T_3 ? T_3 extends U[K] ? T_3 extends (x: any) => x is infer U_1 ? U_1 : never : never : never : U[K] extends import("./jetSchema").ISchema<unknown, {}> ? U[K]["test"] extends infer T_4 ? T_4 extends U[K]["test"] ? T_4 extends (x: any) => x is infer U_1 ? U_1 : never : never : never : U[K] extends string | number ? { | ||
[x: string]: string | number; | ||
} | (((arg: unknown) => arg is U[K]) | [U[K], (arg: unknown) => arg is U[K]]) : never; }[K_2] ? never : K_2]: { [K in keyof U]: U[K] extends unknown[] ? U[K][0] : U[K] extends DateConstructor ? Date : U[K] extends import("./util").TFunc ? U[K] extends infer T_3 ? T_3 extends U[K] ? T_3 extends (x: any) => x is infer U_1 ? U_1 : never : never : never : U[K] extends import("./jetSchema").ISchema<unknown, {}> ? U[K]["test"] extends infer T_4 ? T_4 extends U[K]["test"] ? T_4 extends (x: any) => x is infer U_1 ? U_1 : never : never : never : U[K] extends string | number ? { | ||
[x: string]: string | number; | ||
} | (((arg: unknown) => arg is U[K]) | [U[K], (arg: unknown) => arg is U[K]]) : never; }[K_2]; }, undefined>> | null : NonNullable<Exclude<{ [K_1 in keyof { [K in keyof U]: U[K] extends unknown[] ? U[K][0] : U[K] extends DateConstructor ? Date : U[K] extends import("./util").TFunc ? U[K] extends infer T_3 ? T_3 extends U[K] ? T_3 extends (x: any) => x is infer U_1 ? U_1 : never : never : never : U[K] extends import("./jetSchema").ISchema<unknown, {}> ? U[K]["test"] extends infer T_4 ? T_4 extends U[K]["test"] ? T_4 extends (x: any) => x is infer U_1 ? U_1 : never : never : never : U[K] extends string | number ? { | ||
[x: string]: string | number; | ||
} | (((arg: unknown) => arg is U[K]) | [U[K], (arg: unknown) => arg is U[K]]) : never; } as undefined extends { [K in keyof U]: U[K] extends unknown[] ? U[K][0] : U[K] extends DateConstructor ? Date : U[K] extends import("./util").TFunc ? U[K] extends infer T_3 ? T_3 extends U[K] ? T_3 extends (x: any) => x is infer U_1 ? U_1 : never : never : never : U[K] extends import("./jetSchema").ISchema<unknown, {}> ? U[K]["test"] extends infer T_4 ? T_4 extends U[K]["test"] ? T_4 extends (x: any) => x is infer U_1 ? U_1 : never : never : never : U[K] extends string | number ? { | ||
[x: string]: string | number; | ||
} | (((arg: unknown) => arg is U[K]) | [U[K], (arg: unknown) => arg is U[K]]) : never; }[K_1] ? K_1 : never]?: { [K in keyof U]: U[K] extends unknown[] ? U[K][0] : U[K] extends DateConstructor ? Date : U[K] extends import("./util").TFunc ? U[K] extends infer T_3 ? T_3 extends U[K] ? T_3 extends (x: any) => x is infer U_1 ? U_1 : never : never : never : U[K] extends import("./jetSchema").ISchema<unknown, {}> ? U[K]["test"] extends infer T_4 ? T_4 extends U[K]["test"] ? T_4 extends (x: any) => x is infer U_1 ? U_1 : never : never : never : U[K] extends string | number ? { | ||
[x: string]: string | number; | ||
} | (((arg: unknown) => arg is U[K]) | [U[K], (arg: unknown) => arg is U[K]]) : never; }[K_1] | undefined; } & { [K_2 in keyof { [K in keyof U]: U[K] extends unknown[] ? U[K][0] : U[K] extends DateConstructor ? Date : U[K] extends import("./util").TFunc ? U[K] extends infer T_3 ? T_3 extends U[K] ? T_3 extends (x: any) => x is infer U_1 ? U_1 : never : never : never : U[K] extends import("./jetSchema").ISchema<unknown, {}> ? U[K]["test"] extends infer T_4 ? T_4 extends U[K]["test"] ? T_4 extends (x: any) => x is infer U_1 ? U_1 : never : never : never : U[K] extends string | number ? { | ||
[x: string]: string | number; | ||
} | (((arg: unknown) => arg is U[K]) | [U[K], (arg: unknown) => arg is U[K]]) : never; } as undefined extends { [K in keyof U]: U[K] extends unknown[] ? U[K][0] : U[K] extends DateConstructor ? Date : U[K] extends import("./util").TFunc ? U[K] extends infer T_3 ? T_3 extends U[K] ? T_3 extends (x: any) => x is infer U_1 ? U_1 : never : never : never : U[K] extends import("./jetSchema").ISchema<unknown, {}> ? U[K]["test"] extends infer T_4 ? T_4 extends U[K]["test"] ? T_4 extends (x: any) => x is infer U_1 ? U_1 : never : never : never : U[K] extends string | number ? { | ||
[x: string]: string | number; | ||
} | (((arg: unknown) => arg is U[K]) | [U[K], (arg: unknown) => arg is U[K]]) : never; }[K_2] ? never : K_2]: { [K in keyof U]: U[K] extends unknown[] ? U[K][0] : U[K] extends DateConstructor ? Date : U[K] extends import("./util").TFunc ? U[K] extends infer T_3 ? T_3 extends U[K] ? T_3 extends (x: any) => x is infer U_1 ? U_1 : never : never : never : U[K] extends import("./jetSchema").ISchema<unknown, {}> ? U[K]["test"] extends infer T_4 ? T_4 extends U[K]["test"] ? T_4 extends (x: any) => x is infer U_1 ? U_1 : never : never : never : U[K] extends string | number ? { | ||
[x: string]: string | number; | ||
} | (((arg: unknown) => arg is U[K]) | [U[K], (arg: unknown) => arg is U[K]]) : never; }[K_2]; }, undefined>> : never : never) | undefined : R[1] extends infer T_2 ? T_2 extends R[1] ? T_2 extends true ? NonNullable<Exclude<{ [K_1 in keyof { [K in keyof U]: U[K] extends unknown[] ? U[K][0] : U[K] extends DateConstructor ? Date : U[K] extends import("./util").TFunc ? U[K] extends infer T_3 ? T_3 extends U[K] ? T_3 extends (x: any) => x is infer U_1 ? U_1 : never : never : never : U[K] extends import("./jetSchema").ISchema<unknown, {}> ? U[K]["test"] extends infer T_4 ? T_4 extends U[K]["test"] ? T_4 extends (x: any) => x is infer U_1 ? U_1 : never : never : never : U[K] extends string | number ? { | ||
[x: string]: string | number; | ||
} | (((arg: unknown) => arg is U[K]) | [U[K], (arg: unknown) => arg is U[K]]) : never; } as undefined extends { [K in keyof U]: U[K] extends unknown[] ? U[K][0] : U[K] extends DateConstructor ? Date : U[K] extends import("./util").TFunc ? U[K] extends infer T_3 ? T_3 extends U[K] ? T_3 extends (x: any) => x is infer U_1 ? U_1 : never : never : never : U[K] extends import("./jetSchema").ISchema<unknown, {}> ? U[K]["test"] extends infer T_4 ? T_4 extends U[K]["test"] ? T_4 extends (x: any) => x is infer U_1 ? U_1 : never : never : never : U[K] extends string | number ? { | ||
[x: string]: string | number; | ||
} | (((arg: unknown) => arg is U[K]) | [U[K], (arg: unknown) => arg is U[K]]) : never; }[K_1] ? K_1 : never]?: { [K in keyof U]: U[K] extends unknown[] ? U[K][0] : U[K] extends DateConstructor ? Date : U[K] extends import("./util").TFunc ? U[K] extends infer T_3 ? T_3 extends U[K] ? T_3 extends (x: any) => x is infer U_1 ? U_1 : never : never : never : U[K] extends import("./jetSchema").ISchema<unknown, {}> ? U[K]["test"] extends infer T_4 ? T_4 extends U[K]["test"] ? T_4 extends (x: any) => x is infer U_1 ? U_1 : never : never : never : U[K] extends string | number ? { | ||
[x: string]: string | number; | ||
} | (((arg: unknown) => arg is U[K]) | [U[K], (arg: unknown) => arg is U[K]]) : never; }[K_1] | undefined; } & { [K_2 in keyof { [K in keyof U]: U[K] extends unknown[] ? U[K][0] : U[K] extends DateConstructor ? Date : U[K] extends import("./util").TFunc ? U[K] extends infer T_3 ? T_3 extends U[K] ? T_3 extends (x: any) => x is infer U_1 ? U_1 : never : never : never : U[K] extends import("./jetSchema").ISchema<unknown, {}> ? U[K]["test"] extends infer T_4 ? T_4 extends U[K]["test"] ? T_4 extends (x: any) => x is infer U_1 ? U_1 : never : never : never : U[K] extends string | number ? { | ||
[x: string]: string | number; | ||
} | (((arg: unknown) => arg is U[K]) | [U[K], (arg: unknown) => arg is U[K]]) : never; } as undefined extends { [K in keyof U]: U[K] extends unknown[] ? U[K][0] : U[K] extends DateConstructor ? Date : U[K] extends import("./util").TFunc ? U[K] extends infer T_3 ? T_3 extends U[K] ? T_3 extends (x: any) => x is infer U_1 ? U_1 : never : never : never : U[K] extends import("./jetSchema").ISchema<unknown, {}> ? U[K]["test"] extends infer T_4 ? T_4 extends U[K]["test"] ? T_4 extends (x: any) => x is infer U_1 ? U_1 : never : never : never : U[K] extends string | number ? { | ||
[x: string]: string | number; | ||
} | (((arg: unknown) => arg is U[K]) | [U[K], (arg: unknown) => arg is U[K]]) : never; }[K_2] ? never : K_2]: { [K in keyof U]: U[K] extends unknown[] ? U[K][0] : U[K] extends DateConstructor ? Date : U[K] extends import("./util").TFunc ? U[K] extends infer T_3 ? T_3 extends U[K] ? T_3 extends (x: any) => x is infer U_1 ? U_1 : never : never : never : U[K] extends import("./jetSchema").ISchema<unknown, {}> ? U[K]["test"] extends infer T_4 ? T_4 extends U[K]["test"] ? T_4 extends (x: any) => x is infer U_1 ? U_1 : never : never : never : U[K] extends string | number ? { | ||
[x: string]: string | number; | ||
} | (((arg: unknown) => arg is U[K]) | [U[K], (arg: unknown) => arg is U[K]]) : never; }[K_2]; }, undefined>> | null : NonNullable<Exclude<{ [K_1 in keyof { [K in keyof U]: U[K] extends unknown[] ? U[K][0] : U[K] extends DateConstructor ? Date : U[K] extends import("./util").TFunc ? U[K] extends infer T_3 ? T_3 extends U[K] ? T_3 extends (x: any) => x is infer U_1 ? U_1 : never : never : never : U[K] extends import("./jetSchema").ISchema<unknown, {}> ? U[K]["test"] extends infer T_4 ? T_4 extends U[K]["test"] ? T_4 extends (x: any) => x is infer U_1 ? U_1 : never : never : never : U[K] extends string | number ? { | ||
[x: string]: string | number; | ||
} | (((arg: unknown) => arg is U[K]) | [U[K], (arg: unknown) => arg is U[K]]) : never; } as undefined extends { [K in keyof U]: U[K] extends unknown[] ? U[K][0] : U[K] extends DateConstructor ? Date : U[K] extends import("./util").TFunc ? U[K] extends infer T_3 ? T_3 extends U[K] ? T_3 extends (x: any) => x is infer U_1 ? U_1 : never : never : never : U[K] extends import("./jetSchema").ISchema<unknown, {}> ? U[K]["test"] extends infer T_4 ? T_4 extends U[K]["test"] ? T_4 extends (x: any) => x is infer U_1 ? U_1 : never : never : never : U[K] extends string | number ? { | ||
[x: string]: string | number; | ||
} | (((arg: unknown) => arg is U[K]) | [U[K], (arg: unknown) => arg is U[K]]) : never; }[K_1] ? K_1 : never]?: { [K in keyof U]: U[K] extends unknown[] ? U[K][0] : U[K] extends DateConstructor ? Date : U[K] extends import("./util").TFunc ? U[K] extends infer T_3 ? T_3 extends U[K] ? T_3 extends (x: any) => x is infer U_1 ? U_1 : never : never : never : U[K] extends import("./jetSchema").ISchema<unknown, {}> ? U[K]["test"] extends infer T_4 ? T_4 extends U[K]["test"] ? T_4 extends (x: any) => x is infer U_1 ? U_1 : never : never : never : U[K] extends string | number ? { | ||
[x: string]: string | number; | ||
} | (((arg: unknown) => arg is U[K]) | [U[K], (arg: unknown) => arg is U[K]]) : never; }[K_1] | undefined; } & { [K_2 in keyof { [K in keyof U]: U[K] extends unknown[] ? U[K][0] : U[K] extends DateConstructor ? Date : U[K] extends import("./util").TFunc ? U[K] extends infer T_3 ? T_3 extends U[K] ? T_3 extends (x: any) => x is infer U_1 ? U_1 : never : never : never : U[K] extends import("./jetSchema").ISchema<unknown, {}> ? U[K]["test"] extends infer T_4 ? T_4 extends U[K]["test"] ? T_4 extends (x: any) => x is infer U_1 ? U_1 : never : never : never : U[K] extends string | number ? { | ||
[x: string]: string | number; | ||
} | (((arg: unknown) => arg is U[K]) | [U[K], (arg: unknown) => arg is U[K]]) : never; } as undefined extends { [K in keyof U]: U[K] extends unknown[] ? U[K][0] : U[K] extends DateConstructor ? Date : U[K] extends import("./util").TFunc ? U[K] extends infer T_3 ? T_3 extends U[K] ? T_3 extends (x: any) => x is infer U_1 ? U_1 : never : never : never : U[K] extends import("./jetSchema").ISchema<unknown, {}> ? U[K]["test"] extends infer T_4 ? T_4 extends U[K]["test"] ? T_4 extends (x: any) => x is infer U_1 ? U_1 : never : never : never : U[K] extends string | number ? { | ||
[x: string]: string | number; | ||
} | (((arg: unknown) => arg is U[K]) | [U[K], (arg: unknown) => arg is U[K]]) : never; }[K_2] ? never : K_2]: { [K in keyof U]: U[K] extends unknown[] ? U[K][0] : U[K] extends DateConstructor ? Date : U[K] extends import("./util").TFunc ? U[K] extends infer T_3 ? T_3 extends U[K] ? T_3 extends (x: any) => x is infer U_1 ? U_1 : never : never : never : U[K] extends import("./jetSchema").ISchema<unknown, {}> ? U[K]["test"] extends infer T_4 ? T_4 extends U[K]["test"] ? T_4 extends (x: any) => x is infer U_1 ? U_1 : never : never : never : U[K] extends string | number ? { | ||
[x: string]: string | number; | ||
} | (((arg: unknown) => arg is U[K]) | [U[K], (arg: unknown) => arg is U[K]]) : never; }[K_2]; }, undefined>> : never : never : never : never : T>>; | ||
export default jetSchema; |
@@ -9,5 +9,5 @@ import { TFunc } from './util'; | ||
type IsStaticObj<P, Prop = NonNullable<P>> = (_TConvertInterfaceToType<Prop> extends _TStaticObj<Prop> ? true : false); | ||
type MakeOptIfUndef<T> = { | ||
type MakeOptIfUndef<T> = ({ | ||
[K in keyof T as undefined extends T[K] ? K : never]?: T[K]; | ||
} & { | ||
}) & { | ||
[K in keyof T as undefined extends T[K] ? never : K]: T[K]; | ||
@@ -26,13 +26,13 @@ }; | ||
}; | ||
type TPickRetVal<T> = { | ||
type TPickRetVal<T, NT = NonNullable<T>> = { | ||
test: (arg: unknown) => arg is T; | ||
default: () => T; | ||
} & (IsStaticObj<T> extends true ? { | ||
pick: <K extends keyof NonNullable<T>>(key: K) => TPickRetVal<NonNullable<T>[K]>; | ||
pick: <K extends keyof NT>(prop: K) => (undefined extends NT[K] ? TPickRetVal<NT[K]> | undefined : TPickRetVal<NT[K]>); | ||
new: (arg?: Partial<T>) => NonNullable<T>; | ||
} : {}); | ||
export interface ISchema<T> { | ||
export interface ISchema<T, NT = NonNullable<T>> { | ||
new: (arg?: Partial<T>) => NonNullable<T>; | ||
test: (arg: unknown) => arg is T; | ||
pick: <K extends keyof T>(prop: K) => (null extends T[K] ? Partial<TPickRetVal<T[K]>> : undefined extends T[K] ? Partial<TPickRetVal<T[K]>> : TPickRetVal<T[K]>); | ||
pick: <K extends keyof NT>(prop: K) => (undefined extends NT[K] ? TPickRetVal<NT[K]> | undefined : TPickRetVal<NT[K]>); | ||
_schemaSettings: { | ||
@@ -62,4 +62,4 @@ isOptional: boolean; | ||
]) : (null extends T ? [ | ||
isOptional: true, | ||
isNullable?: false, | ||
isOptional: false, | ||
isNullable?: true, | ||
defaultVal?: true | null | ||
@@ -71,4 +71,3 @@ ] : [ | ||
])); | ||
export type PublicInferType<S> = PublicInferTypeHelper<S>; | ||
type PublicInferTypeHelper<S> = S extends ISchema<unknown> ? GetTypePredicate<S['test']> : never; | ||
export type PublicInferType<S> = (S extends ISchema<unknown> ? GetTypePredicate<S['test']> : never); | ||
type InferTypes<U, isOpt, isNul> = AddNullables<MakeOptIfUndef<InferTypesHelper<U>>, isOpt, isNul>; | ||
@@ -75,0 +74,0 @@ type InferTypesHelper<U> = { |
@@ -81,2 +81,5 @@ "use strict"; | ||
} | ||
if ((0, util_1.isUndef)(defaults[key])) { | ||
defaults[key] = () => undefined; | ||
} | ||
const vldr = validators[key], dfltVal = (_a = defaults[key]) === null || _a === void 0 ? void 0 : _a.call(defaults); | ||
@@ -83,0 +86,0 @@ if (!vldr(dfltVal)) { |
{ | ||
"name": "jet-schema", | ||
"version": "1.0.4", | ||
"version": "1.0.5", | ||
"description": "Simple, typescript-first schema validation tool", | ||
@@ -5,0 +5,0 @@ "main": "dist/index.js", |
@@ -14,2 +14,4 @@ # Jet-Schema ✈️ | ||
- [Bonus Features](#bonus-features) | ||
- [Misc Notes](#misc-notes) | ||
- [Validating properties which may be undefined](#validating-properties-which-may-be-undefined) | ||
@@ -43,3 +45,3 @@ | ||
name: z.string().default(''), | ||
email: z.string().email().or(z.literal('')).default('a@a.com'), | ||
email: z.string().email().or(z.literal('')).default('x@x.x'), | ||
age: z.preprocess(Number, z.number()), | ||
@@ -59,3 +61,3 @@ created: z.preprocess((arg => arg === undefined ? new Date() : arg), z.coerce.date()), | ||
name: isString, | ||
email: ['x@example.com', isEmail], | ||
email: ['x@x.x', isEmail], | ||
age: transform(Number, isNumber), | ||
@@ -83,4 +85,4 @@ created: Date, | ||
`jetSchema()` accepts two optional arguments: | ||
- An array-map of which default-value should be used for which validator-function: you should use this option for frequently used validator-function/default-value combinations where you don't want to set a default value every time. | ||
- The second is a custom clone function if you don't want to use the built-in function which uses `structuredClone` (I like to use `lodash.cloneDeep`). | ||
- An array-map of which default-value should be used for which validator-function: you should use this option for frequently used validator-function/default-value combinations where you don't want to set a default value every time. Upon initialization, the validator-functions will check their defaults. If a value is not optional and you do not supply default value, then an error will be thrown when the schema is initialized. If you don't set a default value for a function in the `jetSchema()` function, you can also pass a 2 length array of the default value and the validator function in `schema` (the next 3 snippets below contain examples). | ||
- The second is a custom clone-function if you don't want to use the built-in function which uses `structuredClone` (I like to use `lodash.cloneDeep`). | ||
<br/> | ||
@@ -143,3 +145,3 @@ | ||
name: isStr, | ||
email: ['', EMAIL_RGX.test] // You can pass your defaults/validators in an array instead. | ||
email: ['x@x.x', EMAIL_RGX.test] // You can pass your defaults/validators in an array instead. | ||
nickName: isOptionalStr, // NOTE: we don't have to pass this option since its optional | ||
@@ -157,4 +159,2 @@ }) | ||
``` | ||
> ⚠️ **IMPORTANT:** Upon initialization, the validator-functions will check their defaults. If a value is not optional and you do not supply default value, then an error will be thrown when `schema()` is called. | ||
<br/> | ||
@@ -165,5 +165,5 @@ | ||
- `test` accepts any unknown value, returns a type-predicate and will test it against the `schema`. | ||
- `pick` allows you to select property and returns an object with the `test` and `default` functions. If a value is nullable, then you need to use optional guard when calling it: `pick?.()` | ||
- `pick` allows you to select property and returns an object with the `test` and `default` functions. If a value is optional, then you need to use an optional-chaining when calling it (i.e. `pick("some optional property")?.test("")` because typescript won't know if you've set that property in the schema. | ||
> If an object property is a mapped-type then it must be initialized with the schema function. Just like with the parent schemas, you can also call `new`, `test`, `pick`, in addition to `default`. The value returned from `default` could be different from `new` if the schema is optional/nullable and the default value is `null` or `undefined`. | ||
> If an object property is a mapped-type, then it must be initialized with the schema function. Just like with the parent schemas, you can also call `new`, `test`, `pick`, in addition to `default`. The value returned from `default` could be different from `new` if the schema is optional/nullable and the default value is `null` or `undefined`. | ||
@@ -177,2 +177,4 @@ | ||
```typescript | ||
// models/User.ts | ||
interface IUser { | ||
@@ -233,1 +235,37 @@ id: number; | ||
- You can also use an enum as a validator. The default value will be the first value in the enum object and the validation will make sure the value is a value in the enum. | ||
<br> | ||
## Misc Notes <a name="misc-notes"></a> | ||
### Validating properties which may be undefined <a name="validating-properties-which-may-be-undefined"></a> | ||
As mentioned in the guide, if a property is optional, then the value returned from `pick()` might be undefined. If you know based on context (because you set a property in the `schema` function), and you don't want to have to do optional calling everytime (i.e. `pick("some optional property")?.test(...)`), then I recommend adding a wrapper function to your schema: | ||
```typescript | ||
// models/User.ts | ||
interface IUser { | ||
id: number; | ||
address?: { street: string } | null; | ||
} | ||
const User = schema<IUser>({ | ||
id: isNumber, | ||
address: schema({ | ||
street: isString, | ||
}, true, true) | ||
}) | ||
// Wrapper function: this is also handy for when we want to validate a | ||
// child object without allowing null as a possible value. | ||
function checkAddr(arg: unknown): arg is NonNullable<IUser['address']> { | ||
if (arg === null || arg === undefined) { | ||
return false; | ||
} | ||
return User.pick('address')!.test(arg); | ||
} | ||
export default { | ||
checkAddr, | ||
...User, | ||
} | ||
``` |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
66312
478
262