Nobody Publish Monsters

    arrify
    TypeScript icon, indicating that this package has built-in type declarations

    3.0.0 • Public • Published

    arrify

    Convert a value to an array

    Install

    $ npm install arrify
    

    Usage

    import arrify from 'arrify';
    
    arrify('🦄');
    //=> ['🦄']
    
    arrify(['🦄']);
    //=> ['🦄']
    
    arrify(new Set(['🦄']));
    //=> ['🦄']
    
    arrify(null);
    //=> []
    
    arrify(undefined);
    //=> []

    Specifying null or undefined results in an empty array.


    Get professional support for this package with a Tidelift subscription
    Tidelift helps make open source sustainable for maintainers while giving companies
    assurances about security, maintenance, and licensing for their dependencies.

    Install

    npm i arrify

    DownloadsWeekly Downloads

    24,115,639

    Version

    3.0.0

    License

    MIT

    Unpacked Size

    3.5 kB

    Total Files

    5

    Last publish

    Collaborators

    • sindresorhus