import fs from'fs';
exportdefaultfunctionexportToJDL(jdl, path = 'app.jdl') {
if (!jdl) {
thrownewError('A JDLObject has to be passed to be exported.');
}
const fileContents = jdl.toString();
if (path) {
fs.writeFileSync(path, fileContents);
}
return fileContents;
}