Skip to main content

omit()

omit<T, K>(schema, keys, message?): OmitSchema<ObjectSchema<T>, K>

Omit transform - excludes specific properties.


Type Parameters​

T: T extends Record<string, GenericSchema>​

K: K extends string | number | symbol​


Parameters​

schema: ObjectSchema<T> | ObjectConstraint<T> | { entries: T; }​

Source object schema.

keys: readonly K[]​

Keys to exclude.

message?: string​

Custom error message.


Returns: OmitSchema<ObjectSchema<T>, K>​

Schema without excluded properties.


Since​

2.0.0