ecma-evaluator 1.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1 @@
1
+ {"version":3,"file":"cjs/index.cjs","sources":["webpack://ecma-evaluator/./src/Evaluator.js","webpack://ecma-evaluator/./src/index.js"],"sourcesContent":["import * as acorn from \"acorn\";\n\n// List of TypedArray constructors available in the environment\nconst typeArrayConstructors = [\n\tInt8Array,\n\tUint8Array,\n\tUint8ClampedArray,\n\tInt16Array,\n\tUint16Array,\n\tInt32Array,\n\tUint32Array,\n\tFloat32Array,\n\tFloat64Array,\n\tglobalThis.BigInt64Array,\n\tglobalThis.BigUint64Array,\n].filter(Boolean);\n\n// Set of methods that mutate their objects and should be blocked for safety\nconst mutableMethods = new Set([\n\tArray.prototype.push,\n\tArray.prototype.pop,\n\tArray.prototype.shift,\n\tArray.prototype.unshift,\n\tArray.prototype.splice,\n\tArray.prototype.reverse,\n\tArray.prototype.sort,\n\tArray.prototype.fill,\n\tArray.prototype.copyWithin,\n\tArrayBuffer.prototype.slice,\n\tDataView.prototype.setInt8,\n\tDataView.prototype.setUint8,\n\tDataView.prototype.setInt16,\n\tDataView.prototype.setUint16,\n\tDataView.prototype.setInt32,\n\tDataView.prototype.setUint32,\n\tDataView.prototype.setFloat32,\n\tDataView.prototype.setFloat64,\n\t// TypedArray methods\n\t...typeArrayConstructors.flatMap((TypedArray) => [\n\t\tTypedArray.prototype.set,\n\t\tTypedArray.prototype.fill,\n\t\tTypedArray.prototype.copyWithin,\n\t\tTypedArray.prototype.reverse,\n\t\tTypedArray.prototype.sort,\n\t]),\n\n\tObject.freeze,\n\tObject.defineProperty,\n\tObject.defineProperties,\n\tObject.preventExtensions,\n\tObject.setPrototypeOf,\n\tObject.assign,\n\tSet.prototype.add,\n\tSet.prototype.delete,\n\tSet.prototype.clear,\n\tWeakSet.prototype.add,\n\tWeakSet.prototype.delete,\n\tMap.prototype.set,\n\tMap.prototype.delete,\n\tMap.prototype.clear,\n\tWeakMap.prototype.set,\n\tWeakMap.prototype.delete,\n\tDate.prototype.setMilliseconds,\n\tDate.prototype.setMinutes,\n\tDate.prototype.setHours,\n\tDate.prototype.setDate,\n\tDate.prototype.setFullYear,\n\tDate.prototype.setUTCMinutes,\n\tDate.prototype.setUTCHours,\n\tDate.prototype.setUTCDate,\n\tDate.prototype.setUTCFullYear,\n\tDate.prototype.setTime,\n]);\n\n/**\n * A JavaScript expression evaluator that safely evaluates expressions within a sandboxed environment.\n * Supports various JavaScript features including arithmetic, logical operations, functions, and more.\n */\nexport class Evaluator {\n\t/**\n\t * Creates a new Evaluator instance.\n\t * @param {Object} [variables={}] - An optional object containing variables to make available in the evaluation context\n\t */\n\tconstructor(variables = {}) {\n\t\tconst globalScope = Object.assign(Object.create(null), {\n\t\t\tInfinity,\n\t\t\tnull: null,\n\t\t\tundefined,\n\t\t\tNaN: Number.NaN,\n\t\t\tisNaN: Number.isNaN,\n\t\t\tisFinite: Number.isFinite,\n\t\t\tparseFloat: Number.parseFloat,\n\t\t\tparseInt: Number.parseInt,\n\t\t\tencodeURI: globalThis.encodeURI,\n\t\t\tencodeURIComponent: globalThis.encodeURIComponent,\n\t\t\tdecodeURI: globalThis.decodeURI,\n\t\t\tdecodeURIComponent: globalThis.decodeURIComponent,\n\t\t\tNumber,\n\t\t\tString,\n\t\t\tBoolean,\n\t\t\tBigInt: globalThis.BigInt,\n\t\t\tSymbol: globalThis.Symbol,\n\t\t\tObject,\n\t\t\tArray,\n\t\t\tSet,\n\t\t\tWeakSet,\n\t\t\tMap,\n\t\t\tWeakMap,\n\t\t\tMath,\n\t\t\tJSON,\n\t\t\tDate,\n\t\t\tRegExp,\n\t\t\tError,\n\t\t\tEvalError,\n\t\t\tRangeError,\n\t\t\tReferenceError,\n\t\t\tSyntaxError,\n\t\t\tTypeError,\n\t\t\tURIError,\n\t\t\tPromise,\n\t\t\t...typeArrayConstructors.reduce((acc, obj) => {\n\t\t\t\tacc[obj.name] = obj;\n\t\t\t\treturn acc;\n\t\t\t}, {}),\n\t\t});\n\t\tthis.scopes = [variables, globalScope]; // Scope stack: [user variables, global scope]\n\t}\n\n\t/**\n\t * Parses and evaluates a JavaScript expression.\n\t * @param {string} expression - The JavaScript expression to evaluate\n\t * @returns {*} The result of the evaluation\n\t */\n\tevaluate(expression) {\n\t\tconst ast = acorn.parse(expression, { ecmaVersion: \"latest\" });\n\n\t\t// Start recursive evaluation from the root node\n\t\treturn this.execute(ast.body);\n\t}\n\n\t/**\n\t * Executes an array of AST body nodes sequentially.\n\t * @private\n\t * @param {Array} body - Array of AST nodes to execute\n\t * @returns {*} The result of the last executed node\n\t */\n\texecute(body) {\n\t\tlet result;\n\t\tfor (const node of body) {\n\t\t\tresult = this.visit(node);\n\t\t}\n\t\treturn result;\n\t}\n\n\t/**\n\t * Visits an AST node and delegates to the appropriate handler based on node type.\n\t * @private\n\t * @param {Object} node - The AST node to visit\n\t * @returns {*} The result of visiting the node\n\t */\n\tvisit(node) {\n\t\tswitch (node.type) {\n\t\t\tcase \"ExpressionStatement\": {\n\t\t\t\treturn this.visit(node.expression);\n\t\t\t}\n\t\t\tcase \"BinaryExpression\": {\n\t\t\t\treturn this.handleBinaryExpression(node);\n\t\t\t}\n\t\t\tcase \"LogicalExpression\": {\n\t\t\t\treturn this.handleLogicalExpression(node);\n\t\t\t}\n\t\t\tcase \"UnaryExpression\": {\n\t\t\t\treturn this.handleUnaryExpression(node);\n\t\t\t}\n\t\t\tcase \"Identifier\": {\n\t\t\t\treturn this.handleIdentifier(node);\n\t\t\t}\n\t\t\tcase \"Literal\": {\n\t\t\t\treturn node.value;\n\t\t\t}\n\t\t\tcase \"MemberExpression\": {\n\t\t\t\treturn this.handleMemberExpression(node);\n\t\t\t}\n\t\t\tcase \"ObjectExpression\": {\n\t\t\t\treturn this.handleObjectExpression(node);\n\t\t\t}\n\t\t\tcase \"ArrayExpression\": {\n\t\t\t\treturn this.handleArrayExpression(node);\n\t\t\t}\n\t\t\tcase \"ArrowFunctionExpression\": {\n\t\t\t\treturn this.handleArrowFunctionExpression(node);\n\t\t\t}\n\t\t\tcase \"CallExpression\": {\n\t\t\t\treturn this.handleCallExpression(node);\n\t\t\t}\n\t\t\tcase \"ConditionalExpression\": {\n\t\t\t\treturn this.visit(node.test) ? this.visit(node.consequent) : this.visit(node.alternate);\n\t\t\t}\n\t\t\tcase \"NewExpression\": {\n\t\t\t\tif (node.callee.type !== \"Identifier\") {\n\t\t\t\t\tthrow new Error(`Unsupported callee type '${node.callee.type}' in new expression`);\n\t\t\t\t}\n\n\t\t\t\tif (node.callee.name === \"Function\") {\n\t\t\t\t\tthrow new Error(\"Cannot use new with Function constructor\");\n\t\t\t\t}\n\n\t\t\t\tconst Constructor = this.visit(node.callee);\n\n\t\t\t\tconst args = node.arguments.map((arg) => this.visit(arg));\n\n\t\t\t\treturn new Constructor(...args);\n\t\t\t}\n\t\t\tcase \"ChainExpression\": {\n\t\t\t\treturn this.visit(node.expression);\n\t\t\t}\n\t\t\tcase \"TemplateLiteral\": {\n\t\t\t\treturn this.handleTemplateLiteral(node);\n\t\t\t}\n\t\t\tdefault: {\n\t\t\t\tthrow new Error(`Unsupported node type: ${node.type}`);\n\t\t\t}\n\t\t}\n\t}\n\n\t/**\n\t * Handles binary expressions (arithmetic and comparison operations).\n\t * @private\n\t */\n\thandleBinaryExpression(node) {\n\t\tswitch (node.operator) {\n\t\t\tcase \"+\": {\n\t\t\t\treturn this.visit(node.left) + this.visit(node.right);\n\t\t\t}\n\t\t\tcase \"-\": {\n\t\t\t\treturn this.visit(node.left) - this.visit(node.right);\n\t\t\t}\n\t\t\tcase \"*\": {\n\t\t\t\treturn this.visit(node.left) * this.visit(node.right);\n\t\t\t}\n\t\t\tcase \"**\": {\n\t\t\t\treturn this.visit(node.left) ** this.visit(node.right);\n\t\t\t}\n\t\t\tcase \"/\": {\n\t\t\t\tconst left = this.visit(node.left);\n\t\t\t\tconst right = this.visit(node.right);\n\t\t\t\tif (right === 0) throw new Error(\"Division by zero\");\n\t\t\t\treturn left / right;\n\t\t\t}\n\t\t\tcase \"==\": {\n\t\t\t\t// Intentionally using loose equality as per JavaScript semantics\n\t\t\t\t// biome-ignore lint/suspicious/noDoubleEquals: <explanation>\n\t\t\t\treturn this.visit(node.left) == this.visit(node.right);\n\t\t\t}\n\t\t\tcase \"===\": {\n\t\t\t\treturn this.visit(node.left) === this.visit(node.right);\n\t\t\t}\n\t\t\tcase \"!=\": {\n\t\t\t\t// Intentionally using loose inequality as per JavaScript semantics\n\t\t\t\t// biome-ignore lint/suspicious/noDoubleEquals: <explanation>\n\t\t\t\treturn this.visit(node.left) != this.visit(node.right);\n\t\t\t}\n\t\t\tcase \"!==\": {\n\t\t\t\treturn this.visit(node.left) !== this.visit(node.right);\n\t\t\t}\n\t\t\tcase \">\": {\n\t\t\t\treturn this.visit(node.left) > this.visit(node.right);\n\t\t\t}\n\t\t\tcase \">=\": {\n\t\t\t\treturn this.visit(node.left) >= this.visit(node.right);\n\t\t\t}\n\t\t\tcase \"<\": {\n\t\t\t\treturn this.visit(node.left) < this.visit(node.right);\n\t\t\t}\n\t\t\tcase \"<=\": {\n\t\t\t\treturn this.visit(node.left) <= this.visit(node.right);\n\t\t\t}\n\t\t\tcase \"%\": {\n\t\t\t\treturn this.visit(node.left) % this.visit(node.right);\n\t\t\t}\n\t\t\t// Bitwise operators\n\t\t\tcase \"&\": {\n\t\t\t\treturn this.visit(node.left) & this.visit(node.right);\n\t\t\t}\n\t\t\tcase \"|\": {\n\t\t\t\treturn this.visit(node.left) | this.visit(node.right);\n\t\t\t}\n\t\t\tcase \"^\": {\n\t\t\t\treturn this.visit(node.left) ^ this.visit(node.right);\n\t\t\t}\n\t\t\tcase \"<<\": {\n\t\t\t\treturn this.visit(node.left) << this.visit(node.right);\n\t\t\t}\n\t\t\tcase \">>\": {\n\t\t\t\treturn this.visit(node.left) >> this.visit(node.right);\n\t\t\t}\n\t\t\tcase \">>>\": {\n\t\t\t\treturn this.visit(node.left) >>> this.visit(node.right);\n\t\t\t}\n\t\t\tdefault: {\n\t\t\t\tthrow new Error(`Unsupported operator: ${node.operator}`);\n\t\t\t}\n\t\t}\n\t}\n\n\t/**\n\t * Handles logical expressions (&&, ||, ??).\n\t * @private\n\t */\n\thandleLogicalExpression(node) {\n\t\tswitch (node.operator) {\n\t\t\tcase \"&&\": {\n\t\t\t\treturn this.visit(node.left) && this.visit(node.right);\n\t\t\t}\n\t\t\tcase \"||\": {\n\t\t\t\treturn this.visit(node.left) || this.visit(node.right);\n\t\t\t}\n\t\t\tcase \"??\": {\n\t\t\t\tconst left = this.visit(node.left);\n\n\t\t\t\treturn left !== null && left !== undefined ? left : this.visit(node.right);\n\t\t\t}\n\t\t\tdefault: {\n\t\t\t\tthrow new Error(`Unsupported logical operator: ${node.operator}`);\n\t\t\t}\n\t\t}\n\t}\n\n\t/**\n\t * Handles unary expressions (-, +, !, ~, typeof, void).\n\t * @private\n\t */\n\thandleUnaryExpression(node) {\n\t\tswitch (node.operator) {\n\t\t\tcase \"-\": {\n\t\t\t\treturn -this.visit(node.argument);\n\t\t\t}\n\t\t\tcase \"+\": {\n\t\t\t\treturn +this.visit(node.argument);\n\t\t\t}\n\t\t\tcase \"!\": {\n\t\t\t\treturn !this.visit(node.argument);\n\t\t\t}\n\t\t\tcase \"~\": {\n\t\t\t\treturn ~this.visit(node.argument);\n\t\t\t}\n\t\t\tcase \"typeof\": {\n\t\t\t\treturn typeof this.visit(node.argument);\n\t\t\t}\n\t\t\tcase \"void\": {\n\t\t\t\t// eslint-disable-next-line sonarjs/void-use\n\t\t\t\treturn void this.visit(node.argument);\n\t\t\t}\n\t\t\tcase \"delete\": {\n\t\t\t\tthrow new Error(\"Delete operator is mutable and not supported\");\n\t\t\t}\n\t\t\tdefault: {\n\t\t\t\tthrow new Error(`Unsupported unary operator: ${node.operator}`);\n\t\t\t}\n\t\t}\n\t}\n\n\t/**\n\t * Handles identifier (variable) lookups in the scope chain.\n\t * @private\n\t */\n\thandleIdentifier(node) {\n\t\tconst name = node.name;\n\t\tfor (const scope of this.scopes) {\n\t\t\tif (Object.hasOwn(scope, name)) {\n\t\t\t\treturn scope[name];\n\t\t\t}\n\t\t}\n\n\t\tthrow new ReferenceError(`${name} is not defined`);\n\t}\n\n\t/**\n\t * Handles member expressions (property access like obj.prop or obj[prop]).\n\t * @private\n\t */\n\thandleMemberExpression(node) {\n\t\tconst object = this.visit(node.object);\n\t\tconst property = node.property.type === \"Identifier\" && !node.computed ? node.property.name : this.visit(node.property);\n\n\t\tif (object === null || object === undefined) {\n\t\t\t// optional chaining\n\t\t\tif (node.optional) {\n\t\t\t\treturn void 0;\n\t\t\t}\n\t\t\tthrow new TypeError(`Cannot read property '${property}' of ${object}`);\n\t\t}\n\n\t\t// Check for own properties first (instance properties take precedence)\n\t\tif (Object.hasOwn(object, property)) {\n\t\t\treturn object[property];\n\t\t}\n\n\t\tconst prototypeValue = object[property];\n\n\t\tif (mutableMethods.has(prototypeValue)) {\n\t\t\tthrow new Error(`Cannot call mutable prototype method: ${property}`);\n\t\t}\n\n\t\tif (typeof prototypeValue === \"function\") {\n\t\t\t// Bind prototype methods to the instance\n\t\t\treturn prototypeValue.bind(object);\n\t\t}\n\n\t\treturn prototypeValue;\n\t}\n\n\t/**\n\t * Handles object literal expressions.\n\t * @private\n\t */\n\thandleObjectExpression(node) {\n\t\tconst obj = {};\n\t\tfor (const prop of node.properties) {\n\t\t\tconst key = prop.key.name || prop.key.value;\n\t\t\tconst value = this.visit(prop.value);\n\t\t\tobj[key] = value;\n\t\t}\n\t\treturn obj;\n\t}\n\n\t/**\n\t * Handles array literal expressions.\n\t * @private\n\t */\n\thandleArrayExpression(node) {\n\t\treturn node.elements.map((element) => this.visit(element));\n\t}\n\n\t/**\n\t * Handles arrow function expressions.\n\t * @private\n\t */\n\thandleArrowFunctionExpression(node) {\n\t\treturn (...args) => {\n\t\t\tconst newScope = {};\n\t\t\tfor (const [index, param] of node.params.entries()) {\n\t\t\t\tnewScope[param.name] = args[index];\n\t\t\t}\n\t\t\tthis.scopes.unshift(newScope);\n\t\t\tconst result = this.visit(node.body);\n\t\t\tthis.scopes.shift();\n\t\t\treturn result;\n\t\t};\n\t}\n\n\t/**\n\t * Handles function call expressions, including optional chaining.\n\t * @private\n\t */\n\thandleCallExpression(node) {\n\t\tconst calledString = this.getNodeString(node.callee);\n\n\t\tconst func = this.visit(node.callee);\n\n\t\tif (typeof func !== \"function\") {\n\t\t\tconst isOptional = node.optional || node.callee.optional;\n\t\t\tif ((func === undefined || func === null) && isOptional) {\n\t\t\t\treturn void 0;\n\t\t\t}\n\t\t\tthrow new TypeError(`${calledString} is not a function`);\n\t\t}\n\n\t\tconst args = node.arguments.map((arg) => this.visit(arg));\n\n\t\treturn func(...args);\n\t}\n\n\t/**\n\t * Handles template literal expressions.\n\t * @private\n\t */\n\thandleTemplateLiteral(node) {\n\t\treturn node.quasis\n\t\t\t.concat(node.expressions)\n\t\t\t.filter(Boolean)\n\t\t\t.sort((a, b) => {\n\t\t\t\treturn a.start - b.start;\n\t\t\t})\n\t\t\t.map((node) => {\n\t\t\t\tif (node.type === \"TemplateElement\") {\n\t\t\t\t\treturn node.value.raw;\n\t\t\t\t}\n\n\t\t\t\treturn this.visit(node);\n\t\t\t})\n\t\t\t.join(\"\");\n\t}\n\n\t/**\n\t * Converts an AST node to a human-readable string representation for error messages.\n\t * @private\n\t * @param {Object} node - The AST node to convert\n\t * @returns {string|null} A string representation of the node, or null if not supported\n\t */\n\tgetNodeString(node) {\n\t\tswitch (node.type) {\n\t\t\tcase \"Identifier\": {\n\t\t\t\treturn node.name;\n\t\t\t}\n\t\t\tcase \"Literal\": {\n\t\t\t\treturn node.raw;\n\t\t\t}\n\t\t\tcase \"ArrayExpression\": {\n\t\t\t\treturn \"(array)\";\n\t\t\t}\n\t\t\tcase \"ObjectExpression\": {\n\t\t\t\treturn \"(object)\";\n\t\t\t}\n\t\t\tcase \"MemberExpression\": {\n\t\t\t\tlet accessor = this.getNodeString(node.object);\n\n\t\t\t\tif (node.computed) {\n\t\t\t\t\taccessor += `[${this.getNodeString(node.property)}]`;\n\t\t\t\t} else {\n\t\t\t\t\taccessor += `.${this.getNodeString(node.property)}`;\n\t\t\t\t}\n\n\t\t\t\treturn accessor;\n\t\t\t}\n\t\t\tdefault: {\n\t\t\t\treturn null;\n\t\t\t}\n\t\t}\n\t}\n}\n","import { Evaluator } from \"./Evaluator.js\";\n\n// Regular expression to match ${{ expression }} template patterns\nconst TEMPLATE_EXPRESSION_REGEX = /\\$\\{\\{((?:[^{}]|{[^{}]*})+)\\}\\}/g;\n\n/**\n * Evaluates a JavaScript expression with an optional context.\n * @param {string} expression - The JavaScript expression to evaluate\n * @param {Object} [context] - Optional context object with variables to use in the expression\n * @returns {*} The result of evaluating the expression\n */\nexport function evaluatorExpression(expression, context) {\n\tconst evaluator = new Evaluator(context);\n\n\treturn evaluator.evaluate(expression);\n}\n\n/**\n * Evaluates a template string by replacing ${{ expression }} patterns with their evaluated values.\n * @param {string} template - The template string containing ${{ expression }} patterns\n * @param {Object} [context] - Optional context object with variables to use in expressions\n * @returns {string} The template with all expressions evaluated and replaced\n */\nexport function evaluatorTemplate(template, context) {\n\tconst evaluator = new Evaluator(context);\n\t\n\treturn template.replace(TEMPLATE_EXPRESSION_REGEX, (match, expression) => {\n\t\ttry {\n\t\t\tconst value = evaluator.evaluate(expression.trim());\n\t\t\treturn String(value);\n\t\t} catch (error) {\n\t\t\tif (error instanceof ReferenceError && error.message.endsWith(\"is not defined\")) {\n\t\t\t\treturn \"\";\n\t\t\t}\n\t\t\tthrow error;\n\t\t}\n\t});\n}\n"],"names":["typeArrayConstructors","Int8Array","Uint8Array","Uint8ClampedArray","Int16Array","Uint16Array","Int32Array","Uint32Array","Float32Array","Float64Array","globalThis","Boolean","mutableMethods","Set","Array","ArrayBuffer","DataView","TypedArray","Object","WeakSet","Map","WeakMap","Date","Evaluator","variables","globalScope","Infinity","undefined","Number","String","Math","JSON","RegExp","Error","EvalError","RangeError","ReferenceError","SyntaxError","TypeError","URIError","Promise","acc","obj","evaluate","expression","ast","acorn","execute","body","result","_iteratorError","node","visit","Constructor","args","arg","handleBinaryExpression","left","right","handleLogicalExpression","handleUnaryExpression","_type_of","handleIdentifier","name","scope","handleMemberExpression","object","property","prototypeValue","handleObjectExpression","prop","key","value","handleArrayExpression","element","handleArrowFunctionExpression","newScope","index","param","handleCallExpression","calledString","func","isOptional","handleTemplateLiteral","a","b","getNodeString","accessor","TEMPLATE_EXPRESSION_REGEX","evaluatorExpression","context","evaluator","evaluatorTemplate","template","match","error"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAGA,IAAMA,wBAAwB;IAC7BC;IACAC;IACAC;IACAC;IACAC;IACAC;IACAC;IACAC;IACAC;IACAC,WAAW,aAAa;IACxBA,WAAW,cAAc;CACzB,CAAC,MAAM,CAACC;AAGT,IAAMC,iBAAiB,IAAIC,IAAI;IAC9BC,MAAM,SAAS,CAAC,IAAI;IACpBA,MAAM,SAAS,CAAC,GAAG;IACnBA,MAAM,SAAS,CAAC,KAAK;IACrBA,MAAM,SAAS,CAAC,OAAO;IACvBA,MAAM,SAAS,CAAC,MAAM;IACtBA,MAAM,SAAS,CAAC,OAAO;IACvBA,MAAM,SAAS,CAAC,IAAI;IACpBA,MAAM,SAAS,CAAC,IAAI;IACpBA,MAAM,SAAS,CAAC,UAAU;IAC1BC,YAAY,SAAS,CAAC,KAAK;IAC3BC,SAAS,SAAS,CAAC,OAAO;IAC1BA,SAAS,SAAS,CAAC,QAAQ;IAC3BA,SAAS,SAAS,CAAC,QAAQ;IAC3BA,SAAS,SAAS,CAAC,SAAS;IAC5BA,SAAS,SAAS,CAAC,QAAQ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C,UAAU,QAAQ,CAAC/C;AAC3B;AAQO,SAASgD,kBAAkBC,QAAQ,EAAEH,OAAO;IAClD,IAAMC,YAAY,IAAIpE,oBAAUmE;IAEhC,OAAOG,SAAS,OAAO,CAACL,2BAA2B,SAACM,KAAK,EAAElD,UAAU;QACpE,IAAI;YACH,IAAM4B,QAAQmB,UAAU,QAAQ,CAAC/C,WAAW,IAAI;YAChD,OAAOf,OAAO2C;QACf,EAAE,OAAOuB,OAAO;YACf,IAAIA,iBAAiB3D,kBAAkB2D,MAAM,OAAO,CAAC,QAAQ,CAAC,mBAC7D,OAAO;YAER,MAAMA;QACP;IACD;AACD"}
@@ -0,0 +1,23 @@
1
+ /**
2
+ * 解析表达式
3
+ * @param expr
4
+ * @example
5
+ * ```js
6
+ * evaluatorExpression('1 + 1'); // 2
7
+ * evaluatorExpression('a > b', { a: 1, b: 2 }); // false
8
+ * evaluatorExpression('a > 10 && b < 10', { a: 11, b: 8 }); // true
9
+ * evaluatorExpression('array.map(v => v + 1)', { array: [1, 2, 3] }) // [2, 3, 4]
10
+ * ```
11
+ */
12
+ export declare function evaluatorExpression<T = unknown>(expr: string, context?: unknown): T;
13
+
14
+ /**
15
+ * 解析模板
16
+ * @param template
17
+ * @example
18
+ * ```js
19
+ * const context = { name: "world" };
20
+ * evaluatorTemplate("Hello ${{ name }}!", context); // Hello world!
21
+ * ```
22
+ */
23
+ export declare function evaluatorTemplate(template: string, context?: unknown): string;
@@ -0,0 +1,23 @@
1
+ /**
2
+ * 解析表达式
3
+ * @param expr
4
+ * @example
5
+ * ```js
6
+ * evaluatorExpression('1 + 1'); // 2
7
+ * evaluatorExpression('a > b', { a: 1, b: 2 }); // false
8
+ * evaluatorExpression('a > 10 && b < 10', { a: 11, b: 8 }); // true
9
+ * evaluatorExpression('array.map(v => v + 1)', { array: [1, 2, 3] }) // [2, 3, 4]
10
+ * ```
11
+ */
12
+ export declare function evaluatorExpression<T = unknown>(expr: string, context?: unknown): T;
13
+
14
+ /**
15
+ * 解析模板
16
+ * @param template
17
+ * @example
18
+ * ```js
19
+ * const context = { name: "world" };
20
+ * evaluatorTemplate("Hello ${{ name }}!", context); // Hello world!
21
+ * ```
22
+ */
23
+ export declare function evaluatorTemplate(template: string, context?: unknown): string;