跳转到内容
简体中文

resolveSubstitutions

此内容尚不支持你的语言。

resolveSubstitutions(obj, env?): ConfigObject

Defined in: src/config/HoconParser.ts:687

Resolve every substitution in obj — against the tree first, then the environment. An optional substitution that finds neither leaves its key out, or falls back to the value its assignment replaced.

Resolution is by demand rather than by pass: a substitution whose target is itself a substitution resolves that target first, so a chain resolves in any declaration order (#1748). The fixed-point loop this replaced re-walked the whole tree up to eight times and still could not follow a chain — the lookup met the unresolved target and reported a miss, so the required form threw and the optional form fell through to the environment, or dropped the key. A chain that leads back to itself is a cycle, and refused as one.

What a substitution resolves to is final. A value read from the environment is data from then on: nothing walks it again, so nothing inside it is resolved as config.

ConfigObject

Record<string, string | undefined> = ...

ConfigObject