UNPKG

xpath-ts2

Version:

DOM 3 and 4 XPath 1.0 implementation for browser and Node.js environment with support for typescript 5.

13 lines (10 loc) 301 B
import { XPathContext } from '../xpath-types'; import { UnaryOperation } from './unary-operation'; export class UnaryMinusOperation extends UnaryOperation { evaluate(c: XPathContext) { return this.rhs.evaluate(c).number.negate(); } toString() { return '-' + this.rhs.toString(); } }