arrayify
Convert array like items or individual items into arrays (for both browser and server)
Installation
npm install arrayify
Usage
// Array-likesvar divs = document // `NodeList` of `HTMLDivElement` // => Array of `HTMLDivElement` { // => [1, 2]}1 2 // Primitives // => ['hello'] // => [12345] // => [/regex/] // => [null] // => [{}] // => [Wed Nov 07 2012 04:40:26 GMT+1000 (EST)] // Special cases // => [] // => [window] // => [DOM elements matching the query selector 'a.important']
License
This library is based off of work by @timoxley on the to-array component which is MIT licensed.
This library is therefore also MIT licensed.