File tree Expand file tree Collapse file tree 9 files changed +10
-10
lines changed Expand file tree Collapse file tree 9 files changed +10
-10
lines changed Original file line number Diff line number Diff line change @@ -9,7 +9,7 @@ import { setHooksAsyncContextStrategy } from './hooks';
99 * Node.js < 14 uses domains
1010 */
1111export function setNodeAsyncContextStrategy ( ) : void {
12- if ( NODE_VERSION . major && NODE_VERSION . major >= 14 ) {
12+ if ( NODE_VERSION . major >= 14 ) {
1313 setHooksAsyncContextStrategy ( ) ;
1414 } else {
1515 setDomainAsyncContextStrategy ( ) ;
Original file line number Diff line number Diff line change @@ -65,7 +65,7 @@ export class Anr implements Integration {
6565
6666 /** @inheritdoc */
6767 public setup ( client : NodeClient ) : void {
68- if ( ( NODE_VERSION . major || 0 ) < 16 ) {
68+ if ( NODE_VERSION . major < 16 ) {
6969 throw new Error ( 'ANR detection requires Node 16 or later' ) ;
7070 }
7171
Original file line number Diff line number Diff line change @@ -132,7 +132,7 @@ export class Http implements Integration {
132132 // NOTE: Prior to Node 9, `https` used internals of `http` module, thus we don't patch it.
133133 // If we do, we'd get double breadcrumbs and double spans for `https` calls.
134134 // It has been changed in Node 9, so for all versions equal and above, we patch `https` separately.
135- if ( NODE_VERSION . major && NODE_VERSION . major > 8 ) {
135+ if ( NODE_VERSION . major > 8 ) {
136136 // eslint-disable-next-line @typescript-eslint/no-var-requires
137137 const httpsModule = require ( 'https' ) ;
138138 const wrappedHttpsHandlerMaker = _createWrappedRequestMethodFactory (
Original file line number Diff line number Diff line change @@ -353,7 +353,7 @@ export class LocalVariables implements Integration {
353353 if ( this . _session && clientOptions . includeLocalVariables ) {
354354 // Only setup this integration if the Node version is >= v18
355355 // https://github.com/getsentry/sentry-javascript/issues/7697
356- const unsupportedNodeVersion = ( NODE_VERSION . major || 0 ) < 18 ;
356+ const unsupportedNodeVersion = NODE_VERSION . major < 18 ;
357357
358358 if ( unsupportedNodeVersion ) {
359359 logger . log ( 'The `LocalVariables` integration is only supported on Node >= v18.' ) ;
Original file line number Diff line number Diff line change @@ -96,7 +96,7 @@ export class Undici implements Integration {
9696 */
9797 public setupOnce ( _addGlobalEventProcessor : ( callback : EventProcessor ) => void ) : void {
9898 // Requires Node 16+ to use the diagnostics_channel API.
99- if ( NODE_VERSION . major && NODE_VERSION . major < 16 ) {
99+ if ( NODE_VERSION . major < 16 ) {
100100 return ;
101101 }
102102
Original file line number Diff line number Diff line change @@ -183,7 +183,7 @@ export function normalizeRequestArgs(
183183 // as it will always return `http`, even when using `https` module.
184184 //
185185 // See test/integrations/http.test.ts for more details on Node <=v8 protocol issue.
186- if ( NODE_VERSION . major && NODE_VERSION . major > 8 ) {
186+ if ( NODE_VERSION . major > 8 ) {
187187 requestOptions . protocol =
188188 ( httpModule ?. globalAgent as any ) ?. protocol ||
189189 ( requestOptions . agent as any ) ?. protocol ||
Original file line number Diff line number Diff line change 11import { parseSemver } from '@sentry/utils' ;
22
3- export const NODE_VERSION : ReturnType < typeof parseSemver > = parseSemver ( process . versions . node ) ;
3+ export const NODE_VERSION = parseSemver ( process . versions . node ) as { major : number ; minor : number ; patch : number } ;
Original file line number Diff line number Diff line change @@ -648,7 +648,7 @@ describe('default protocols', () => {
648648 // intercepting a https:// request with http:// mock. It's a safe bet
649649 // because the latest versions of nock no longer support Node v8 and lower,
650650 // so won't bother dealing with this old Node edge case.
651- if ( NODE_VERSION . major && NODE_VERSION . major < 9 ) {
651+ if ( NODE_VERSION . major < 9 ) {
652652 nockProtocol = 'http' ;
653653 }
654654 nock ( `${ nockProtocol } ://${ key } .ingest.sentry.io` ) . get ( '/api/123122332/store/' ) . reply ( 200 ) ;
@@ -671,7 +671,7 @@ describe('default protocols', () => {
671671 const proxy = 'http://<PROXY_URL>:3128' ;
672672 const agent = HttpsProxyAgent ( proxy ) ;
673673
674- if ( NODE_VERSION . major && NODE_VERSION . major < 9 ) {
674+ if ( NODE_VERSION . major < 9 ) {
675675 nockProtocol = 'http' ;
676676 }
677677
Original file line number Diff line number Diff line change @@ -150,7 +150,7 @@ const exceptionEvent100Frames = {
150150 } ,
151151} ;
152152
153- describeIf ( ( NODE_VERSION . major || 0 ) >= 18 ) ( 'LocalVariables' , ( ) => {
153+ describeIf ( NODE_VERSION . major >= 18 ) ( 'LocalVariables' , ( ) => {
154154 it ( 'Adds local variables to stack frames' , async ( ) => {
155155 const session = new MockDebugSession ( {
156156 '-6224981551105448869.1.2' : { name : 'tim' } ,
You can’t perform that action at this time.
0 commit comments