()
| 56 | } |
| 57 | |
| 58 | function 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 | |
| 77 | const unifiedEnv = parseUnifiedEnv(); |
| 78 |
no test coverage detected