()
| 109 | } |
| 110 | |
| 111 | function 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 | |
| 130 | const unifiedEnv = parseUnifiedEnv(); |
| 131 |
no test coverage detected