Review: Tested and we do have _.pick

Co-authored-by: cwstra <cwstra@gmail.com>
This commit is contained in:
Adam Talbot
2021-04-16 18:47:49 -04:00
committed by GitHub
co-authored by cwstra
parent c7c0b605f1
commit eacfa458e8
+1 -1
View File
@@ -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?