Skip to content

resolveConfigValue

resolveConfigValue<A, R>(configValue, …args): MaybePromiseLike<R>

Defined in: resolve-config-value.ts:17

Resolve a configuration value that may be a static value or a function returning the value.

If it’s a function, it will be called with the provided arguments. If it’s a static value, it will be returned as-is.

This allows configuration options to be defined either as fixed values or as functions that compute the value dynamically.

A extends unknown[]

R

R | MaybeAsyncCallable<A, R>

The configuration value or function to resolve.

…A

Arguments to pass if the configValue is a function.

MaybePromiseLike<R>

The resolved configuration value, possibly a Promise if async.