MCPcopy Index your code
hub / github.com/QLHazyCoder/FlowPilot / findIcloudAliasArray

Function findIcloudAliasArray

icloud-utils.js:88–106  ·  view source on GitHub ↗
(node, depth = 0)

Source from the content-addressed store, hash-verified

86 }
87
88 function findIcloudAliasArray(node, depth = 0) {
89 if (!node || depth > 4) return null;
90 if (Array.isArray(node)) {
91 return node.some((item) => item && typeof item === 'object') ? node : null;
92 }
93 if (typeof node !== 'object') return null;
94
95 const priorityKeys = ['hmeEmails', 'hmeEmailList', 'hmeList', 'hmes', 'aliases', 'items'];
96 for (const key of priorityKeys) {
97 if (Array.isArray(node[key])) return node[key];
98 }
99
100 for (const value of Object.values(node)) {
101 const nested = findIcloudAliasArray(value, depth + 1);
102 if (nested) return nested;
103 }
104
105 return null;
106 }
107
108 function normalizeIcloudAliasRecord(raw, options = {}) {
109 const usedEmails = toNormalizedEmailSet(options.usedEmails);

Callers 2

normalizeIcloudAliasListFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected