* Bind the key to an alias of another binding * @param keyWithPath - Target binding key with optional path, * such as `servers.RestServer.options#apiExplorer`
(keyWithPath: BindingAddress<T>)
| 928 | * such as `servers.RestServer.options#apiExplorer` |
| 929 | */ |
| 930 | toAlias(keyWithPath: BindingAddress<T>) { |
| 931 | /* istanbul ignore if */ |
| 932 | if (debug.enabled) { |
| 933 | debug('Bind %s to alias %s', this.key, keyWithPath); |
| 934 | } |
| 935 | this._source = { |
| 936 | type: BindingType.ALIAS, |
| 937 | value: keyWithPath, |
| 938 | }; |
| 939 | this._setValueGetter(({context, options}) => { |
| 940 | return context.getValueOrPromise(keyWithPath, options); |
| 941 | }); |
| 942 | return this; |
| 943 | } |
| 944 | |
| 945 | /** |
| 946 | * Unlock the binding |
no test coverage detected