Open menu dropdown
DeepPartial
Recursive variant of TypeScript's `Partial<T>` — every property at every depth becomes optional.
Usage
ts
import type { DeepPartial } from '@maz-ui/utils'
interface UserSettings {
notifications: {
email: boolean
push: boolean
}
theme: {
primary: string
secondary: string
}
}
const update: DeepPartial<UserSettings> = {
notifications: { email: false },
}API
ts
type DeepPartial<T> = T extends object
? { [P in keyof T]?: DeepPartial<T[P]> }
: TNotes
- Primitives (
string,number,boolean,null,undefined, …) are returned unchanged. - Useful for partial-update payloads (
PATCHrequests, merge functions, default-options patterns).