UNPKG

@qudtlib/core

Version:

Data model for QUDTLib

35 lines (34 loc) 1.08 kB
import { arrayEqualsIgnoreOrdering, compareUsingEquals, getLastIriElement, } from "./utils.js"; export class Prefix { constructor(iri, multiplier, symbol, ucumCode, labels) { this.iri = iri; this.multiplier = multiplier; this.symbol = symbol; this.ucumCode = ucumCode; if (typeof labels === "undefined") { this.labels = []; } else { this.labels = labels; } } equals(other) { return (!!other && this.iri === other.iri && this.multiplier.equals(other.multiplier) && this.symbol === other.symbol && this.ucumCode === other.ucumCode && this.labels.length == other.labels.length && arrayEqualsIgnoreOrdering(this.labels, other.labels, compareUsingEquals)); } toString() { if (this.symbol) { return this.symbol; } return "prefix:" + getLastIriElement(this.iri); } addLabel(label) { this.labels.push(label); } } //# sourceMappingURL=prefix.js.map