import fs from 'fs';
export default function exportToJDL(jdl, path = 'app.jdl') {
    if (!jdl) {
        throw new Error('A JDLObject has to be passed to be exported.');
    }
    const fileContents = jdl.toString();
    if (path) {
        fs.writeFileSync(path, fileContents);
    }
    return fileContents;
}
