@tremendous/help
    Preparing search index...

    Function removeEmptyEntries

    • Removes entries with empty values from an object.

      This function creates a new object that contains only the entries from the input object that have non-empty values. Empty values are considered to be undefined, null, or an empty string.

      Type Parameters

      • T extends Record<string, unknown>

        The type of the input object.

      Parameters

      • obj: T

        The object from which to remove empty entries.

      Returns Partial<T>

      • A new object with only the non-empty entries from the input object.
      const obj = { a: 1, b: "", c: null, d: "hello" };
      const result = removeEmptyEntries(obj);
      // result will be { a: 1, d: "hello" }