Repository URL to install this package:
|
Version:
0.7.0 ▾
|
// (c) Copyright 2023 Supertenant Ltd. - all rights reserved.
// See LICENSE file in project root for license terms.
"use strict";const callback=require("./sdk")(!0),promise=require("./sdk")(!1);let cls;exports.init=function(_cls){cls=_cls,callback.init(_cls),promise.init(_cls)},exports.activate=function(){callback.activate(),promise.activate()},exports.deactivate=function(){callback.deactivate(),promise.deactivate()},exports.getAsyncContext=function(){return cls?cls.getAsyncContext():null},exports.runInAsyncContext=function(context,fn){if(!cls)return fn();cls.runInAsyncContext(context,fn)},exports.runPromiseInAsyncContext=function(context,fn){return cls?cls.runPromiseInAsyncContext(context,fn):fn()},exports.callback=callback,exports.promise=promise,exports.async=promise;