@pengzhanbo/utils - v3.5.0
    Preparing search index...

    Function pickBy

    • Creates a new object with properties that satisfy the predicate.

      创建一个新对象,仅包含满足 predicate 的属性

      Type Parameters

      Parameters

      • obj: T

        The source object. 源对象

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

        The predicate function. 谓词函数

      Returns Partial<T>

      A new object with properties that satisfy the predicate. 满足谓词的新对象

      pickBy({ a: 1, b: 2, c: 3 }, (v) => v > 1) // => { b: 2, c: 3 }