Review: Tested and we do have _.pick
Co-authored-by: cwstra <cwstra@gmail.com>
This commit is contained in:
@@ -2869,7 +2869,7 @@
|
||||
});
|
||||
|
||||
function includeOnlyKeysInArray(sourceObject, filterArray) {
|
||||
return Object.fromEntries(Object.entries(sourceObject).filter(([attr, value]) => filterArray.includes(attr)));
|
||||
return _.pick(sourceObject, ...filterArray);
|
||||
}
|
||||
|
||||
//This relies on elements in the object being in the correct order, which seems to be true always?
|
||||
|
||||
Reference in New Issue
Block a user