isEmpty
Check if the input parameter is an empty value, including undefined, null, NaN, '' and array with length of 0.
Added in v0.0.6
Usage
ts
import { isEmpty } from 'parsnip-kit'
isEmpty(undefined) // true
isEmpty(null) // true
isEmpty(NaN) // true
isEmpty('') // true
isEmpty([]) // true
isEmpty([1, 2, 3]) // false
isEmpty({ key: 'value' }) // falseAPI
Arguments
| Arg | Type | Optional | Default | Description |
|---|---|---|---|---|
arg | any | false | undefined | The argument to check |
Returns
| Type |
|---|
boolean |