array-ify

Turn anything into an array

MIT License

Downloads
23.1M
Stars
5
Committers
2

NPM version Build Status Dependency Status Coverage Status

Turn anything into an array

Install

$ npm install --save array-ify

Usage

var arrayify = require('array-ify');

arrayify('unicorn');
//=> ['unicorn']

arrayify(['unicorn']);
//=> ['unicorn']

arrayify(null);
//=> [null]

arrayify(undefined);
//=> [undefined]

Related

  • arrify - Convert a value to an array

The difference that is this module does NOT turn null or undefined to an empty array.

License

MIT © Steve Mao

Package Rankings
Top 3.92% on Npmjs.org
Top 33.53% on Repo1.maven.org
Badges
Extracted from project README
NPM version Build Status Dependency Status Coverage Status