Closed uplift closed 5 years ago
v4.4.3
I've just updated to your change for this issue and noticed _.pick(settings, Boolean) is returning an empty object even though the settings object has data.
I think lodash version of pick expects an array of properties to pick from and has another function pickBy that accepts a function which seems to work locally for me.
You're saying I should use _.pickBy
instead? Just confirming before I make the change :+1:
Yeah .pickBy accepts truthy function where as .pick uses an array of object keys to pick. So with Boolean parameter fits _.pickBy api
I think the change you made on L397 can remain as _.pick as its an array of properties
.pick - Creates an object composed of the picked object properties. I.e. profileFields .pickBy - Creates an object composed of the object properties predicate returns truthy for. The predicate is invoked with two arguments: (value, key). I.e. Boolean
Okey dokey, v4.4.4 thanks for the attention
Underscore isn't defined in Nodebb's package.json so theres no set version that it should pickup.
https://github.com/julianlam/nodebb-plugin-session-sharing/blob/98c826f3b396e7aeece7c9dedb0f957ee9dd3c00/library.js#L10