MCPcopy Index your code
hub / github.com/proksh/atomize / arrayKeyMapToObject

Function arrayKeyMapToObject

src/style-functions/arrayKeyMapToObject.js:1–24  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1const arrayKeyMapToObject = input => {
2 var output = {};
3
4 input.forEach(item => {
5 openObject(item, output);
6
7 function openObject(objectToOpen, setOpenObjectTo) {
8 if (!objectToOpen) {
9 return;
10 }
11 Object.keys(objectToOpen).map(key => {
12 if (key === undefined) {
13 return;
14 } else if (typeof setOpenObjectTo[key] === "object") {
15 openObject(objectToOpen[key], setOpenObjectTo[key]);
16 } else {
17 setOpenObjectTo[key] = objectToOpen[key];
18 }
19 });
20 }
21 });
22
23 return output;
24};
25
26export default arrayKeyMapToObject;

Callers 9

computeImageStyleFunction · 0.85
computeDivStyleFunction · 0.85
computeButtonStyleFunction · 0.85
computeIconStyleFunction · 0.85
computeDivStyleFunction · 0.85
computeTextStyleFunction · 0.85
findRoundedDirectionFunction · 0.85
findDirectionFunction · 0.85
findBorderFunction · 0.85

Calls 1

openObjectFunction · 0.85

Tested by

no test coverage detected