xpath-ts2
Version:
DOM 3 and 4 XPath 1.0 implementation for browser and Node.js environment with support for typescript 5.
16 lines (12 loc) • 306 B
text/typescript
import { Step } from './step';
export class LocationPath {
absolute: boolean;
steps: Step[];
constructor(abs: boolean, steps: Step[]) {
this.absolute = abs;
this.steps = steps;
}
toString() {
return (this.absolute ? '/' : '') + this.steps.map((s) => s.toString()).join('/');
}
}