Wondering what’s next for npm?Check out our public roadmap! »

    ensure-type

    1.5.1 • Public • Published

    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

    Install

    npm i ensure-type

    DownloadsWeekly Downloads

    500

    Version

    1.5.1

    License

    MIT

    Unpacked Size

    18.3 kB

    Total Files

    5

    Last publish

    Collaborators

    • avatar