UNPKG

@codethread/tstl-validate

Version:

Fork and adaptation of valibot for use in typescript-to-lua

18 lines (17 loc) 587 B
/** @noSelfInFile */ import type { BaseSchema, Input, Output } from '../../types'; /** * Nullish schema type. */ export type NullishSchema<TWrappedSchema extends BaseSchema, TOutput = Output<TWrappedSchema> | null | undefined> = BaseSchema<Input<TWrappedSchema> | null | undefined, TOutput> & { schema: 'nullish'; wrapped: TWrappedSchema; }; /** * Creates a nullish schema. * * @param wrapped The wrapped schema. * * @returns A nullish schema. */ export declare function nullish<TWrappedSchema extends BaseSchema>(wrapped: TWrappedSchema): NullishSchema<TWrappedSchema>;