launchcodedev / app-config

Easy Configuration Loader with Strict Validation
https://app-config.dev
Mozilla Public License 2.0
68 stars 11 forks source link

extendsSelf concatenate with some string #214

Open pats opened 1 year ago

pats commented 1 year ago

Hi,

I was wondering, is below action possible right now?

What I'd like to achive is to use already defined value with some other values, i.e. concatenate with some string

myHost: 'localhost',
check: {
 http: 'http://${myHost}/is-alive'
}

is it possible?

PS

joelgallant commented 1 year ago

This would be a great feature. Unfortunately, it's somewhat of a circular problem, and hard to define the semantics correctly. You could see how a loop can be written easily:

foo: '${bar}'
bar: '${foo}'

it requires lazy initialization, which isn't currently done today (at least, today's parsing is materializing BFS). values would need representations as thunks, and perform cycle detection, most likely.

it would probably be better to find and support a YAML-like format that supports such a thing.