Add is.truthy() and is.falsy() (#25)
This commit is contained in:
parent
cdd4829edf
commit
dfcdfc3a83
3 changed files with 37 additions and 1 deletions
16
readme.md
16
readme.md
|
|
@ -121,6 +121,22 @@ is.asyncFunction(() => {});
|
|||
|
||||
#### Miscellaneous
|
||||
|
||||
##### .truthy(value)
|
||||
|
||||
Returns `true` for all values that evaluate to true in a boolean context:
|
||||
|
||||
```js
|
||||
is.truthy('🦄');
|
||||
//=> true
|
||||
|
||||
is.truthy(undefined);
|
||||
//=> false
|
||||
```
|
||||
|
||||
##### .falsy(value)
|
||||
|
||||
Returns `true` if `value` is one of: `false`, `0`, `''`, `null`, `undefined`, `NaN`.
|
||||
|
||||
##### .nan(value)
|
||||
##### .nullOrUndefined(value)
|
||||
##### .primitive(value)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue