Skip to content

Commit 1ff23d1

Browse files
committed
Move NODE_VERSION to the constant declaration
1 parent ad34fb7 commit 1ff23d1

File tree

1 file changed

+3
-5
lines changed

1 file changed

+3
-5
lines changed

lib/tmp.ts

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,8 @@ const
7878
DIR_MODE = 448 /* 0o700 */,
7979
FILE_MODE = 384 /* 0o600 */,
8080

81+
NODE_VERSION = process.versions.node.split('.').map((value) => parseInt(value, 10)),
82+
8183
// this will hold the objects need to be removed on exit
8284
_removeObjects: CleanupCallback[] = [];
8385

@@ -522,11 +524,7 @@ function setGracefulCleanup(): void {
522524
_gracefulCleanup = true;
523525
}
524526

525-
const version = process.versions.node.split('.').map(function (value) {
526-
return parseInt(value, 10);
527-
});
528-
529-
if (version[0] === 0 && (version[1] < 9 || version[1] === 9 && version[2] < 5)) {
527+
if (NODE_VERSION[0] === 0 && (NODE_VERSION[1] < 9 || NODE_VERSION[1] === 9 && NODE_VERSION[2] < 5)) {
530528
process.addListener('uncaughtException', function _uncaughtExceptionThrown(err) {
531529
_uncaughtException = true;
532530
_garbageCollector();

0 commit comments

Comments
 (0)