@ekim088/toolkit
    Preparing search index...

    Function pick

    • Returns an object with only the properties that pass a given test.

      Type Parameters

      • T extends object

      Parameters

      • obj: T

        The object to parse.

      • predicate: (val: ValueOf<T>, key: keyof T) => boolean

        A test function called against each object property. Properties that return a falsy result will not be included.

      Returns Partial<T>

      A new object containing only the properties that passed the test.