@abaplint/core
Version:
abaplint - Core API
55 lines • 2.21 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.NumberRange = void 0;
const _abstract_object_1 = require("./_abstract_object");
class NumberRange extends _abstract_object_1.AbstractObject {
getType() {
return "NROB";
}
getAllowedNaming() {
return {
maxLength: 10,
allowNamespace: true,
};
}
getDomain() {
var _a;
this.parse();
return (_a = this.parsedXML) === null || _a === void 0 ? void 0 : _a.domain;
}
getPercentage() {
var _a;
this.parse();
return (_a = this.parsedXML) === null || _a === void 0 ? void 0 : _a.percentage;
}
setDirty() {
this.parsedXML = undefined;
super.setDirty();
}
parse() {
var _a, _b, _c, _d, _e, _f;
if (this.parsedXML) {
return { updated: false, runtime: 0 };
}
const start = Date.now();
this.parsedXML = {};
const parsed = super.parseRaw2();
if (parsed === undefined) {
return { updated: false, runtime: 0 };
}
const text = (_c = (_b = (_a = parsed.abapGit) === null || _a === void 0 ? void 0 : _a["asx:abap"]) === null || _b === void 0 ? void 0 : _b["asx:values"]) === null || _c === void 0 ? void 0 : _c.TEXT;
this.parsedXML.description = text === null || text === void 0 ? void 0 : text.TXT;
const attributes = (_f = (_e = (_d = parsed.abapGit) === null || _d === void 0 ? void 0 : _d["asx:abap"]) === null || _e === void 0 ? void 0 : _e["asx:values"]) === null || _f === void 0 ? void 0 : _f.ATTRIBUTES;
this.parsedXML.domain = attributes === null || attributes === void 0 ? void 0 : attributes.DOMLEN;
this.parsedXML.percentage = parseFloat((attributes === null || attributes === void 0 ? void 0 : attributes.PERCENTAGE) || "");
const end = Date.now();
return { updated: true, runtime: end - start };
}
getDescription() {
var _a;
this.parse();
return (_a = this.parsedXML) === null || _a === void 0 ? void 0 : _a.description;
}
}
exports.NumberRange = NumberRange;
//# sourceMappingURL=number_range.js.map