(root: EnvTrieNode, path: Path)
| 1021 | } |
| 1022 | |
| 1023 | function trieNodeAt(root: EnvTrieNode, path: Path): EnvTrieNode | undefined { |
| 1024 | if (path.length === 0) return root |
| 1025 | |
| 1026 | // Convert path segments to strings and navigate through the trie |
| 1027 | let node: EnvTrieNode | undefined = root |
| 1028 | for (const seg of path) { |
| 1029 | node = node?.children?.[String(seg)] |
| 1030 | if (!node) return undefined |
| 1031 | } |
| 1032 | return node |
| 1033 | } |
| 1034 | |
| 1035 | /** |
| 1036 | * Creates a `ConfigProvider` by parsing the string contents of a `.env` file. |