1.0.0 • Published 4 years ago

sure-array v1.0.0

Weekly downloads
5
License
-
Repository
github
Last release
4 years ago

sure-array



Converts the input into an array or returns it if it is already an array.

Installation

npm install --save sure-array@^1.0.0

yarn add sure-array@^1.0.0


(if configured properly)

npm install --save @jaid/sure-array@^1.0.0

Example

import 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]]

Development

Setting up:

git clone git@github.com:jaid/sure-array.git
cd sure-array
npm install

Testing:

npm run test:dev

Testing in production environment:

npm run test

License

MIT License
Copyright © 2020, Jaid \jaid.jsx@gmail.com (https://github.com/jaid)