@ngard/tiny-isempty

    1.0.0 • Public • Published

    tiny-isempty

    source bundle size build status license

    A minimal-weight utility equivalent to lodash.isempty. For when every byte counts!


    lodash.isempty bundle size
    tiny-isempty bundle size


    Syntax

    isEmpty(/* object */)

    Parameters

    object - The object to check for emptiness

    Return

    true if value is an empty object, collection, map, or set. false otherwise.

    Objects are considered empty if they have no own enumerable string keyed properties.

    Array-like values such as arguments objects, arrays, strings, or jQuery-like collections are considered empty if they have a length of 0. Similarly, maps and sets are considered empty if they have a size of 0.

    Example

    import { isEmpty } from '@ngard/tiny-isempty';
    
    isEmpty({}); // true
    isEmpty([]); // true
    isEmpty(''); // true
    isEmpty(new Map()); // true
    isEmpty(Object.create(null)); // true

    Install

    npm i @ngard/tiny-isempty

    DownloadsWeekly Downloads

    1

    Version

    1.0.0

    License

    MIT

    Unpacked Size

    11.2 kB

    Total Files

    8

    Last publish

    Collaborators

    • ngard