(expression: string)
| 190 | private static isNumber(token: string): boolean { |
| 191 | return /^-?\d+(\.\d+)?$/.test(token); |
| 192 | } |
| 193 | |
| 194 | static calculate(expression: string): number { |
| 195 | const tokens = this.tokenize(expression); |
| 196 | const postfix = this.infixToPostfix(tokens); |
| 197 | return this.evaluatePostfix(postfix); |
| 198 | } |
| 199 | } |
no test coverage detected