You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

36 lines
519 B

4 years ago
  1. # arrify [![Build Status](https://travis-ci.org/sindresorhus/arrify.svg?branch=master)](https://travis-ci.org/sindresorhus/arrify)
  2. > Convert a value to an array
  3. ## Install
  4. ```
  5. $ npm install --save arrify
  6. ```
  7. ## Usage
  8. ```js
  9. const arrify = require('arrify');
  10. arrify('unicorn');
  11. //=> ['unicorn']
  12. arrify(['unicorn']);
  13. //=> ['unicorn']
  14. arrify(null);
  15. //=> []
  16. arrify(undefined);
  17. //=> []
  18. ```
  19. *Supplying `null` or `undefined` results in an empty array.*
  20. ## License
  21. MIT © [Sindre Sorhus](http://sindresorhus.com)