@coolgk/array
TypeScript icon, indicating that this package has built-in type declarations

2.0.5 • Public • Published

@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

Readme

Keywords

Package Sidebar

Install

npm i @coolgk/array

Weekly Downloads

2

Version

2.0.5

License

MIT

Unpacked Size

3.43 kB

Total Files

5

Last publish

Collaborators

  • coolgk