This commit is contained in:
Iliyan Angelov
2025-09-14 23:24:25 +03:00
commit c67067a2a4
71311 changed files with 6800714 additions and 0 deletions

48
frontend/node_modules/unload/dist/lib/node.js generated vendored Normal file
View File

@@ -0,0 +1,48 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports["default"] = void 0;
// set to true to log events
var DEBUG = false;
function add(fn) {
process.on('exit', function () {
DEBUG && console.log('node: exit');
return fn();
});
/**
* on the following events,
* the process will not end if there are
* event-handlers attached,
* therefore we have to call process.exit()
*/
process.on('beforeExit', function () {
DEBUG && console.log('node: beforeExit');
return fn().then(function () {
return process.exit();
});
}); // catches ctrl+c event
process.on('SIGINT', function () {
DEBUG && console.log('node: SIGNINT');
return fn().then(function () {
return process.exit();
});
}); // catches uncaught exceptions
process.on('uncaughtException', function (err) {
DEBUG && console.log('node: uncaughtException');
return fn().then(function () {
console.trace(err);
process.exit(1);
});
});
}
var _default = {
add: add
};
exports["default"] = _default;