rittenhop-dev/versions/5.94.2/node_modules/@sentry/node/esm/async/index.js
2024-09-23 19:40:12 -04:00

21 lines
546 B
JavaScript

import { NODE_VERSION } from '../nodeVersion.js';
import { setDomainAsyncContextStrategy } from './domain.js';
import { setHooksAsyncContextStrategy } from './hooks.js';
/**
* Sets the correct async context strategy for Node.js
*
* Node.js >= 14 uses AsyncLocalStorage
* Node.js < 14 uses domains
*/
function setNodeAsyncContextStrategy() {
if (NODE_VERSION.major >= 14) {
setHooksAsyncContextStrategy();
} else {
setDomainAsyncContextStrategy();
}
}
export { setNodeAsyncContextStrategy };
//# sourceMappingURL=index.js.map