(root: EnvTrieNode, path: Path)
| 986 | } |
| 987 | |
| 988 | function trieNodeAt(root: EnvTrieNode, path: Path): EnvTrieNode | undefined { |
| 989 | if (path.length === 0) return root |
| 990 | |
| 991 | // Convert path segments to strings and navigate through the trie |
| 992 | let node: EnvTrieNode | undefined = root |
| 993 | for (const seg of path) { |
| 994 | node = node?.children?.[String(seg)] |
| 995 | if (!node) return undefined |
| 996 | } |
| 997 | return node |
| 998 | } |
| 999 | |
| 1000 | /** |
| 1001 | * Creates a `ConfigProvider` by parsing the string contents of a `.env` file. |