Converts the input into an array or returns it if it is already an array.
npm install --save sure-array@^1.0.0yarn add sure-array@^1.0.0
(if configured properly)
npm install --save @jaid/sure-array@^1.0.0import sureArray from "sure-array"
const result = sureArray(123)
const result2 = sureArray([123])
const result3 = sureArray()
const result4 = sureArray(undefined)
const result5 = sureArray(null)
const result6 = sureArray([[123]])Variable result will be:
[123]Variable result2 will be:
[123]Variable result3 will be:
[]Variable result4 will be:
[]Variable result5 will be:
[null]Variable result6 will be:
[[123]]Setting up:
git clone git@github.com:jaid/sure-array.git
cd sure-array
npm installTesting:
npm run test:devTesting in production environment:
npm run testMIT License
Copyright © 2020, Jaid <jaid.jsx@gmail.com> (https://github.com/jaid)