'use strict'; const { detachNodeFromParent } = require('../lib/xast.js'); exports.name = 'removeComments'; exports.description = 'removes comments'; /** * Remove comments. * * @example * * * @author Kir Belevich * * @type {import('./plugins-types').Plugin<'removeComments'>} */ exports.fn = () => { return { comment: { enter: (node, parentNode) => { if (node.value.charAt(0) !== '!') { detachNodeFromParent(node, parentNode); } }, }, }; };