UNPKG

@deepkit/framework

Version:

36 lines 1.33 kB
"use strict"; /* * Deepkit Framework * Copyright (C) 2021 Deepkit UG, Marc J. Schmidt * * This program is free software: you can redistribute it and/or modify * it under the terms of the MIT License. * * You should have received a copy of the MIT License along with this program. */ Object.defineProperty(exports, "__esModule", { value: true }); exports.Zone = exports.__ΩSimpleStore = void 0; const async_hooks_1 = require("async_hooks"); const __ΩSimpleStore = ['SimpleStore', 'P&"LMw!y']; exports.__ΩSimpleStore = __ΩSimpleStore; class Zone { static enable() { if (this.asyncLocalStorage) return; this.asyncLocalStorage = (async_hooks_1.AsyncLocalStorage.Ω = [['"']], new async_hooks_1.AsyncLocalStorage()); this.asyncLocalStorage.enterWith({}); } static current() { if (Zone.asyncLocalStorage) return Zone.asyncLocalStorage.getStore(); return undefined; } static run(data, cb) { if (!Zone.asyncLocalStorage) return cb(); return Zone.asyncLocalStorage.run(data, cb); } } exports.Zone = Zone; Zone.__type = ['asyncLocalStorage', 'enable', () => __ΩSimpleStore, 'current', () => __ΩSimpleStore, 'data', '', 'cb', 'run', 'Zone', '!3!8sP"0"sPPn#-J0$sPn%2&P"/\'2("0)s5w*']; //# sourceMappingURL=zone.js.map