Skip to content

Ensure a value is an array and wrap it if it is not an array

License

Notifications You must be signed in to change notification settings

jimmywarting/cast-array

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

cast-array Build Status Greenkeeper badge

Ensure a value is an array and wrap it if it is not an array

Install

$ npm install --save cast-array

Usage

var castArray = require('cast-array')

castArray('input')
//=> ['input']

castArray(['input'])
//=> ['input']

API

castArray(value) -> array

value

Required
Type: array / any

A value to wrap in an array (unless it's already an array).

License

MIT © Ben Drucker

About

Ensure a value is an array and wrap it if it is not an array

Resources

License

Security policy

Stars

Watchers

Forks

Packages

No packages published

Languages

  • JavaScript 100.0%