1 | "use strict";
|
2 |
|
3 |
|
4 |
|
5 |
|
6 | Object.defineProperty(exports, "__esModule", { value: true });
|
7 | exports.configBindingKeyFor = exports.DefaultConfigurationResolver = void 0;
|
8 | const binding_key_1 = require("./binding-key");
|
9 |
|
10 |
|
11 |
|
12 | class DefaultConfigurationResolver {
|
13 | constructor(context) {
|
14 | this.context = context;
|
15 | }
|
16 | getConfigAsValueOrPromise(key, propertyPath, resolutionOptions) {
|
17 | propertyPath = propertyPath !== null && propertyPath !== void 0 ? propertyPath : '';
|
18 | const configKey = configBindingKeyFor(key, propertyPath);
|
19 | const options = Object.assign({ optional: true }, resolutionOptions);
|
20 | return this.context.getValueOrPromise(configKey, options);
|
21 | }
|
22 | }
|
23 | exports.DefaultConfigurationResolver = DefaultConfigurationResolver;
|
24 |
|
25 |
|
26 |
|
27 |
|
28 |
|
29 | function configBindingKeyFor(key, propertyPath) {
|
30 | return binding_key_1.BindingKey.create(binding_key_1.BindingKey.buildKeyForConfig(key).toString(), propertyPath);
|
31 | }
|
32 | exports.configBindingKeyFor = configBindingKeyFor;
|
33 |
|
\ | No newline at end of file |