mirror of
https://github.com/alibaba/lowcode-engine.git
synced 2025-12-12 03:01:16 +00:00
8 lines
250 B
TypeScript
8 lines
250 B
TypeScript
import { type EvalCodeFunction } from './codeRuntime';
|
|
|
|
export const evaluate: EvalCodeFunction = (code: string, scope: any) => {
|
|
return new Function('scope', `"use strict";return (function(){return (${code})}).bind(scope)();`)(
|
|
scope,
|
|
);
|
|
};
|