Skip to content

Latest commit

History

History
39 lines (23 loc) 路 543 Bytes

File metadata and controls

39 lines (23 loc) 路 543 Bytes

arrify Build Status

Convert a value to an array

Install

$ npm install arrify

Usage

const arrify = require('arrify');

arrify('馃');
//=> ['馃']

arrify(['馃']);
//=> ['馃']

arrify(new Set(['馃']));
//=> ['馃']

arrify(null);
//=> []

arrify(undefined);
//=> []

Supplying null or undefined results in an empty array.

License

MIT 漏 Sindre Sorhus