* Resolver for `@config` * @param ctx - Context object * @param injection - Injection metadata * @param session - Resolution session
( ctx: Context, injection: Injection, session: ResolutionSession, )
| 148 | * @param session - Resolution session |
| 149 | */ |
| 150 | function resolveFromConfig( |
| 151 | ctx: Context, |
| 152 | injection: Injection, |
| 153 | session: ResolutionSession, |
| 154 | ): ValueOrPromise<unknown> { |
| 155 | const bindingKey = getTargetBindingKey(injection, session); |
| 156 | // Return `undefined` if no current binding is present |
| 157 | if (!bindingKey) return undefined; |
| 158 | const meta = injection.metadata; |
| 159 | return ctx.getConfigAsValueOrPromise(bindingKey, meta.propertyPath, { |
| 160 | session, |
| 161 | optional: meta.optional, |
| 162 | }); |
| 163 | } |
| 164 | |
| 165 | /** |
| 166 | * Resolver from `@config.getter` |
nothing calls this directly
no test coverage detected