You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
-**Function arguments arrays**: Some contexts require `any[]` for dynamic argument handling
42
+
-**Value escaping**: `escapeValue(v: any)` needs to handle any value for string conversion
43
+
44
+
### Technical Constraints
45
+
- Functions in `functions-binary-ops.ts` and `functions-unary-ops.ts` use `any` parameters to handle the complex type coercion logic required by the expression evaluator
46
+
47
+
## Benefits Achieved
48
+
49
+
### 1. Enhanced Type Safety
50
+
- Method return types now properly reflect that expressions can return any `Value` type
51
+
- Variable storage and evaluation use proper typing
52
+
- Promise support is now properly typed for async operations
53
+
54
+
### 2. Better Developer Experience
55
+
- IDE autocomplete and IntelliSense now provide accurate type information
56
+
- Type errors are caught at compile time instead of runtime
57
+
- Clear distinction between synchronous and asynchronous evaluation
58
+
59
+
### 3. API Clarity
60
+
- Clear typing shows which operations can be asynchronous
61
+
- Better documentation through types of what values expressions can contain
62
+
- Proper typing of configuration objects and options
63
+
64
+
## Testing
65
+
- ✅ All existing tests continue to pass (41/41 tests in expression-core-partial)
66
+
- ✅ Build process completes successfully with TypeScript compilation
67
+
- ✅ Bundle sizes remain within configured limits
68
+
- ✅ No breaking changes to public API
69
+
70
+
## Impact
71
+
This improvement enhances the overall code quality and maintainability while preserving backward compatibility. The type system now better reflects the actual runtime behavior of the expression evaluator, making it easier for developers to use the library correctly and catch potential issues during development.
constf=newFunction(param,'with(this.functions) with (this.ternaryOps) with (this.binaryOps) with (this.unaryOps) { return '+expressionToString(this.simplify(variables).tokens,true)+'; }');
0 commit comments