array-ify

1.0.0 • Public • Published

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

Versions

Current Tags

VersionDownloads (Last 7 Days)Tag
1.0.07,465,881latest

Version History

VersionDownloads (Last 7 Days)Published
1.0.07,465,881
0.0.049

Package Sidebar

Install

npm i array-ify

Weekly Downloads

6,037,765

Version

1.0.0

License

MIT

Last publish

Collaborators

  • stevemao