Have ideas to improve npm?Join in the discussion! ¬Ľ

    @ycleptkellan/substantive
    TypeScript icon, indicating that this package has built-in type declarations

    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

    4

    Version

    1.0.6

    License

    MIT

    Last publish

    Collaborators

    • avatar