Skip to content

scottcorgan/as-array

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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

About

Make any value an array. No dependencies.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published