Javascript Lodash中的哪些内容从3更改为4,表明此代码不起作用?

Javascript Lodash中的哪些内容从3更改为4,表明此代码不起作用?,javascript,lodash,Javascript,Lodash,我有这样一个代码: const _ = require('lodash'); const fn = _.partialRight(_.pick, _.identity); const x = { some: 'value', empty: null }; const y = fn(x); console.log('x:', x); console.log('y:', y); fn应该 Lodash 3.10.1的结果: x: { some: 'value', empty: null }

我有这样一个代码:

const _ = require('lodash');

const fn = _.partialRight(_.pick, _.identity);

const x = { some: 'value', empty: null };

const y = fn(x);

console.log('x:', x);
console.log('y:', y);
fn
应该

Lodash 3.10.1的结果:

x: { some: 'value', empty: null }
y: { some: 'value' }
Lodash 4.15.0的结果:

x: { some: 'value', empty: null }
y: {}

Lodash 4中有什么变化导致它不再工作了?

将您的
常量fn=\uu.partiOK(\uu.pick,\u.identity)
更改为
const fn=u.partiOK(u.pickBy,u.identity)

.pick
过去只是一个功能,但在最新的更新中,他们将其分为
.pick
.pickBy
。当您传入已知键时,将使用
.pick
;当您使用自定义函数测试是否应根据自己的参数拾取键/值时,将使用
.pickBy