Comparing version 2.1.1 to 2.1.2
/* IMPORT */ | ||
import process from 'node:process'; | ||
import { IS_WINDOWS } from './constants.js'; | ||
import Signals from './signals.js'; | ||
@@ -20,3 +21,8 @@ /* MAIN */ | ||
if (signal) { | ||
process.kill(process.pid, signal); | ||
if (IS_WINDOWS && (signal !== 'SIGINT' && signal !== 'SIGTERM' && signal !== 'SIGKILL')) { // Windows doesn't support POSIX signals, but Node emulates these 3 signals for us | ||
process.kill(process.pid, 'SIGTERM'); | ||
} | ||
else { | ||
process.kill(process.pid, signal); | ||
} | ||
} | ||
@@ -23,0 +29,0 @@ }; |
@@ -5,3 +5,3 @@ { | ||
"description": "Execute a function right before the process, or the browser's tab, is about to exit.", | ||
"version": "2.1.1", | ||
"version": "2.1.2", | ||
"type": "module", | ||
@@ -8,0 +8,0 @@ "main": "dist/node/index.js", |
@@ -5,2 +5,3 @@ | ||
import process from 'node:process'; | ||
import {IS_WINDOWS} from './constants'; | ||
import Signals from './signals'; | ||
@@ -42,4 +43,12 @@ import type {Callback, Disposer} from '../types'; | ||
process.kill ( process.pid, signal ); | ||
if ( IS_WINDOWS && ( signal !== 'SIGINT' && signal !== 'SIGTERM' && signal !== 'SIGKILL' ) ) { // Windows doesn't support POSIX signals, but Node emulates these 3 signals for us | ||
process.kill ( process.pid, 'SIGTERM' ); | ||
} else { | ||
process.kill ( process.pid, signal ); | ||
} | ||
} | ||
@@ -46,0 +55,0 @@ |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
11607
270