Detalhes do pacote

ensure-type

cheton415.1kMIT1.5.1

Ensure runtime type safety and perform type coercion if needed.

javascript, ensure, runtime, type

readme (leia-me)

ensure-type Build Status Coverage Status

NPM

Ensure runtime type safety and perform type coercion if needed.

Install

$ npm install --save ensure-type

Usage

import { ensureArray } from 'ensure-type';

ensureArray(null);
//=> []

ensureArray('apple');
//=> ['apple']

ensureArray(['apple', 'banana']);
//=> ['apple', 'banana']

API

Array

BigInt

Boolean

Function

Number

Object

String

License

MIT