Skip to content

Commit 1631344

Browse files
committed
refactor: replace string with symbol
1 parent 97c9ba5 commit 1631344

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

src/constants.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
export const CONFIG_OPTIONS = Symbol( 'CONFIG_OPTIONS' );

src/reporter/reporter.module.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ import { collectDefaultMetrics, Registry } from 'prom-client';
44
import { MetricsConfig, ReporterAsyncOptions } from '../interfaces';
55
import { MetricsService } from '../metrics/metrics.service';
66
import { MetricsController } from '../metrics/metrics.controller';
7+
import { CONFIG_OPTIONS } from '../constants';
78

89
@Global()
910
@Module( {} )
@@ -32,7 +33,7 @@ export class ReporterModule {
3233
imports: options.imports,
3334
providers: [
3435
{
35-
provide: 'CONFIG_OPTIONS',
36+
provide: CONFIG_OPTIONS,
3637
useFactory: options.useFactory,
3738
inject: options.inject,
3839
},
@@ -41,7 +42,7 @@ export class ReporterModule {
4142
useFactory: async ( config: MetricsConfig ) => {
4243
return ReporterModule.configureRegistry( config );
4344
},
44-
inject: [ 'CONFIG_OPTIONS' ],
45+
inject: [ CONFIG_OPTIONS ],
4546
},
4647
MetricsService,
4748
ReporterService

0 commit comments

Comments
 (0)