import { YfmHeadingAttr } from "../const.js";
export { hasParentHeading, headingRule } from "../../../markdown/Heading/utils.js";
export { headingType } from "../../../markdown/Heading/HeadingSpecs/index.js";
// const slug = require('slugify');
export const getNodeAttrs = (level) => (node) => ({
    [YfmHeadingAttr.Level]: level,
    [YfmHeadingAttr.Id]: node.getAttribute('id') || '',
    [YfmHeadingAttr.Folding]: getFoldingAttr(node),
});
function getFoldingAttr(node) {
    const value = node.getAttribute(`data-${YfmHeadingAttr.Folding}`);
    if (value === 'true')
        return true;
    if (value === 'false')
        return false;
    return null;
}
// export const slugify = (str: string) =>
//     // same config as in yfm-transform
//     // https://github.com/yandex-cloud/yfm-transform/blob/master/lib/plugins/anchors/index.js#L97-L100
//     slug(str, {
//         lower: true,
//         remove: /[*+~.()'"!:@]/g,
//     });
//# sourceMappingURL=utils.js.map
