@nevware21/ts-utils
    Preparing search index...

    Function objOmitBy

    • Creates a new object composed of the enumerable own properties of source for which the predicate function returns a falsy value — the inverse of objPickBy.

      Type Parameters

      • T

        The type of the source object

      Parameters

      • source: T

        The source object to omit from

      • predicate: (key: PropertyKey, value: T[keyof T]) => boolean

        A function (key, value) => boolean that is invoked for each own enumerable property. A property is excluded from the result when the predicate returns truthy.

      Returns Partial<T>

      A new object containing only the properties for which predicate returned falsy. Returns an empty object if source is null or undefined.

      0.14.0

      const obj = { a: 1, b: 2, c: 3, d: 4 };

      objOmitBy(obj, (key, value) => value > 2); // { a: 1, b: 2 }
      objOmitBy(obj, (key) => key === "b"); // { a: 1, c: 3, d: 4 }