toarray

0.0.1 • Public • Published

I find myself writing item = item instanceof Array ? item : [item] a lot, so I decided to make a simple library to does it for me. A few examples:

toArray = require("toarray");
 
console.log(toArray("hello-world!")); //["hello-world!"]
console.log(toArray(["hello-world!"])); //["hello-world!"]
console.log(toArray(undefined)); //[]

Dependencies (0)

    Dev Dependencies (2)

    Package Sidebar

    Install

    npm i toarray

    Weekly Downloads

    100,334

    Version

    0.0.1

    License

    BSD

    Last publish

    Collaborators

    • architectd
    • crcn