hasPropertiesDefined
Callable
Type parameters
- T
The filter value input type.
- K: string | number | symbol
The keys on
T
to make required.
Parameters
keys: K | K[]
The keys to make required in this filter.
Returns (obj: T | RequireKeys<T, K>) => obj is RequireKeys<T, K>
The typeguard function.
Parameters
obj: T | RequireKeys<T, K>
Returns obj is RequireKeys<T, K>
- T
Creates a function that acts as a typeguard that makes all given properties required, by checking if all values on the given property are not equal to
undefined
.Example
will be mostly unneeded in typescript 5.5 https://github.com/microsoft/TypeScript/pull/57465