Options
All
  • Public
  • Public/Protected
  • All
Menu

Module object/pickBy

Index

References

Functions

References

Renames and re-exports pickBy

Functions

  • pickBy<O>(pred: ObjPredBy<O>, obj: O): Partial<O>
  • pickBy<K>(pred: ObjPred<K, any>): <O>(obj: O) => Partial<O>
  • Returns a partial copy of an object containing only the keys with fn predicate returns true

    example
     pickBy(x => x > 2, {a: 1, b: 2, c: 3, d: 4}); //=> {c: 3, d: 4}
    

    Type parameters

    • O

    Parameters

    • pred: ObjPredBy<O>
    • obj: O

      The object to copy from

    Returns Partial<O>

    A new object with only properties from names on it.

  • Returns a partial copy of an object containing only the keys with fn predicate returns true

    example
     pickBy(x => x > 2, {a: 1, b: 2, c: 3, d: 4}); //=> {c: 3, d: 4}
    

    Type parameters

    • K: string

    Parameters

    Returns <O>(obj: O) => Partial<O>

    A new object with only properties from names on it.

      • <O>(obj: O): Partial<O>
      • Type parameters

        • O

        Parameters

        • obj: O

        Returns Partial<O>

Generated using TypeDoc