import { JDLEnum } from '../../models/index.js';
import { formatComment } from '../../utils/format-utils.js';
export default { convertEnums };
export function convertEnums(enumerations) {
    if (!enumerations) {
        throw new Error('Enumerations have to be passed so as to be converted.');
    }
    return enumerations.map(enumeration => convertEnum(enumeration));
}
function convertEnum(enumeration) {
    return new JDLEnum({
        name: enumeration.name,
        values: enumeration.values,
        comment: formatComment(enumeration.documentation),
    });
}
