@cabloy/utils 1.0.5 → 1.0.6
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/dist/utils.d.ts +1 -0
- package/dist/utils.js +4 -15
- package/package.json +1 -1
package/dist/utils.d.ts
CHANGED
|
@@ -6,3 +6,4 @@ export declare function setProperty<T>(obj: object, name: string, value: T): voi
|
|
|
6
6
|
export declare function getProperty<T>(obj: object, name: string, sep?: string): T | undefined;
|
|
7
7
|
export declare function getPropertyObject<T>(obj: object, name: string, sep?: string): T | undefined;
|
|
8
8
|
export declare function createFunction(expression: string, scopeKeys?: string[]): Function;
|
|
9
|
+
export declare function evaluateSimple(expression: string): any;
|
package/dist/utils.js
CHANGED
|
@@ -83,18 +83,7 @@ export function createFunction(expression, scopeKeys) {
|
|
|
83
83
|
}
|
|
84
84
|
return fn;
|
|
85
85
|
}
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
// for (let i = 0; i < scopeKeys.length; i++) {
|
|
91
|
-
// const key = scopeKeys[i];
|
|
92
|
-
// scopeParams.push(scope[key]);
|
|
93
|
-
// }
|
|
94
|
-
// const fn = createFunction(expression, scopeKeys);
|
|
95
|
-
// return fn(...scopeParams);
|
|
96
|
-
// }
|
|
97
|
-
// function _evaluateSimple(expression: string) {
|
|
98
|
-
// const fn = createFunction(expression);
|
|
99
|
-
// return fn();
|
|
100
|
-
// }
|
|
86
|
+
export function evaluateSimple(expression) {
|
|
87
|
+
const fn = createFunction(expression);
|
|
88
|
+
return fn();
|
|
89
|
+
}
|