There was an error while loading. Please reload this page.
1 parent 8339c3d commit b20f3c9Copy full SHA for b20f3c9
lib/esm-utils.js
@@ -34,7 +34,9 @@ const hasStableEsmImplementation = (() => {
34
const [major, minor] = process.version.split('.');
35
// ESM is stable from v12.22.0 onward
36
// https://nodejs.org/api/esm.html#esm_modules_ecmascript_modules
37
- return parseInt(major.slice(1), 10) > 12 || parseInt(minor, 10) >= 22;
+ const majorNumber = parseInt(major.slice(1), 10);
38
+ const minorNumber = parseInt(minor, 10);
39
+ return majorNumber > 12 || (majorNumber === 12 && minorNumber >= 22);
40
})();
41
42
exports.requireOrImport = hasStableEsmImplementation
0 commit comments