
!function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="67aaf0ed-4b11-5cbd-a453-9742c75b2ddd")}catch(e){}}();
import treeKill from "tree-kill";
export function terminateProcessForTimeout(child, options = {}) {
    const platform = options.platform ?? process.platform;
    if (platform === "win32") {
        child.kill();
        const pid = typeof child.pid === "number" ? child.pid : 0;
        if (pid > 0) {
            try {
                (options.killProcessTree ?? treeKill)(pid, "SIGTERM", () => {
                    // Best effort only.
                });
            }
            catch {
                // Best effort only.
            }
        }
        return;
    }
    child.kill("SIGTERM");
}
//# sourceMappingURL=process-termination.js.map
//# debugId=67aaf0ed-4b11-5cbd-a453-9742c75b2ddd
