@tremendous/help
    Preparing search index...

    Function isEmpty

    Checks if a value is empty.

    This function checks if a value is empty. It considers strings, arrays, and objects. Strings are considered empty if they are equal to an empty string. Arrays and Sets are considered empty if they have no elements. Objects and Maps are considered empty if they have no properties.

    The type of the value.

    The value to check.

    • Returns true if the value is empty, otherwise false.
    isEmpty(""); // true
    isEmpty([]); // true
    isEmpty({}); // true
    isEmpty(new Map()); // true
    isEmpty(new Set()); // true
    isEmpty("text"); // false
    isEmpty([1, 2, 3]); // false
    isEmpty({ a: 1 }); // false
    • Parameters

      • value: string

      Returns value is ""

    • Parameters

      • value: undefined | null | Set<any> | Map<any, any>

      Returns boolean

    • Type Parameters

      • T extends object

      Parameters

      • value: undefined | null | T

      Returns value is undefined | null | EmptyObjectOf<T>

    • Parameters

      • Optionalvalue: any

      Returns boolean