Add is.truthy() and is.falsy()

This commit is contained in:
Brandon Smith 2017-10-19 21:45:34 -04:00
parent cdd4829edf
commit 210a2cdbeb
3 changed files with 37 additions and 1 deletions

View file

@ -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)