Nuclearly Potent Moonshine
    Share your code. npm Orgs help your team discover, share, and reuse code. Create a free org »

    as-arraypublic

    as-array

    Make any value an array. No dependencies.

    Install

    npm install as-array --save
    

    Usage

    var asArray = require('as-array');
     
    asArray() === [];
    asArray('my string') === ['my string'];
    asArray([1,2,3]) === [1,2,3];
     
    function tester () {
      asArray(arguments) === ['arg1', 'arg2'];
    }
    tester('arg1', 'arg2');

    asArray(data[, convertObject])

    • data - any data type to convert to an array
    • convertObject - OPTIONAL boolean - pull values from object as array content

    Run Tests

    npm install
    npm test
    

    install

    npm i as-array

    Downloadsweekly downloads

    71,668

    version

    2.0.0

    license

    MIT

    repository

    githubgithub

    last publish

    collaborators

    • avatar