| 62 | * @param metadata - Optional metadata to help the injection |
| 63 | */ |
| 64 | export function config( |
| 65 | propertyPath?: string | ConfigInjectionMetadata, |
| 66 | metadata?: ConfigInjectionMetadata, |
| 67 | ) { |
| 68 | propertyPath = propertyPath ?? ''; |
| 69 | if (typeof propertyPath === 'object') { |
| 70 | metadata = propertyPath; |
| 71 | propertyPath = ''; |
| 72 | } |
| 73 | metadata = Object.assign( |
| 74 | {propertyPath, decorator: '@config', optional: true}, |
| 75 | metadata, |
| 76 | ); |
| 77 | return inject('', metadata, resolveFromConfig); |
| 78 | } |
| 79 | |
| 80 | export namespace config { |
| 81 | /** |