UNPKG

@lcap/nasl

Version:

NetEase Application Specific Language

25 lines 1.1 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.transform2Structure = void 0; const utils_1 = require("./utils"); const transform2TypeAnnotation_1 = require("./transform2TypeAnnotation"); function transform2Structure(node) { const structure = new utils_1.naslTypes.Structure(); structure.name = node.id.name; structure.description = (0, utils_1.fetchFromComments)(node.leadingComments); node.body.body.forEach((node) => { if (node.type === 'ClassProperty') { structure.properties.push(transform2StructureProperty(node)); } }); return structure; } exports.transform2Structure = transform2Structure; function transform2StructureProperty(node) { const property = new utils_1.naslTypes.StructureProperty(); property.name = node.key.name; property.label = (0, utils_1.fetchFromComments)(node.leadingComments); property.typeAnnotation = (0, transform2TypeAnnotation_1.transform2TypeAnnotation)(node.typeAnnotation.typeAnnotation); return property; } //# sourceMappingURL=transform2Structure.js.map