ifc-expressions
Version:
Parsing and evaluation of IFC expressions
42 lines (41 loc) • 1.1 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.ArrayValue = void 0;
const Types_js_1 = require("../type/Types.js");
class ArrayValue {
constructor(value) {
this.arrayValue = value;
}
static of(value) {
return new ArrayValue(value);
}
getValue() {
return this.arrayValue;
}
getType() {
return Types_js_1.Type.ARRAY;
}
equals(other) {
return (ArrayValue.isArrayValueType(other) &&
other.arrayValue.every((val, ind) => val.equals(this.arrayValue[ind])));
}
toString() {
return ("[" +
this.arrayValue
.map((e) => {
if (typeof e["toString"] === "function") {
return e.toString();
}
else {
return "" + e;
}
})
.join(", ") +
"]");
}
static isArrayValueType(arg) {
return Array.isArray(arg.arrayValue);
}
}
exports.ArrayValue = ArrayValue;
//# sourceMappingURL=ArrayValue.js.map