MCPcopy Create free account
hub / github.com/NobyDa/Script / SaveAccount

Function SaveAccount

TestFlight/TestFlightAccount.js:90–109  ·  view source on GitHub ↗
(id, part, o)

Source from the content-addressed store, hash-verified

88}
89
90function SaveAccount(id, part, o) {
91 if (!list[id]) {
92 list[id] = {};
93 const text = `Account ID "${id}" saved. (total ${Object.keys(list).length}) 🎉`;
94 $.notify('TestFlight Account', '', text);
95 $.info(text);
96 };
97 list[id][k1] = (part || req.headers)[k1];
98 list[id][k2] = (part || req.headers)[k2];
99 list[id][k3] = (part || req.headers)[k3];
100 if (o) {
101 if (list[id].only) {
102 list[id].only.push(o);
103 $.notify('TestFlight Account', '', `App ID "${o}" saved 🎉`);
104 } else {
105 list[id].only = [o];
106 }
107 }
108 return $.write(list, 'AccountList'), list;
109}
110
111function formatHeaders(h) {
112 return Object.keys(h).reduce((t, i) => (t[i.toLowerCase()] = h[i], t), {})

Callers 2

runsFunction · 0.85
ExternalAccountFunction · 0.85

Calls 3

notifyMethod · 0.45
infoMethod · 0.45
writeMethod · 0.45

Tested by

no test coverage detected