* Replace symbols within expr. with canonical variants, *recursively*. * * @param expr * @returns
(expr: Expression)
| 320 | |
| 321 | // |
| 322 | // Negate |
| 323 | // |
| 324 | // Distribute over literals |
| 325 | // |
| 326 | if (name === 'Negate' && ops.length === 1) { |
| 327 | const op1 = ops[0]!; |
| 328 | if (isNumber(op1)) { |
| 329 | const { numericValue } = op1; |
| 330 | if (numericValue !== undefined) |
| 331 | return ce.number( |
| 332 | typeof numericValue === 'number' ? -numericValue : numericValue.neg() |
no test coverage detected