Skip to main content
zerotal

Documentation


Documentation / @zerotal/core / index / config

Function: config()

Call Signature

config<P>(path): ConfigValue<P>

Defined in: helpers/config.ts:21

Read a configuration value by dot-path, with an optional fallback.

Known paths (those declared on the augmented ConfigRegistry) are resolved by the typed overloads first, so config('app.name') is inferred as string; a plain string path falls through to the untyped escape-hatch overloads.

Type Parameters

P

P extends ConfigPath

Parameters

path

P

Returns

ConfigValue<P>

Call Signature

config<P>(path, fallback): ConfigValue<P>

Defined in: helpers/config.ts:22

Read a configuration value by dot-path, with an optional fallback.

Known paths (those declared on the augmented ConfigRegistry) are resolved by the typed overloads first, so config('app.name') is inferred as string; a plain string path falls through to the untyped escape-hatch overloads.

Type Parameters

P

P extends ConfigPath

Parameters

path

P

fallback

ConfigValue<P>

Returns

ConfigValue<P>

Call Signature

config(path): unknown

Defined in: helpers/config.ts:23

Read a configuration value by dot-path, with an optional fallback.

Known paths (those declared on the augmented ConfigRegistry) are resolved by the typed overloads first, so config('app.name') is inferred as string; a plain string path falls through to the untyped escape-hatch overloads.

Parameters

path

string

Returns

unknown

Call Signature

config<T>(path, fallback): T

Defined in: helpers/config.ts:24

Read a configuration value by dot-path, with an optional fallback.

Known paths (those declared on the augmented ConfigRegistry) are resolved by the typed overloads first, so config('app.name') is inferred as string; a plain string path falls through to the untyped escape-hatch overloads.

Type Parameters

T

T

Parameters

path

string

fallback

T

Returns

T