UNPKG

@abaplint/transpiler

Version:
40 lines 1.4 kB
"use strict"; 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": ${new transpile_types_1.TranspileTypes().toType(type)}, "domain": ${JSON.stringify(obj.getDomainName())}, "fixedValues": ${JSON.stringify(fixedValues)}, };`); 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