Skip to content

Function.partial

github-actions[bot] edited this page May 8, 2026 · 29 revisions

umt / partial

Function: partial()

partial<T>(validator, message?): ObjectValidator<PartialShape<T>>

Defined in: Validate/object/partial.ts:32

Wraps every property validator of validator with optional(). Validators that are already optional are kept as-is so the wrapper stays idempotent.

Type Parameters

T

T extends ObjectShape

Original object shape

Parameters

validator

ObjectValidator<T>

Source object validator

message?

string

Custom error message for the new validator

Returns

ObjectValidator<PartialShape<T>>

  • New validator where every key accepts undefined

API

Classes

Interfaces

Type Aliases

Variables

Functions

Clone this wiki locally