Upgrading valibot 0.27 to 0.28
Safe0.27.1 → 0.28.1New2Fixed2
SafeUpgrade verdict
Only new features and fixes in this range.
In plain terms
- Nothing in this range needs changes to your code. It adds features and fixes.
Must act Nothing to change
No breaking, platform, security or deprecated items in this range.
Nothing in this upgrade needs a code or configuration change.
API changes
Generated by DepDelta from published .d.ts files. Not mixed with prose notes.
- removed:
function parseResult(typed: false, output: unknown, issues: Issues): UntypedSchemaResult - removed:
function parseResult<TOutput>(typed: true, output: TOutput, issues?: Issues): TypedSchemaResult<TOutput> - removed:
type Issue = { reason: IssueReason; validation: string; origin: IssueOrigin; message: string; input: unknown; requirement?: unknown; path?: PathItem[]; issues?: Issues; abo… - removed:
type IssueOrigin = 'key' | 'value' - removed:
type Issues = [Issue, ...Issue[]] - removed:
type ParseInfo = Partial<Pick<Issue, 'origin' | 'abortEarly' | 'abortPipeEarly' | 'skipPipe'>> - removed:
type PipeInfo = ParseInfo & Pick<Issue, 'reason'> - changed:
constructor ValiError(issues: Issues) → constructor ValiError(issues: SchemaIssues) - changed:
function actionIssue(validation: string, message: ErrorMessage, input: unknown, requirement?: unknown, path?: PathItem[]): InvalidActionResult → function actionIssue(context: PipeActionContext, reference: Function, input: unknown, label: string, received?: string): InvalidActionResult - changed:
function coerce<TSchema extends BaseSchema>(schema: TSchema, action: (value: unknown) => unknown): TSchema → function coerce<TSchema extends BaseSchema>(schema: TSchema, action: (input: unknown) => unknown): TSchema - changed:
function coerceAsync<TSchema extends BaseSchemaAsync>(schema: TSchema, action: (value: unknown) => unknown): TSchema → function coerceAsync<TSchema extends BaseSchemaAsync>(schema: TSchema, action: (input: unknown) => unknown): TSchema - changed:
function enum_<TEnum extends Enum>(enum_: TEnum, message?: ErrorMessage): EnumSchema<TEnum> → function enum_<TEnum extends Enum>(enum__: TEnum, message?: ErrorMessage): EnumSchema<TEnum> - changed:
function flatten<TSchema extends BaseSchema | BaseSchemaAsync = any>(issues: Issues): FlatErrors<TSchema> → function flatten<TSchema extends BaseSchema | BaseSchemaAsync = any>(issues: SchemaIssues): FlatErrors<TSchema> - changed:
function is<TSchema extends BaseSchema>(schema: TSchema, input: unknown, info?: Pick<ParseInfo, 'skipPipe'>): input is Input<TSchema> → function is<TSchema extends BaseSchema>(schema: TSchema, input: unknown, config?: Pick<SchemaConfig, 'skipPipe'>): input is Input<TSchema> - changed:
function literal<TLiteral extends Literal>(literal: TLiteral, message?: ErrorMessage): LiteralSchema<TLiteral> → function literal<TLiteral extends Literal>(literal_: TLiteral, message?: ErrorMessage): LiteralSchema<TLiteral> - changed:
function parse<TSchema extends BaseSchema>(schema: TSchema, input: unknown, info?: Pick<ParseInfo, 'abortEarly' | 'abortPipeEarly' | 'skipPipe'>): Output<TSchema> → function parse<TSchema extends BaseSchema>(schema: TSchema, input: unknown, config?: SchemaConfig): Output<TSchema> - changed:
function parseAsync<TSchema extends BaseSchema | BaseSchemaAsync>(schema: TSchema, input: unknown, info?: Pick<ParseInfo, 'abortEarly' | 'abortPipeEarly' | 'skipPipe'>): Promise<Output<TSchema>> → function parseAsync<TSchema extends BaseSchema | BaseSchemaAsync>(schema: TSchema, input: unknown, config?: SchemaConfig): Promise<Output<TSchema>> - changed:
function pipeResult<TValue>(input: TValue, pipe: Pipe<TValue> | undefined, parseInfo: ParseInfo | undefined, reason: IssueReason, issues?: Issues): SchemaResult<TValue> → function pipeResult<TValue>(context: SchemaContext$2<TValue>, input: TValue, config: SchemaConfig | undefined, issues?: SchemaIssues): TypedSchemaResult<TValue> - changed:
function pipeResultAsync<TValue>(input: TValue, pipe: PipeAsync<TValue> | undefined, parseInfo: ParseInfo | undefined, reason: IssueReason, issues?: Issues): Promise<SchemaResult<TValue>> → function pipeResultAsync<TValue>(context: SchemaContext$1<TValue>, input: TValue, config: SchemaConfig | undefined, issues?: SchemaIssues): Promise<SchemaResult<TValue>> - changed:
function safeParse<TSchema extends BaseSchema>(schema: TSchema, input: unknown, info?: Pick<ParseInfo, 'abortEarly' | 'abortPipeEarly' | 'skipPipe'>): SafeParseResult<TSchema> → function safeParse<TSchema extends BaseSchema>(schema: TSchema, input: unknown, config?: SchemaConfig): SafeParseResult<TSchema> - changed:
function safeParseAsync<TSchema extends BaseSchema | BaseSchemaAsync>(schema: TSchema, input: unknown, info?: Pick<ParseInfo, 'abortEarly' | 'abortPipeEarly' | 'skipPipe'>): Promise<SafeParseResult<TSchema>> → function safeParseAsync<TSchema extends BaseSchema | BaseSchemaAsync>(schema: TSchema, input: unknown, config?: SchemaConfig): Promise<SafeParseResult<TSchema>> - changed:
function schemaIssue(info: ParseInfo | undefined, reason: IssueReason, validation: string, message: ErrorMessage, input: unknown, path?: PathItem[], issues?: Issues): UntypedSchemaResult → function schemaIssue(context: SchemaContext, reference: Function, input: unknown, config: SchemaConfig | undefined, other?: OtherInfo): UntypedSchemaResult - changed:
function strict<TSchema extends ObjectSchema<ObjectEntries, undefined>>(schema: TSchema, message?: ErrorMessage): TSchema → function strict<TSchema extends ObjectSchema<ObjectEntries, undefined>>(schema: TSchema): TSchema - changed:
function strictAsync<TSchema extends ObjectSchemaAsync<ObjectEntriesAsync, undefined>>(schema: TSchema, message?: ErrorMessage): TSchema → function strictAsync<TSchema extends ObjectSchemaAsync<ObjectEntriesAsync, undefined>>(schema: TSchema): TSchema - changed:
function transform<TSchema extends BaseSchema, TOutput>(schema: TSchema, action: (value: Output<TSchema>, info: TransformInfo) => TOutput, pipe?: Pipe<TOutput>): SchemaWithTransform<TSchema, TOutput> → function transform<TSchema extends BaseSchema, TOutput>(schema: TSchema, action: (input: Output<TSchema>, info: TransformInfo) => TOutput, pipe?: Pipe<TOutput>): SchemaWithTransform<TSchema, TOutput> - changed:
function transform<TSchema extends BaseSchema, TOutput>(schema: TSchema, action: (value: Output<TSchema>, info: TransformInfo) => TOutput, validate?: BaseSchema<TOutput>): SchemaWithTransform<TSchema, TOutput> → function transform<TSchema extends BaseSchema, TOutput>(schema: TSchema, action: (input: Output<TSchema>, info: TransformInfo) => TOutput, validation?: BaseSchema<TOutput>): SchemaWithTransform<TSchema, TOutput> - changed:
function transformAsync<TSchema extends BaseSchema | BaseSchemaAsync, TOutput>(schema: TSchema, action: (value: Output<TSchema>, info: TransformInfo) => TOutput | Promise<TOutput>, pipe?: PipeAsync<TOutput>): SchemaWithTransformAsync<TSchema, TOutput> → function transformAsync<TSchema extends BaseSchema | BaseSchemaAsync, TOutput>(schema: TSchema, action: (input: Output<TSchema>, info: TransformInfo) => TOutput | Promise<TOutput>, pipe?: PipeAsync<TOutput>): SchemaWithTransformAsync<TSchema, TOutput> - changed:
function transformAsync<TSchema extends BaseSchema | BaseSchemaAsync, TOutput>(schema: TSchema, action: (value: Output<TSchema>, info: TransformInfo) => TOutput | Promise<TOutput>, validate?: BaseSchema<TOutput> | BaseSchemaAsync<TOutput>): SchemaWithTransformAsync<TSchema, TOutput> → function transformAsync<TSchema extends BaseSchema | BaseSchemaAsync, TOutput>(schema: TSchema, action: (input: Output<TSchema>, info: TransformInfo) => TOutput | Promise<TOutput>, validation?: BaseSchema<TOutput> | BaseSchemaAsync<TOutput>): SchemaWithTransformAsync<TSchema, TOutput> - changed:
property ValiError.issues: Issues → property ValiError.issues: SchemaIssues - changed:
type ArrayPathItem = { type: 'array'; input: unknown[]; key: number; value: unknown } → type ArrayPathItem = { type: 'array'; origin: 'value'; input: unknown[]; key: number; value: unknown } - changed:
type ArraySchema<TItem extends BaseSchema, TOutput = Output<TItem>[]> = BaseSchema<Input<TItem>[], TOutput> & { type: 'array'; item: TItem; message: ErrorMessage; pipe: Pipe<Output<TItem>[]> | undefined } → type ArraySchema<TItem extends BaseSchema, TOutput = Output<TItem>[]> = BaseSchema<Input<TItem>[], TOutput> & { type: 'array'; item: TItem; message: ErrorMessage | undefined; pipe: Pipe<Output<TItem>[]> | undefined } - changed:
type ArraySchemaAsync<TItem extends BaseSchema | BaseSchemaAsync, TOutput = Output<TItem>[]> = BaseSchemaAsync<Input<TItem>[], TOutput> & { type: 'array'; item: TItem; message: ErrorMessage; pipe: PipeAsync<Output<TItem>[]> | undefined } → type ArraySchemaAsync<TItem extends BaseSchema | BaseSchemaAsync, TOutput = Output<TItem>[]> = BaseSchemaAsync<Input<TItem>[], TOutput> & { type: 'array'; item: TItem; message: ErrorMessage | undefined; pipe: PipeAsync<Output<TItem>[]> | undefined } - changed:
type BaseSchema<TInput = any, TOutput = TInput> = { async: false; _parse(input: unknown, info?: ParseInfo): SchemaResult<TOutput>; _types?: { input: TInput; output: TOutput } } → type BaseSchema<TInput = any, TOutput = TInput> = { expects: string; async: false; _parse(input: unknown, config?: SchemaConfig): SchemaResult<TOutput>; _types?: { input: TInput; output: TOutput } } - changed:
type BaseSchemaAsync<TInput = any, TOutput = TInput> = { async: true; _parse(input: unknown, info?: ParseInfo): Promise<SchemaResult<TOutput>>; _types?: { input: TInput; output: TOutput } } → type BaseSchemaAsync<TInput = any, TOutput = TInput> = { expects: string; async: true; _parse(input: unknown, config?: SchemaConfig): Promise<SchemaResult<TOutput>>; _types?: { input: TInput; output: TOutput } } - changed:
type BaseValidation<TInput = any> = { async: false; message: ErrorMessage; _parse(input: TInput): PipeActionResult<TInput> } → type BaseValidation<TInput = any> = { expects: string | null; message: ErrorMessage | undefined; async: false; _parse(input: TInput): PipeActionResult<TInput> } - changed:
type BaseValidationAsync<TInput = any> = { async: true; message: ErrorMessage; _parse(input: TInput): Promise<PipeActionResult<TInput>> } → type BaseValidationAsync<TInput = any> = { expects: string | null; message: ErrorMessage | undefined; async: true; _parse(input: TInput): Promise<PipeActionResult<TInput>> } - changed:
type BigintSchema<TOutput = bigint> = BaseSchema<bigint, TOutput> & { type: 'bigint'; message: ErrorMessage; pipe: Pipe<bigint> | undefined } → type BigintSchema<TOutput = bigint> = BaseSchema<bigint, TOutput> & { type: 'bigint'; message: ErrorMessage | undefined; pipe: Pipe<bigint> | undefined } - changed:
type BigintSchemaAsync<TOutput = bigint> = BaseSchemaAsync<bigint, TOutput> & { type: 'bigint'; message: ErrorMessage; pipe: PipeAsync<bigint> | undefined } → type BigintSchemaAsync<TOutput = bigint> = BaseSchemaAsync<bigint, TOutput> & { type: 'bigint'; message: ErrorMessage | undefined; pipe: PipeAsync<bigint> | undefined } - changed:
type BlobSchema<TOutput = Blob> = BaseSchema<Blob, TOutput> & { type: 'blob'; message: ErrorMessage; pipe: Pipe<Blob> | undefined } → type BlobSchema<TOutput = Blob> = BaseSchema<Blob, TOutput> & { type: 'blob'; message: ErrorMessage | undefined; pipe: Pipe<Blob> | undefined } - changed:
type BlobSchemaAsync<TOutput = Blob> = BaseSchemaAsync<Blob, TOutput> & { type: 'blob'; message: ErrorMessage; pipe: PipeAsync<Blob> | undefined } → type BlobSchemaAsync<TOutput = Blob> = BaseSchemaAsync<Blob, TOutput> & { type: 'blob'; message: ErrorMessage | undefined; pipe: PipeAsync<Blob> | undefined } - changed:
type BooleanSchema<TOutput = boolean> = BaseSchema<boolean, TOutput> & { type: 'boolean'; message: ErrorMessage; pipe: Pipe<boolean> | undefined } → type BooleanSchema<TOutput = boolean> = BaseSchema<boolean, TOutput> & { type: 'boolean'; message: ErrorMessage | undefined; pipe: Pipe<boolean> | undefined } - changed:
type BooleanSchemaAsync<TOutput = boolean> = BaseSchemaAsync<boolean, TOutput> & { type: 'boolean'; message: ErrorMessage; pipe: PipeAsync<boolean> | undefined } → type BooleanSchemaAsync<TOutput = boolean> = BaseSchemaAsync<boolean, TOutput> & { type: 'boolean'; message: ErrorMessage | undefined; pipe: PipeAsync<boolean> | undefined } - changed:
type CreditCardValidation<TInput extends string> = BaseValidation<TInput> & { type: 'credit_card'; requirement: (input: string) => boolean } → type CreditCardValidation<TInput extends string> = BaseValidation<TInput> & { type: 'credit_card'; requirement: (input: TInput) => boolean } - changed:
type DateSchema<TOutput = Date> = BaseSchema<Date, TOutput> & { type: 'date'; message: ErrorMessage; pipe: Pipe<Date> | undefined } → type DateSchema<TOutput = Date> = BaseSchema<Date, TOutput> & { type: 'date'; message: ErrorMessage | undefined; pipe: Pipe<Date> | undefined } - changed:
type DateSchemaAsync<TOutput = Date> = BaseSchemaAsync<Date, TOutput> & { type: 'date'; message: ErrorMessage; pipe: PipeAsync<Date> | undefined } → type DateSchemaAsync<TOutput = Date> = BaseSchemaAsync<Date, TOutput> & { type: 'date'; message: ErrorMessage | undefined; pipe: PipeAsync<Date> | undefined } - changed:
type EnumSchema<TEnum extends Enum, TOutput = TEnum[keyof TEnum]> = BaseSchema<TEnum[keyof TEnum], TOutput> & { type: 'enum'; enum: TEnum; message: ErrorMessage } → type EnumSchema<TEnum extends Enum, TOutput = TEnum[keyof TEnum]> = BaseSchema<TEnum[keyof TEnum], TOutput> & { type: 'enum'; enum: TEnum; message: ErrorMessage | undefined } - changed:
type EnumSchemaAsync<TEnum extends Enum, TOutput = TEnum[keyof TEnum]> = BaseSchemaAsync<TEnum[keyof TEnum], TOutput> & { type: 'enum'; enum: TEnum; message: ErrorMessage } → type EnumSchemaAsync<TEnum extends Enum, TOutput = TEnum[keyof TEnum]> = BaseSchemaAsync<TEnum[keyof TEnum], TOutput> & { type: 'enum'; enum: TEnum; message: ErrorMessage | undefined } - changed:
type ErrorMessage = string | (() => string) → type ErrorMessage = string | ((issue: SchemaIssue) => string) - changed:
type FallbackInfo = { input: unknown; issues: Issues } → type FallbackInfo = { input: unknown; issues: SchemaIssues } - changed:
type InstanceSchema<TClass extends Class, TOutput = InstanceType<TClass>> = BaseSchema<InstanceType<TClass>, TOutput> & { type: 'instance'; class: TClass; message: ErrorMessage; pipe: Pipe<InstanceType<TClass>> | undefined } → type InstanceSchema<TClass extends Class, TOutput = InstanceType<TClass>> = BaseSchema<InstanceType<TClass>, TOutput> & { type: 'instance'; class: TClass; message: ErrorMessage | undefined; pipe: Pipe<InstanceType<TClass>> | undefined } - changed:
type InstanceSchemaAsync<TClass extends Class, TOutput = InstanceType<TClass>> = BaseSchemaAsync<InstanceType<TClass>, TOutput> & { type: 'instance'; class: TClass; message: ErrorMessage; pipe: PipeAsync<InstanceType<TClass>> | undefined } → type InstanceSchemaAsync<TClass extends Class, TOutput = InstanceType<TClass>> = BaseSchemaAsync<InstanceType<TClass>, TOutput> & { type: 'instance'; class: TClass; message: ErrorMessage | undefined; pipe: PipeAsync<InstanceType<TClass>> |… - changed:
type IntersectSchema<TOptions extends IntersectOptions, TOutput = IntersectOutput<TOptions>> = BaseSchema<IntersectInput<TOptions>, TOutput> & { type: 'intersect'; options: TOptions; message: ErrorMessage; pipe: Pipe<IntersectOutput<TOptions>> | undefine… → type IntersectSchema<TOptions extends IntersectOptions, TOutput = IntersectOutput<TOptions>> = BaseSchema<IntersectInput<TOptions>, TOutput> & { type: 'intersect'; options: TOptions; message: ErrorMessage | undefined; pipe: Pipe<IntersectOutput<TOptions>… - changed:
type InvalidActionResult = { output?: undefined; issues: Pick<Issue, 'validation' | 'message' | 'input' | 'requirement' | 'path'>[] } → type InvalidActionResult = { output?: undefined; issues: PipeActionIssues } - changed:
type LiteralSchema<TLiteral extends Literal, TOutput = TLiteral> = BaseSchema<TLiteral, TOutput> & { type: 'literal'; literal: TLiteral; message: ErrorMessage } → type LiteralSchema<TLiteral extends Literal, TOutput = TLiteral> = BaseSchema<TLiteral, TOutput> & { type: 'literal'; literal: TLiteral; message: ErrorMessage | undefined } - changed:
type LiteralSchemaAsync<TLiteral extends Literal, TOutput = TLiteral> = BaseSchemaAsync<TLiteral, TOutput> & { type: 'literal'; literal: TLiteral; message: ErrorMessage } → type LiteralSchemaAsync<TLiteral extends Literal, TOutput = TLiteral> = BaseSchemaAsync<TLiteral, TOutput> & { type: 'literal'; literal: TLiteral; message: ErrorMessage | undefined } - changed:
type MapPathItem = { type: 'map'; input: Map<unknown, unknown>; key: unknown; value: unknown } → type MapPathItem = { type: 'map'; origin: 'key' | 'value'; input: Map<unknown, unknown>; key: unknown; value: unknown } - changed:
type MapSchema<TKey extends BaseSchema, TValue extends BaseSchema, TOutput = MapOutput<TKey, TValue>> = BaseSchema<MapInput<TKey, TValue>, TOutput> & { type: 'map'; key: TKey; value: TValue; message: ErrorMessage; pipe: Pipe<MapOutput<TKey, TValue>> | undefined } → type MapSchema<TKey extends BaseSchema, TValue extends BaseSchema, TOutput = MapOutput<TKey, TValue>> = BaseSchema<MapInput<TKey, TValue>, TOutput> & { type: 'map'; key: TKey; value: TValue; message: ErrorMessage | undefined; pipe: Pipe<MapOutput<TKey, TValue>> |… - changed:
type MapSchemaAsync<TKey extends BaseSchema | BaseSchemaAsync, TValue extends BaseSchema | BaseSchemaAsync, TOutput = MapOutput<TKey, TValue>> = BaseSchemaAsync<MapInput<TKey, TValue>, TOutput> & { type: 'map'; key: TKey; value: TValue; message: ErrorMessage; pipe: PipeAsync<MapOutput<TKey, TValue>> | u… → type MapSchemaAsync<TKey extends BaseSchema | BaseSchemaAsync, TValue extends BaseSchema | BaseSchemaAsync, TOutput = MapOutput<TKey, TValue>> = BaseSchemaAsync<MapInput<TKey, TValue>, TOutput> & { type: 'map'; key: TKey; value: TValue; message: ErrorMessage | undefined; pipe: PipeAsync<MapOutput<TKey,… - changed:
type NanSchema<TOutput = number> = BaseSchema<number, TOutput> & { type: 'nan'; message: ErrorMessage } → type NanSchema<TOutput = number> = BaseSchema<number, TOutput> & { type: 'nan'; message: ErrorMessage | undefined } - changed:
type NanSchemaAsync<TOutput = number> = BaseSchemaAsync<number, TOutput> & { type: 'nan'; message: ErrorMessage } → type NanSchemaAsync<TOutput = number> = BaseSchemaAsync<number, TOutput> & { type: 'nan'; message: ErrorMessage | undefined } - changed:
type NeverSchema = BaseSchema<never> & { type: 'never'; message: ErrorMessage } → type NeverSchema = BaseSchema<never> & { type: 'never'; message: ErrorMessage | undefined } - changed:
type NeverSchemaAsync = BaseSchemaAsync<never> & { type: 'never'; message: ErrorMessage } → type NeverSchemaAsync = BaseSchemaAsync<never> & { type: 'never'; message: ErrorMessage | undefined } - changed:
type NonNullableSchema<TWrapped extends BaseSchema, TOutput = NonNullableOutput<TWrapped>> = BaseSchema<NonNullableInput<TWrapped>, TOutput> & { type: 'non_nullable'; wrapped: TWrapped; message: ErrorMessage } → type NonNullableSchema<TWrapped extends BaseSchema, TOutput = NonNullableOutput<TWrapped>> = BaseSchema<NonNullableInput<TWrapped>, TOutput> & { type: 'non_nullable'; wrapped: TWrapped; message: ErrorMessage | undefined } - changed:
type NonNullableSchemaAsync<TWrapped extends BaseSchema | BaseSchemaAsync, TOutput = NonNullableOutput<TWrapped>> = BaseSchemaAsync<NonNullableInput<TWrapped>, TOutput> & { type: 'non_nullable'; wrapped: TWrapped; message: ErrorMessage } → type NonNullableSchemaAsync<TWrapped extends BaseSchema | BaseSchemaAsync, TOutput = NonNullableOutput<TWrapped>> = BaseSchemaAsync<NonNullableInput<TWrapped>, TOutput> & { type: 'non_nullable'; wrapped: TWrapped; message: ErrorMessage | undefined } - changed:
type NonNullishSchema<TWrapped extends BaseSchema, TOutput = NonNullishOutput<TWrapped>> = BaseSchema<NonNullishInput<TWrapped>, TOutput> & { type: 'non_nullish'; wrapped: TWrapped; message: ErrorMessage } → type NonNullishSchema<TWrapped extends BaseSchema, TOutput = NonNullishOutput<TWrapped>> = BaseSchema<NonNullishInput<TWrapped>, TOutput> & { type: 'non_nullish'; wrapped: TWrapped; message: ErrorMessage | undefined } - changed:
type NonNullishSchemaAsync<TWrapped extends BaseSchema | BaseSchemaAsync, TOutput = NonNullishOutput<TWrapped>> = BaseSchemaAsync<NonNullishInput<TWrapped>, TOutput> & { type: 'non_nullish'; wrapped: TWrapped; message: ErrorMessage } → type NonNullishSchemaAsync<TWrapped extends BaseSchema | BaseSchemaAsync, TOutput = NonNullishOutput<TWrapped>> = BaseSchemaAsync<NonNullishInput<TWrapped>, TOutput> & { type: 'non_nullish'; wrapped: TWrapped; message: ErrorMessage | undefined } - changed:
type NonOptionalSchema<TWrapped extends BaseSchema, TOutput = NonOptionalOutput<TWrapped>> = BaseSchema<NonOptionalInput<TWrapped>, TOutput> & { type: 'non_optional'; wrapped: TWrapped; message: ErrorMessage } → type NonOptionalSchema<TWrapped extends BaseSchema, TOutput = NonOptionalOutput<TWrapped>> = BaseSchema<NonOptionalInput<TWrapped>, TOutput> & { type: 'non_optional'; wrapped: TWrapped; message: ErrorMessage | undefined } - changed:
type NonOptionalSchemaAsync<TWrapped extends BaseSchema | BaseSchemaAsync, TOutput = NonOptionalOutput<TWrapped>> = BaseSchemaAsync<NonOptionalInput<TWrapped>, TOutput> & { type: 'non_optional'; wrapped: TWrapped; message: ErrorMessage } → type NonOptionalSchemaAsync<TWrapped extends BaseSchema | BaseSchemaAsync, TOutput = NonOptionalOutput<TWrapped>> = BaseSchemaAsync<NonOptionalInput<TWrapped>, TOutput> & { type: 'non_optional'; wrapped: TWrapped; message: ErrorMessage | undefined } - changed:
type NullSchema<TOutput = null> = BaseSchema<null, TOutput> & { type: 'null'; message: ErrorMessage } → type NullSchema<TOutput = null> = BaseSchema<null, TOutput> & { type: 'null'; message: ErrorMessage | undefined } - changed:
type NullSchemaAsync<TOutput = null> = BaseSchemaAsync<null, TOutput> & { type: 'null'; message: ErrorMessage } → type NullSchemaAsync<TOutput = null> = BaseSchemaAsync<null, TOutput> & { type: 'null'; message: ErrorMessage | undefined } - changed:
type NumberSchema<TOutput = number> = BaseSchema<number, TOutput> & { type: 'number'; message: ErrorMessage; pipe: Pipe<number> | undefined } → type NumberSchema<TOutput = number> = BaseSchema<number, TOutput> & { type: 'number'; message: ErrorMessage | undefined; pipe: Pipe<number> | undefined } - changed:
type NumberSchemaAsync<TOutput = number> = BaseSchemaAsync<number, TOutput> & { type: 'number'; message: ErrorMessage; pipe: PipeAsync<number> | undefined } → type NumberSchemaAsync<TOutput = number> = BaseSchemaAsync<number, TOutput> & { type: 'number'; message: ErrorMessage | undefined; pipe: PipeAsync<number> | undefined } - changed:
type ObjectPathItem = { type: 'object'; input: Record<string, unknown>; key: string; value: unknown } → type ObjectPathItem = { type: 'object'; origin: 'value'; input: Record<string, unknown>; key: string; value: unknown } - changed:
type ObjectSchema<TEntries extends ObjectEntries, TRest extends BaseSchema | undefined = undefined, TOutput = ObjectOutput<TEntries, TRest>> = BaseSchema<ObjectInput<TEntries, TRest>, TOutput> & { type: 'object'; entries: TEntries; rest: TRest; message: ErrorMessage; pipe: Pipe<ObjectOutput<TEntries,… → type ObjectSchema<TEntries extends ObjectEntries, TRest extends BaseSchema | undefined = undefined, TOutput = ObjectOutput<TEntries, TRest>> = BaseSchema<ObjectInput<TEntries, TRest>, TOutput> & { type: 'object'; entries: TEntries; rest: TRest; message: ErrorMessage | undefined; pipe: Pipe<ObjectOutpu… - changed:
type ObjectSchemaAsync<TEntries extends ObjectEntriesAsync, TRest extends BaseSchema | BaseSchemaAsync | undefined = undefined, TOutput = ObjectOutput<TEntries, TRest>> = BaseSchemaAsync<ObjectInput<TEntries, TRest>, TOutput> & { type: 'object'; entries: TEntries; rest: TRest; message: ErrorMessage; pipe: PipeAsync<ObjectOutput<… → type ObjectSchemaAsync<TEntries extends ObjectEntriesAsync, TRest extends BaseSchema | BaseSchemaAsync | undefined = undefined, TOutput = ObjectOutput<TEntries, TRest>> = BaseSchemaAsync<ObjectInput<TEntries, TRest>, TOutput> & { type: 'object'; entries: TEntries; rest: TRest; message: ErrorMessage | undefined; pipe: PipeAsync<O… - changed:
type PicklistOptions = MaybeReadonly<string[]> → type PicklistOptions = MaybeReadonly<(string | number | bigint)[]> - changed:
type PicklistSchema<TOptions extends PicklistOptions, TOutput = TOptions[number]> = BaseSchema<TOptions[number], TOutput> & { type: 'picklist'; options: TOptions; message: ErrorMessage } → type PicklistSchema<TOptions extends PicklistOptions, TOutput = TOptions[number]> = BaseSchema<TOptions[number], TOutput> & { type: 'picklist'; options: TOptions; message: ErrorMessage | undefined } - changed:
type PicklistSchemaAsync<TOptions extends PicklistOptions, TOutput = TOptions[number]> = BaseSchemaAsync<TOptions[number], TOutput> & { type: 'picklist'; options: TOptions; message: ErrorMessage } → type PicklistSchemaAsync<TOptions extends PicklistOptions, TOutput = TOptions[number]> = BaseSchemaAsync<TOptions[number], TOutput> & { type: 'picklist'; options: TOptions; message: ErrorMessage | undefined } - changed:
type RecordPathItem = { type: 'record'; input: Record<string | number | symbol, unknown>; key: string | number | symbol; value: unknown } → type RecordPathItem = { type: 'record'; origin: 'key' | 'value'; input: Record<string | number | symbol, unknown>; key: string | number | symbol; value: unknown } - changed:
type RecordSchema<TKey extends RecordKey, TValue extends BaseSchema, TOutput = RecordOutput<TKey, TValue>> = BaseSchema<RecordInput<TKey, TValue>, TOutput> & { type: 'record'; key: TKey; value: TValue; message: ErrorMessage; pipe: Pipe<RecordOutput<TKey, TValue>> | un… → type RecordSchema<TKey extends RecordKey, TValue extends BaseSchema, TOutput = RecordOutput<TKey, TValue>> = BaseSchema<RecordInput<TKey, TValue>, TOutput> & { type: 'record'; key: TKey; value: TValue; message: ErrorMessage | undefined; pipe: Pipe<RecordOutput<TKey, T… - changed:
type RecordSchemaAsync<TKey extends RecordKeyAsync, TValue extends BaseSchema | BaseSchemaAsync, TOutput = RecordOutput<TKey, TValue>> = BaseSchemaAsync<RecordInput<TKey, TValue>, TOutput> & { type: 'record'; key: TKey; value: TValue; message: ErrorMessage; pipe: PipeAsync<RecordOutput<TKey, TVa… → type RecordSchemaAsync<TKey extends RecordKeyAsync, TValue extends BaseSchema | BaseSchemaAsync, TOutput = RecordOutput<TKey, TValue>> = BaseSchemaAsync<RecordInput<TKey, TValue>, TOutput> & { type: 'record'; key: TKey; value: TValue; message: ErrorMessage | undefined; pipe: PipeAsync<RecordOutp… - changed:
type SchemaWithTransformAsync<TSchema extends BaseSchema | BaseSchemaAsync, TOutput> = Omit<TSchema, 'async' | '_parse' | '_types'> & { async: true; _parse(input: unknown, info?: ParseInfo): Promise<SchemaResult<TOutput>>; _types?: { input: Input… → type SchemaWithTransformAsync<TSchema extends BaseSchema | BaseSchemaAsync, TOutput> = Omit<TSchema, 'async' | '_parse' | '_types'> & { async: true; _parse(input: unknown, config?: SchemaConfig): Promise<SchemaResult<TOutput>>; _types?: { input:… - changed:
type SetPathItem = { type: 'set'; input: Set<unknown>; key: number; value: unknown } → type SetPathItem = { type: 'set'; origin: 'value'; input: Set<unknown>; key: number; value: unknown } - changed:
type SetSchema<TValue extends BaseSchema, TOutput = SetOutput<TValue>> = BaseSchema<SetInput<TValue>, TOutput> & { type: 'set'; value: TValue; message: ErrorMessage; pipe: Pipe<SetOutput<TValue>> | undefined } → type SetSchema<TValue extends BaseSchema, TOutput = SetOutput<TValue>> = BaseSchema<SetInput<TValue>, TOutput> & { type: 'set'; value: TValue; message: ErrorMessage | undefined; pipe: Pipe<SetOutput<TValue>> | undefined } - changed:
type SetSchemaAsync<TValue extends BaseSchema | BaseSchemaAsync, TOutput = SetOutput<TValue>> = BaseSchemaAsync<SetInput<TValue>, TOutput> & { type: 'set'; value: TValue; message: ErrorMessage; pipe: PipeAsync<SetOutput<TValue>> | undefined } → type SetSchemaAsync<TValue extends BaseSchema | BaseSchemaAsync, TOutput = SetOutput<TValue>> = BaseSchemaAsync<SetInput<TValue>, TOutput> & { type: 'set'; value: TValue; message: ErrorMessage | undefined; pipe: PipeAsync<SetOutput<TValue>> | undefined } - changed:
type SpecialSchema<TInput, TOutput = TInput> = BaseSchema<TInput, TOutput> & { type: 'special'; check: (input: unknown) => boolean; message: ErrorMessage; pipe: Pipe<TInput> | undefined } → type SpecialSchema<TInput, TOutput = TInput> = BaseSchema<TInput, TOutput> & { type: 'special'; check: (input: unknown) => boolean; message: ErrorMessage | undefined; pipe: Pipe<TInput> | undefined } - changed:
type SpecialSchemaAsync<TInput, TOutput = TInput> = BaseSchemaAsync<TInput, TOutput> & { type: 'special'; check: (input: unknown) => boolean | Promise<boolean>; message: ErrorMessage; pipe: PipeAsync<TInput> | u… → type SpecialSchemaAsync<TInput, TOutput = TInput> = BaseSchemaAsync<TInput, TOutput> & { type: 'special'; check: (input: unknown) => boolean | Promise<boolean>; message: ErrorMessage | undefined; pipe: PipeAsync… - changed:
type StringSchema<TOutput = string> = BaseSchema<string, TOutput> & { type: 'string'; message: ErrorMessage; pipe: Pipe<string> | undefined } → type StringSchema<TOutput = string> = BaseSchema<string, TOutput> & { type: 'string'; message: ErrorMessage | undefined; pipe: Pipe<string> | undefined } - changed:
type StringSchemaAsync<TOutput = string> = BaseSchemaAsync<string, TOutput> & { type: 'string'; message: ErrorMessage; pipe: PipeAsync<string> | undefined } → type StringSchemaAsync<TOutput = string> = BaseSchemaAsync<string, TOutput> & { type: 'string'; message: ErrorMessage | undefined; pipe: PipeAsync<string> | undefined } - changed:
type SymbolSchema<TOutput = symbol> = BaseSchema<symbol, TOutput> & { type: 'symbol'; message: ErrorMessage } → type SymbolSchema<TOutput = symbol> = BaseSchema<symbol, TOutput> & { type: 'symbol'; message: ErrorMessage | undefined } - changed:
type SymbolSchemaAsync<TOutput = symbol> = BaseSchemaAsync<symbol, TOutput> & { type: 'symbol'; message: ErrorMessage } → type SymbolSchemaAsync<TOutput = symbol> = BaseSchemaAsync<symbol, TOutput> & { type: 'symbol'; message: ErrorMessage | undefined } - changed:
type TuplePathItem = { type: 'tuple'; input: [unknown, ...unknown[]]; key: number; value: unknown } → type TuplePathItem = { type: 'tuple'; origin: 'value'; input: [unknown, ...unknown[]]; key: number; value: unknown } - changed:
type TupleSchema<TItems extends TupleItems, TRest extends BaseSchema | undefined = undefined, TOutput = TupleOutput<TItems, TRest>> = BaseSchema<TupleInput<TItems, TRest>, TOutput> & { type: 'tuple'; items: TItems; rest: TRest; message: ErrorMessage; pipe: Pipe<TupleOutput<TItems, TRest>> | u… → type TupleSchema<TItems extends TupleItems, TRest extends BaseSchema | undefined = undefined, TOutput = TupleOutput<TItems, TRest>> = BaseSchema<TupleInput<TItems, TRest>, TOutput> & { type: 'tuple'; items: TItems; rest: TRest; message: ErrorMessage | undefined; pipe: Pipe<TupleOutput<TItems,… - changed:
type TupleSchemaAsync<TItems extends TupleItemsAsync, TRest extends BaseSchema | BaseSchemaAsync | undefined = undefined, TOutput = TupleOutput<TItems, TRest>> = BaseSchemaAsync<TupleInput<TItems, TRest>, TOutput> & { type: 'tuple'; items: TItems; rest: TRest; message: ErrorMessage; pipe: PipeAsync<TupleOutput<TItems, T… → type TupleSchemaAsync<TItems extends TupleItemsAsync, TRest extends BaseSchema | BaseSchemaAsync | undefined = undefined, TOutput = TupleOutput<TItems, TRest>> = BaseSchemaAsync<TupleInput<TItems, TRest>, TOutput> & { type: 'tuple'; items: TItems; rest: TRest; message: ErrorMessage | undefined; pipe: PipeAsync<TupleOutp… - changed:
type TypedSchemaResult<TOutput> = { typed: true; output: TOutput; issues?: Issues } → type TypedSchemaResult<TOutput> = { typed: true; output: TOutput; issues?: SchemaIssues } - changed:
type UndefinedSchema<TOutput = undefined> = BaseSchema<undefined, TOutput> & { type: 'undefined'; message: ErrorMessage } → type UndefinedSchema<TOutput = undefined> = BaseSchema<undefined, TOutput> & { type: 'undefined'; message: ErrorMessage | undefined } - changed:
type UndefinedSchemaAsync<TOutput = undefined> = BaseSchemaAsync<undefined, TOutput> & { type: 'undefined'; message: ErrorMessage } → type UndefinedSchemaAsync<TOutput = undefined> = BaseSchemaAsync<undefined, TOutput> & { type: 'undefined'; message: ErrorMessage | undefined } - changed:
type UnionSchema<TOptions extends UnionOptions, TOutput = Output<TOptions[number]>> = BaseSchema<Input<TOptions[number]>, TOutput> & { type: 'union'; options: TOptions; message: ErrorMessage; pipe: Pipe<Output<TOptions[number]>> | undefined } → type UnionSchema<TOptions extends UnionOptions, TOutput = Output<TOptions[number]>> = BaseSchema<Input<TOptions[number]>, TOutput> & { type: 'union'; options: TOptions; message: ErrorMessage | undefined; pipe: Pipe<Output<TOptions[number]>> | un… - changed:
type UnionSchemaAsync<TOptions extends UnionOptionsAsync, TOutput = Output<TOptions[number]>> = BaseSchemaAsync<Input<TOptions[number]>, TOutput> & { type: 'union'; options: TOptions; message: ErrorMessage; pipe: PipeAsync<Input<TOptions[number]>> | undef… → type UnionSchemaAsync<TOptions extends UnionOptionsAsync, TOutput = Output<TOptions[number]>> = BaseSchemaAsync<Input<TOptions[number]>, TOutput> & { type: 'union'; options: TOptions; message: ErrorMessage | undefined; pipe: PipeAsync<Input<TOptions[numbe… - changed:
type UnknownPathItem = { type: 'unknown'; input: unknown; key: unknown; value: unknown } → type UnknownPathItem = { type: 'unknown'; origin: 'key' | 'value'; input: unknown; key: unknown; value: unknown } - changed:
type UntypedSchemaResult = { typed: false; output: unknown; issues: Issues } → type UntypedSchemaResult = { typed: false; output: unknown; issues: SchemaIssues } - changed:
type VariantSchema<TKey extends string, TOptions extends VariantOptions<TKey>, TOutput = Output<TOptions[number]>> = BaseSchema<Input<TOptions[number]>, TOutput> & { type: 'variant'; key: TKey; options: TOptions; message: ErrorMessage; pipe: Pipe<Output<TOptions[number]>> | u… → type VariantSchema<TKey extends string, TOptions extends VariantOptions<TKey>, TOutput = Output<TOptions[number]>> = BaseSchema<Input<TOptions[number]>, TOutput> & { type: 'variant'; key: TKey; options: TOptions; message: ErrorMessage | undefined; pipe: Pipe<Output<TOptions[n… - changed:
type VariantSchemaAsync<TKey extends string, TOptions extends VariantOptionsAsync<TKey>, TOutput = Output<TOptions[number]>> = BaseSchemaAsync<Input<TOptions[number]>, TOutput> & { type: 'variant'; key: TKey; options: TOptions; message: ErrorMessage; pipe: PipeAsync<Input<TOptions[numb… → type VariantSchemaAsync<TKey extends string, TOptions extends VariantOptionsAsync<TKey>, TOutput = Output<TOptions[number]>> = BaseSchemaAsync<Input<TOptions[number]>, TOutput> & { type: 'variant'; key: TKey; options: TOptions; message: ErrorMessage | undefined; pipe: PipeAsync<Input<T… - changed:
type VoidSchema<TOutput = void> = BaseSchema<void, TOutput> & { type: 'void'; message: ErrorMessage } → type VoidSchema<TOutput = void> = BaseSchema<void, TOutput> & { type: 'void'; message: ErrorMessage | undefined } - changed:
type VoidSchemaAsync<TOutput = void> = BaseSchemaAsync<void, TOutput> & { type: 'void'; message: ErrorMessage } → type VoidSchemaAsync<TOutput = void> = BaseSchemaAsync<void, TOutput> & { type: 'void'; message: ErrorMessage | undefined } - added:
function deleteGlobalConfig(): void - added:
function deleteGlobalMessage(lang?: string): void - added:
function deleteSchemaMessage(lang?: string): void - added:
function deleteSpecificMessage(reference: Function, lang?: string): void - added:
function forwardAsync<TInput extends unknown[] | Record<string, unknown>>(validation: BaseValidationAsync<TInput>, pathList: PathList<TInput>): BaseValidationAsync<TInput> - added:
function getGlobalConfig(config?: SchemaConfig): SchemaConfig - added:
function getGlobalMessage(lang?: string): ErrorMessage | undefined - added:
function getSchemaMessage(lang?: string): ErrorMessage | undefined - added:
function getSpecificMessage(reference: Function, lang?: string): ErrorMessage | undefined - added:
function hash<TInput extends string>(types: [HashType, ...HashType[]], message?: ErrorMessage): HashValidation<TInput> - added:
function i18n(context: I18nContext, reference: Function, config: SchemaConfig | undefined, issue: SchemaIssue): string - added:
function schemaResult(typed: false, output: unknown, issues: SchemaIssues): UntypedSchemaResult - added:
function schemaResult<TOutput>(typed: true, output: TOutput, issues?: SchemaIssues): TypedSchemaResult<TOutput> - added:
function setGlobalConfig(config: GlobalConfig): void - added:
function setGlobalMessage(message: ErrorMessage, lang?: string): void - added:
function setSchemaMessage(message: ErrorMessage, lang?: string): void - added:
function setSpecificMessage(reference: Function, message: ErrorMessage, lang?: string): void - added:
function stringify(input: unknown): string - added:
type GlobalConfig = Omit<SchemaConfig, 'message'> - added:
type HashType = keyof typeof HASH_LENGTHS - added:
type HashValidation<TInput extends string> = BaseValidation<TInput> & { type: 'hash'; requirement: RegExp } - added:
type IssuePath = [PathItem, ...PathItem[]] - added:
type PathList<TInput extends unknown[] | Record<string, unknown>> = TInput extends any[] ? PathTuple<TInput, number> : PathTuple<TInput, keyof TInput> - added:
type PipeActionContext = { type: string; expects: string | null; message: ErrorMessage | undefined; requirement: unknown } - added:
type PipeActionIssue = { context: PipeActionContext; reference: Function; input: unknown; label: string; received?: string; path?: IssuePath } - added:
type PipeActionIssues = [PipeActionIssue, ...PipeActionIssue[]] - added:
type SchemaConfig = { lang?: string; message?: ErrorMessage; abortEarly?: boolean; abortPipeEarly?: boolean; skipPipe?: boolean } - added:
type SchemaIssue = Omit<SchemaConfig, 'message'> & { reason: IssueReason; context: string; input: unknown; expected: string | null; received: string; message: string; requirement… - added:
type SchemaIssues = [SchemaIssue, ...SchemaIssue[]]