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

This commit is contained in:
Brandon Smith 2017-10-20 14:49:52 +00:00 committed by Giora Guttsait
parent cdd4829edf
commit dfcdfc3a83
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)