8000 GitHub - sindresorhus/arrify at v2.0.1
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

sindresorhus/arrify

Repository files navigation

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

About

Convert a value to an array

Resources

License

Code of conduct

Security policy

Stars

Watchers

Forks

Sponsor this project

  •  

Packages

No packages published

Contributors 6

0