File tree Expand file tree Collapse file tree 2 files changed +12
-2
lines changed Expand file tree Collapse file tree 2 files changed +12
-2
lines changed Original file line number Diff line number Diff line change 1
- import 'reflect-metadata' ;
2
1
import type { MonitorConfig } from '@sentry/core' ;
3
2
import { captureException , isThenable } from '@sentry/core' ;
4
3
import * as Sentry from '@sentry/node' ;
@@ -111,10 +110,18 @@ function copyFunctionNameAndMetadata({
111
110
} ) ;
112
111
113
112
// copy metadata
113
+ // eslint-disable-next-line @typescript-eslint/ban-ts-comment
114
+ // @ts -ignore - reflect-metadata of nestjs adds these methods to Reflect
114
115
if ( typeof Reflect !== 'undefined' && typeof Reflect . getMetadataKeys === 'function' ) {
116
+ // eslint-disable-next-line @typescript-eslint/ban-ts-comment
117
+ // @ts -ignore - reflect-metadata of nestjs adds these methods to Reflect
115
118
const originalMetaData = Reflect . getMetadataKeys ( originalMethod ) ;
116
119
for ( const key of originalMetaData ) {
120
+ // eslint-disable-next-line @typescript-eslint/ban-ts-comment
121
+ // @ts -ignore - reflect-metadata of nestjs adds these methods to Reflect
117
122
const value = Reflect . getMetadata ( key , originalMethod ) ;
123
+ // eslint-disable-next-line @typescript-eslint/ban-ts-comment
124
+ // @ts -ignore - reflect-metadata of nestjs adds these methods to Reflect
118
125
Reflect . defineMetadata ( key , value , descriptor . value ) ;
119
126
}
120
127
}
Original file line number Diff line number Diff line change 1
- import 'reflect-metadata' ;
2
1
import type { InstrumentationConfig } from '@opentelemetry/instrumentation' ;
3
2
import {
4
3
InstrumentationBase ,
@@ -84,7 +83,11 @@ export class SentryNestEventInstrumentation extends InstrumentationBase {
84
83
descriptor . value = async function ( ...args : unknown [ ] ) {
85
84
// When multiple @OnEvent decorators are used on a single method, we need to get all event names
86
85
// from the reflector metadata as there is no information during execution which event triggered it
86
+ // eslint-disable-next-line @typescript-eslint/ban-ts-comment
87
+ // @ts -ignore - reflect-metadata of nestjs adds these methods to Reflect
87
88
if ( Reflect . getMetadataKeys ( descriptor . value ) . includes ( 'EVENT_LISTENER_METADATA' ) ) {
89
+ // eslint-disable-next-line @typescript-eslint/ban-ts-comment
90
+ // @ts -ignore - reflect-metadata of nestjs adds these methods to Reflect
88
91
const eventData = Reflect . getMetadata ( 'EVENT_LISTENER_METADATA' , descriptor . value ) ;
89
92
if ( Array . isArray ( eventData ) ) {
90
93
eventName = eventData
You can’t perform that action at this time.
0 commit comments