construct-array
Returns the passing value(anything .. string,number,null,undefined,object,array) as an array.
Motivation
Inspired by Sindre Sorhus
Installation
$ npm install --save construct-array
Usuage
let arrayify = require('construct-array');
arrayify('India');
arrayify(null);
arrayify(undefined);
arrayify([2,3]);
arrayify(undefined);
arrayify({name : "april"});
Related
- arrify - Convert a value to an array
The difference that is this module does NOT turn null
or undefined
to an empty array.
The difference that is this module does NOT turn array
to array.
License
MIT © Bharathvaj Ganesan