import JDLObject from '../models/jdl-object.js';
import JDLUnaryOption from '../models/jdl-unary-option.js';
import { unaryOptions } from '../jhipster/index.mjs';
const { SKIP_CLIENT, SKIP_SERVER } = unaryOptions;
export default {
    convertServerOptionsToJDL,
};
export function convertServerOptionsToJDL(config, jdl) {
    const jdlObject = jdl || new JDLObject();
    const jhipsterConfig = config || {};
    [SKIP_CLIENT, SKIP_SERVER].forEach(option => {
        if (jhipsterConfig[option] === true) {
            jdlObject.addOption(new JDLUnaryOption({
                name: option,
                value: jhipsterConfig[option],
            }));
        }
    });
    return jdlObject;
}
