()
| 686 | } |
| 687 | |
| 688 | function parseNativeToolConfigRawOverrides() { |
| 689 | const raw = String(process.env.WINDSURFAPI_NATIVE_TOOL_BRIDGE_CONFIG_RAW || '').trim(); |
| 690 | const out = new Map(); |
| 691 | out.unknownFields = new Map(); |
| 692 | if (!raw) return out; |
| 693 | for (const entry of raw.split(';')) { |
| 694 | const item = entry.trim(); |
| 695 | if (!item) continue; |
| 696 | const sep = item.indexOf(':'); |
| 697 | if (sep <= 0) throw new Error(`Invalid WINDSURFAPI_NATIVE_TOOL_BRIDGE_CONFIG_RAW entry: ${item}`); |
| 698 | const kind = normalizeNativeToolConfigKind(item.slice(0, sep)); |
| 699 | const payload = decodeNativeToolConfigRawPayload(item.slice(sep + 1)); |
| 700 | if (typeof kind === 'number') out.unknownFields.set(kind, payload); |
| 701 | else out.set(kind, payload); |
| 702 | } |
| 703 | return out; |
| 704 | } |
| 705 | |
| 706 | function normalizeNativeToolConfigKind(kind) { |
| 707 | const key = String(kind || '').trim(); |
no test coverage detected