Creates a new object with properties that satisfy the predicate.
创建一个新对象,仅包含满足 predicate 的属性
The type of the source object / 源对象类型
The source object. 源对象
The predicate function. 谓词函数
A new object with properties that satisfy the predicate. 满足谓词的新对象
An own __proto__ key is ignored, so untrusted input can neither replace the prototype of the result nor smuggle the key into a later Object.assign-style merge.
__proto__
Object.assign
源对象自有的 __proto__ 键会被忽略,避免不可信输入替换结果原型、或把该键带入后续 Object.assign 式合并再次触发污染。
pickBy({ a: 1, b: 2, c: 3 }, (v) => v > 1) // => { b: 2, c: 3 } Copy
pickBy({ a: 1, b: 2, c: 3 }, (v) => v > 1) // => { b: 2, c: 3 }
Creates a new object with properties that satisfy the predicate.
创建一个新对象,仅包含满足 predicate 的属性