import path from 'path';
import { readFileSync } from 'fs';
import JDLObject from '../core/models/jdl-object.js';
import { convertEntitiesToJDL } from './ndm-to-jdl-entity-converter.js';
export default {
    convertNdmToJDL,
};
export function convertNdmToJDL(directory = '.', ndmFile = 'ndm.ndm2', output = 'ndm.jdl') {
    return getJDLObjectFromSingleApplication(path.join(directory, ndmFile));
}
function getJDLObjectFromSingleApplication(ndmFile, existingJDLObject = new JDLObject()) {
    const ndmFileContent = JSON.parse(readFileSync(path.join(ndmFile), 'utf-8').toString());
    return convertEntitiesToJDL(ndmFileContent);
}
