PluginProbe
Extendify / 3.2.1
Extendify v3.2.1
3.2.1 3.2.0 3.1.6 3.1.5 3.1.4 3.1.3 3.1.2 3.1.1 3.1.0 3.0.6 3.0.5 3.0.4 trunk 0.1.0 0.10.0 0.10.1 0.10.2 0.11.0 0.11.1 0.2.0 0.3.0 0.3.1 0.4.0 0.5.0 0.6.0 All 127 releases
extendify / src / Recommendations / utils / object-from-keys.js

object-from-keys.js in Extendify 3.2.1, at src/Recommendations/utils/object-from-keys.js

10 lines 328 B
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 // Accepts an object and a list of selected keys
2 // and returns a new object with only the selected keys.
3 export const objectFromKeys = (sourceObject, selectedKeys) =>
4 Object.entries(sourceObject)
5 .filter(([key]) => selectedKeys.includes(key))
6 .reduce((acc, [key, value]) => {
7 acc[key] = value;
8 return acc;
9 }, {});
10