npm.io
1.0.0 • Published 8 years ago

is-primitive-array

Licence
MIT
Version
1.0.0
Deps
1
Vulns
0
Weekly
0

is-primitive-array

Check if a javascript array contains only primitive values


    // If you want it to be a dev dependency
    npm i -D is-primitive-array

    // If you want it to be a dependency
    npm i -S is-primitive-array

    // If you want it to be a global install
    npm i -g is-primitive-array

Usage


    // look into spec/

    const primitiveArray = [1, 'a', 0, '', true, false]
    isPrimitiveArray(primitiveArray)) // true

    const nonPrimitiveArray = [1, 'a', 0, '', true, false, {}]
    isPrimitiveArray(nonPrimitiveArray)) // false

Test


    npm run test

    // or

    jasmine

Lint


    npm run lint

    // or

    eslint index.js spec/**/*.spec.js

Development

Feel free to send a pull request.

License

MIT Anubhav Saini 2017