rittenhop-dev/versions/5.94.2/node_modules/@sentry/node/cjs/async/index.js

23 lines
618 B
JavaScript
Raw Normal View History

2024-09-23 19:40:12 -04:00
Object.defineProperty(exports, '__esModule', { value: true });
const nodeVersion = require('../nodeVersion.js');
const domain = require('./domain.js');
const hooks = require('./hooks.js');
/**
* Sets the correct async context strategy for Node.js
*
* Node.js >= 14 uses AsyncLocalStorage
* Node.js < 14 uses domains
*/
function setNodeAsyncContextStrategy() {
if (nodeVersion.NODE_VERSION.major >= 14) {
hooks.setHooksAsyncContextStrategy();
} else {
domain.setDomainAsyncContextStrategy();
}
}
exports.setNodeAsyncContextStrategy = setNodeAsyncContextStrategy;
//# sourceMappingURL=index.js.map