is-present
Version:
Check whether a value is nonblank.
52 lines (37 loc) • 1.44 kB
Markdown
value is nonblank.
```
npm i --save is-present
```
```javascript
var isPresent = require('is-present');
isPresent([]); // => false
isPresent({}); // => false
isPresent(0); // => false
isPresent(function(){}); // => false
isPresent(null); // => false
isPresent(undefined); // => false
isPresent(''); // => false
isPresent(' '); // => false
isPresent('\r\t\n '); // => false
isPresent(['a', 'b']); // => true
isPresent({ a: 'b' }); // => true
isPresent('string'); // => true
isPresent(42); // => true
isPresent(function(a,b){}); // => true
```
A negation for [is-blank](https://github.com/johnotander/is-blank) which extends
[ ](https://github.com/ianstormtaylor/is-empty) and
[ ](https://github.com/jonschlinkert/is-whitespace).
MIT
1. Fork it
2. Create your feature branch (`git checkout -b my-new-feature`)
3. Commit your changes (`git commit -am 'Add some feature'`)
4. Push to the branch (`git push origin my-new-feature`)
5. Create new Pull Request
Crafted with <3 by [John Otander](http://johnotander.com) ([@4lpine](https://twitter.com/4lpine)).
Check whether a