JSPM

  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 839229
  • Score
    100M100P100Q170055F
  • License MIT

Make any value an array. No dependencies.

Package Exports

  • as-array

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (as-array) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

as-array

Make any value an array. No dependencies.

Install

npm install as-array --save

Usage

var asArray = require('as-array');

asArray() === [];
asArray('my string') === ['my string'];
asArray([1,2,3]) === [1,2,3];

function tester () {
  asArray(arguments) === ['arg1', 'arg2'];
}
tester('arg1', 'arg2');

asArray(data[, convertObject])

  • data - any data type to convert to an array
  • convertObject - OPTIONAL boolean - pull values from object as array content

Run Tests

npm install
npm test