@vsokolov/utils - v1.4.2
    Preparing search index...

    Function omitBy

    • Remove properties from object where predicate returns true

      Type Parameters

      • T extends Record<string, unknown>
      • K extends string

      Parameters

      • obj: T

        Object to filter

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

        Function that returns true for properties to remove

      Returns Partial<T>

      Object with properties removed

      omitBy({ a: 1, b: null, c: undefined }, (v) => v === null || v === undefined)
      // => { a: 1 }