toarray

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:

BSD 2 个版本
安装
npm install toarray
yarn add toarray
pnpm add toarray
bun add toarray
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)); //[]
版本列表
0.0.1 2013-05-23
0.0.0 2013-02-09