isEmpty
function isEmpty<T, K>(obj): obj is undefined | EmptyArray<T> | Record<K, never>;
Verify if the provided unknown object is empty
Check the test cases for the assumptions
Type Parameters
| Type Parameter |
|---|
T |
K extends string | number | symbol |
Parameters
| Parameter | Type | Description |
|---|---|---|
obj | undefined | Partial<Record<K, unknown>> | T[] | An object to be tested |
Returns
obj is undefined | EmptyArray<T> | Record<K, never>