@qudtlib/core
Version:
Data model for QUDTLib
39 lines (38 loc) • 1.19 kB
JavaScript
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.Prefix = void 0;
const utils_js_1 = require("./utils.js");
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 &&
(0, utils_js_1.arrayEqualsIgnoreOrdering)(this.labels, other.labels, utils_js_1.compareUsingEquals));
}
toString() {
if (this.symbol) {
return this.symbol;
}
return "prefix:" + (0, utils_js_1.getLastIriElement)(this.iri);
}
addLabel(label) {
this.labels.push(label);
}
}
exports.Prefix = Prefix;
//# sourceMappingURL=prefix.js.map