Get unlimited public & private packages + team-based management with npm Teams.Learn more »

@ycleptkellan/substantive

1.0.6 • Public • Published

substantive

styled with prettier Build Status Coverage Status dependencies Status

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

API

https://ycleptkellan.github.io/substantive/

Install

npm i @ycleptkellan/substantive

DownloadsWeekly Downloads

6

Version

1.0.6

License

MIT

Last publish

Collaborators

  • avatar