1.0.6 • Published 8 years ago
@ycleptkellan/substantive v1.0.6
substantive
Determine whether a given argument is both truthy and iterable.
[] and {} are truthy in JavaScript. By the same token, '0' is falsy. Etc...
Accounting for these idiosyncracies can be inconvenient, so this library provides a few simple helpers. E. g.
if (this.props.list && this.props.list.length) {
// do something w/ list
}becomes
if (substArr(this.props.list)) {
// do something w/ list
}Install
$ npm i (-D) @ycleptkellan/substantive