November Perfect Moustache

    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)); //[]

    Keywords

    none

    Install

    npm i toarray

    DownloadsWeekly Downloads

    10,781

    Version

    0.0.1

    License

    BSD

    Last publish

    Collaborators

    • architectd
    • crcn