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

Function normalizeHotmailAccount

background.js:1227–1246  ·  view source on GitHub ↗
(account = {})

Source from the content-addressed store, hash-verified

1225}
1226
1227function normalizeHotmailAccount(account = {}) {
1228 const normalizedLastAuthAt = Number.isFinite(Number(account.lastAuthAt)) ? Number(account.lastAuthAt) : 0;
1229 const normalizedStatus = String(
1230 account.status
1231 || (normalizedLastAuthAt > 0 ? 'authorized' : 'pending')
1232 );
1233 return {
1234 id: String(account.id || crypto.randomUUID()),
1235 email: String(account.email || '').trim(),
1236 password: String(account.password || ''),
1237 clientId: String(account.clientId || '').trim(),
1238 refreshToken: String(account.refreshToken || ''),
1239 status: normalizedStatus,
1240 enabled: account.enabled !== undefined ? Boolean(account.enabled) : true,
1241 used: Boolean(account.used),
1242 lastUsedAt: Number.isFinite(Number(account.lastUsedAt)) ? Number(account.lastUsedAt) : 0,
1243 lastAuthAt: normalizedLastAuthAt,
1244 lastError: String(account.lastError || ''),
1245 };
1246}
1247
1248function normalizeHotmailAccounts(accounts) {
1249 if (!Array.isArray(accounts)) return [];

Calls

no outgoing calls

Tested by

no test coverage detected