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

Function toNormalizedEmailSet

icloud-utils.js:72–86  ·  view source on GitHub ↗
(values = [])

Source from the content-addressed store, hash-verified

70 }
71
72 function toNormalizedEmailSet(values = []) {
73 if (values instanceof Set) {
74 return new Set(Array.from(values, (item) => String(item || '').trim().toLowerCase()).filter(Boolean));
75 }
76 if (Array.isArray(values)) {
77 return new Set(values.map((item) => String(item || '').trim().toLowerCase()).filter(Boolean));
78 }
79 if (values && typeof values === 'object') {
80 const normalizedMap = normalizeBooleanMap(values);
81 return new Set(Object.entries(normalizedMap)
82 .filter(([, value]) => value)
83 .map(([email]) => email));
84 }
85 return new Set();
86 }
87
88 function findIcloudAliasArray(node, depth = 0) {
89 if (!node || depth > 4) return null;

Callers 3

getEffectiveUsedEmailsFunction · 0.85

Calls 1

normalizeBooleanMapFunction · 0.85

Tested by

no test coverage detected