typelab / utils / ObjectRequired
type ObjectRequired<T, Key, IncludeUndefined> = _ObjectRequired<T, Key, IncludeUndefined>;Extended TypeScript `Required` to enforce specific properties as required.
| Type Parameter | Default type | Description |
|---|---|---|
|
|
‐ |
The original |
|
|
‐ |
The keys of |
|
|
|
Include undefined type from |
A type with the specified keys of T set as required.
type Obj = { a?: string; b?: string };
// { a: string; b?: string }
type RequiredObj = ObjectRequired<Obj, 'a'>;