wrap-array
v1.0.0
Published
Transform anything into an array.
Downloads
8
Maintainers
Readme
wrap-array
Transform anything into an array.
Install
$ npm install --save wrap-array
Usage
const wrapArray = require('wrap-array');
wrapArray('anything');
//=> ['anything']
wrapArray(42);
//=> [42]
wrapArray(['array']);
//=> ['array']
wrapArray({ object: true });
//=> [{ object: true }]
API
wrapArray(input)
input
Type: string
, number
, object
, ...
Whatever you want!
License
MIT © Tobias Herber