@abaplint/transpiler
Version:
41 lines • 1.46 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.HandleDataElement = void 0;
const chunk_1 = require("../chunk");
const transpile_types_1 = require("../transpile_types");
class HandleDataElement {
runObject(obj, reg) {
const filename = obj.getXMLFile()?.getFilename().replace(".xml", ".mjs").toLowerCase();
if (filename === undefined) {
return [];
}
const type = obj.parseType(reg);
let fixedValues = undefined;
if (obj.getDomainName()) {
const doma = reg.getObject("DOMA", obj.getDomainName());
if (doma) {
fixedValues = doma.getFixedValues();
}
}
const chunk = new chunk_1.Chunk().appendString(`abap.DDIC["${obj.getName().toUpperCase()}"] = {
"objectType": "DTEL",
"type": ${transpile_types_1.TranspileTypes.toTypeFunction(type)},
"domain": ${JSON.stringify(obj.getDomainName())},
"fixedValues": ${JSON.stringify(fixedValues)},
"description": ${JSON.stringify(obj.getDescription())},
};`);
const output = {
object: {
name: obj.getName(),
type: obj.getType(),
},
filename: filename,
chunk: chunk,
requires: [],
exports: [],
};
return [output];
}
}
exports.HandleDataElement = HandleDataElement;
//# sourceMappingURL=handle_data_element.js.map