toarray
v0.0.1
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:
Downloads
50,862
Readme
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)); //[]