UNPKG

generator-begcode

Version:

Spring Boot + Angular/React/Vue in one handy generator

20 lines (19 loc) 744 B
import JDLAigc from '../../models/jdl-aigc.js'; import { formatComment } from '../../utils/format-utils.js'; import { asJdlAigcType } from '../../jhipster/aigc-types.js'; export default { convertAigcs }; export function convertAigcs(aigcs) { if (!aigcs) { throw new Error('Relationships have to be passed so as to be converted.'); } return aigcs.map(aigc => { const relationshipConfiguration = { from: aigc.from.name, to: aigc.to[0].image, type: asJdlAigcType(aigc.cardinality), injectedFieldInFrom: aigc.from.injectedField, commentInFrom: formatComment(aigc.from.documentation), }; return new JDLAigc(relationshipConfiguration); }); }