import { codeFromAST, addDecl } from "./utils"; import cantinflas from "cantinflas"; export default function astObject({ schemasAST, schemaTplFile, name, niceName }) { // SCHEMA const schemaImport = addDecl({ type: "import", ast: schemasAST, name }); const schemaNamedExport = addDecl({ type: "defaultExport", ast: schemaImport, name }); const schemaCode = codeFromAST(schemaNamedExport); const schemaTpl = cantinflas(schemaTplFile, { DISPLAY_NAME: niceName, NAME: name }); return { schemaCode, schemaTpl }; }