Skip to content

Function.omitKeys

github-actions[bot] edited this page Jun 18, 2026 · 20 revisions

umt / omitKeys

Function: omitKeys()

omitKeys<T, K>(validator, keys, message?): (value) => ValidateCoreReturnType<InferObject<Omit<T, K[number]>>> & object & StandardSchemaV1<InferObject<Omit<T, K[number]>>, InferObject<Omit<T, K[number]>>>

Defined in: Validate/object/omitKeys.ts:31

Removes the given keys from an existing object validator and returns a new object validator covering the remaining keys.

Type Parameters

T

T extends ObjectShape

Original object shape

K

K extends readonly keyof T[]

Tuple of keys to omit from the original shape

Parameters

validator

ObjectValidator<T>

Source object validator

keys

K

Keys to drop from the new validator

message?

string

Custom error message for the omitted validator

Returns

(value) => ValidateCoreReturnType<InferObject<Omit<T, K[number]>>> & object & StandardSchemaV1<InferObject<Omit<T, K[number]>>, InferObject<Omit<T, K[number]>>>

  • New validator without omitted keys

API

Classes

Interfaces

Type Aliases

Variables

Functions

Clone this wiki locally