@logicflow/engine
Version:
a process engine for javascript
28 lines • 960 B
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.getExpressionResult = exports.globalScope = exports.isInBrowser = void 0;
const tslib_1 = require("tslib");
const browserVm_1 = require("./browserVm");
const isInBrowser = typeof window === 'object' && window.window === window;
exports.isInBrowser = isInBrowser;
const globalScope = (() => {
if (isInBrowser) {
return window;
}
if (typeof self === 'object' && self.self === self) {
return self;
}
if (typeof globalThis === 'object') {
return globalThis;
}
return {
eval: () => undefined,
};
})();
exports.globalScope = globalScope;
const getExpressionResult = (code, context) => tslib_1.__awaiter(void 0, void 0, void 0, function* () {
const r = yield (0, browserVm_1.runInBrowserContext)(code, context);
return r;
});
exports.getExpressionResult = getExpressionResult;
//# sourceMappingURL=index.js.map