Skip to content

Commit

Permalink
Unify version check code with index.js (nodejs#1335)
Browse files Browse the repository at this point in the history
  • Loading branch information
cjh980402 authored and metcoder95 committed Dec 26, 2022
1 parent 1485b25 commit 7bfb670
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions lib/core/request.js
Expand Up @@ -13,10 +13,9 @@ const channels = {}

let extractBody

const [nodeMajor, nodeMinor] = process.version
.slice(1) // remove 'v'
.split('.', 2)
.map(v => Number(v))
const nodeVersion = process.versions.node.split('.')
const nodeMajor = Number(nodeVersion[0])
const nodeMinor = Number(nodeVersion[1])

try {
const diagnosticsChannel = require('diagnostics_channel')
Expand Down

0 comments on commit 7bfb670

Please sign in to comment.