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

Function parseUnifiedEnv

wxapp/ykb_all.js:111–128  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

109}
110
111function parseUnifiedEnv() {
112 const raw = process.env[CK_NAME] || "";
113 const result = { global: [], byKey: {} };
114 for (const item of splitAccounts(raw)) {
115 const idx = item.indexOf("=");
116 if (idx === -1) {
117 result.global.push(item);
118 continue;
119 }
120 const key = item.slice(0, idx).trim().toLowerCase();
121 const value = item.slice(idx + 1).trim();
122 if (!key || !value) continue;
123 result.byKey[key] = result.byKey[key] || [];
124 result.byKey[key].push(value);
125 }
126 result.global = unique(result.global);
127 return result;
128}
129
130const unifiedEnv = parseUnifiedEnv();
131

Callers 1

ykb_all.jsFile · 0.70

Calls 2

splitAccountsFunction · 0.70
uniqueFunction · 0.70

Tested by

no test coverage detected