MCPcopy Create free account
hub / github.com/QLHazyCoder/FlowPilot / upsertHotmailAccountInList

Function upsertHotmailAccountInList

hotmail-utils.js:101–113  ·  view source on GitHub ↗
(accounts, nextAccount)

Source from the content-addressed store, hash-verified

99 }
100
101 function upsertHotmailAccountInList(accounts, nextAccount) {
102 const list = Array.isArray(accounts) ? accounts.slice() : [];
103 if (!nextAccount?.id) return list;
104
105 const existingIndex = list.findIndex((account) => account?.id === nextAccount.id);
106 if (existingIndex === -1) {
107 list.push(nextAccount);
108 return list;
109 }
110
111 list[existingIndex] = nextAccount;
112 return list;
113 }
114
115 function pickHotmailAccountForRun(accounts, options = {}) {
116 const candidates = Array.isArray(accounts) ? accounts.filter(isAuthorizedHotmailAccount) : [];

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected