import JDLObject from '../models/jdl-object.js';
import createJDLApplication from '../models/jdl-application-factory.js';
const GENERATOR_NAME = 'generator-begcode';
export function convertApplicationsToJDL({ applications, jdl } = {}) {
    const jsonApplications = applications || [];
    const jdlObject = jdl || new JDLObject();
    jsonApplications.forEach((application) => {
        const convertedApplication = convertApplicationToJDL({ application });
        jdlObject.addApplication(convertedApplication);
    });
    return jdlObject;
}
export function convertApplicationToJDL({ application } = {}) {
    return createJDLApplication(application[GENERATOR_NAME]);
}
