ecma-evaluator 2.0.10 → 2.1.1
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.
- package/README.md +4 -4
- package/README.zh-CN.md +4 -4
- package/dist/cjs/Evaluator.d.cts +6 -4
- package/dist/cjs/index.cjs +1024 -194
- package/dist/cjs/index.cjs.map +1 -1
- package/dist/esm/Evaluator.d.mts +6 -4
- package/dist/esm/index.mjs +1024 -194
- package/dist/esm/index.mjs.map +1 -1
- package/package.json +16 -7
package/dist/esm/Evaluator.d.mts
CHANGED
|
@@ -1,5 +1,3 @@
|
|
|
1
|
-
import { Node } from "acorn";
|
|
2
|
-
|
|
3
1
|
export interface EvaluatorOptions {
|
|
4
2
|
/**
|
|
5
3
|
* Maximum expression length in UTF-16 code units (hard maximum: 100000).
|
|
@@ -11,6 +9,12 @@ export interface EvaluatorOptions {
|
|
|
11
9
|
* @default 10000
|
|
12
10
|
*/
|
|
13
11
|
maxEvaluationSteps?: number;
|
|
12
|
+
/**
|
|
13
|
+
* Maximum interpreter recursion depth (hard maximum: 2000). Bounds nested
|
|
14
|
+
* expressions so a deeply nested input cannot exhaust the host call stack.
|
|
15
|
+
* @default 1000
|
|
16
|
+
*/
|
|
17
|
+
maxDepth?: number;
|
|
14
18
|
}
|
|
15
19
|
|
|
16
20
|
export declare class Evaluator {
|
|
@@ -20,5 +24,3 @@ export declare class Evaluator {
|
|
|
20
24
|
|
|
21
25
|
evaluate<T = unknown>(expression: string): T;
|
|
22
26
|
}
|
|
23
|
-
|
|
24
|
-
export declare function getNodeString(node: Node): string;
|