Skip to content

Commit 9fb250e

Browse files
committed
Use NODE_MAJOR and NODE_MINOR
1 parent 9a57643 commit 9fb250e

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

packages/node-core/src/utils/detection.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import { consoleSandbox } from '@sentry/core';
2+
import { NODE_MAJOR, NODE_MINOR } from '../nodeVersion';
23

34
/** Detect CommonJS. */
45
export function isCjs(): boolean {
@@ -19,8 +20,7 @@ export function supportsEsmLoaderHooks(): boolean {
1920
return false;
2021
}
2122

22-
const [nodeMajor = 0, nodeMinor = 0] = process.versions.node.split('.').map(Number);
23-
if (nodeMajor >= 21 || (nodeMajor === 20 && nodeMinor >= 6) || (nodeMajor === 18 && nodeMinor >= 19)) {
23+
if (NODE_MAJOR >= 21 || (NODE_MAJOR === 20 && NODE_MINOR >= 6) || (NODE_MAJOR === 18 && NODE_MINOR >= 19)) {
2424
return true;
2525
}
2626

0 commit comments

Comments
 (0)