@coolgk/array

array utilities

Stats

stars 🌟issues ⚠️updated 🛠created 🐣size 🏋️‍♀️
214May 9, 2021Nov 18, 2017Minified + gzip package size for @coolgk/array in KB

Readme

@coolgk/array

a javascript / typescript module

npm install @coolgk/array

array utilities

Report bugs here: https://github.com/coolgk/node-utils/issues

Examples

import { toArray } from '@coolgk/array';
// OR
// const { toArray } = require('@coolgk/array');

const a = undefined;
const b = false;
const c = '';
const d = [1,2,3];
const e = {a:1};

console.log(toArray(a)); // []
console.log(toArray(b)); // [ false ]
console.log(toArray(c)); // [ '' ]
console.log(toArray(d)); // [ 1, 2, 3 ]
console.log(toArray(e)); // [ { a: 1 } ]

toArray(data) ⇒ array

Kind: global function

Param Type Description
data * any data to be type cast to array

If you find any bugs or have a feature request, please open an issue on github!

The npm package download data comes from npm's download counts api and package details come from npms.io.