MCPcopy Create free account
hub / github.com/smallfawn/QLScriptPublic / parseUnifiedEnv

Function parseUnifiedEnv

wxapp/ytb2_all.js:58–75  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

56}
57
58function parseUnifiedEnv() {
59 const raw = process.env[CK_NAME] || "";
60 const result = { global: [], byKey: {} };
61 for (const item of splitAccounts(raw)) {
62 const idx = item.indexOf("=");
63 if (idx === -1) {
64 result.global.push(item);
65 continue;
66 }
67 const key = item.slice(0, idx).trim().toLowerCase();
68 const value = item.slice(idx + 1).trim();
69 if (!key || !value) continue;
70 result.byKey[key] = result.byKey[key] || [];
71 result.byKey[key].push(value);
72 }
73 result.global = unique(result.global);
74 return result;
75}
76
77const unifiedEnv = parseUnifiedEnv();
78

Callers 1

ytb2_all.jsFile · 0.70

Calls 2

splitAccountsFunction · 0.70
uniqueFunction · 0.70

Tested by

no test coverage detected