This commit is contained in:
2024-03-22 03:47:51 +05:30
parent 8bcf3d211e
commit 89819f6fe2
28440 changed files with 3211033 additions and 2 deletions

View File

@@ -0,0 +1,28 @@
/**
* @typedef {import('mdast-util-mdxjs-esm').MdxjsEsmHast} MdxjsEsm
*
* @typedef {import('../state.js').State} State
*/
import {attachComments} from 'estree-util-attach-comments'
/**
* Handle an MDX ESM node.
*
* @param {MdxjsEsm} node
* hast node to transform.
* @param {State} state
* Info passed around about the current state.
* @returns {undefined}
* Nothing.
*/
export function mdxjsEsm(node, state) {
const estree = node.data && node.data.estree
const comments = (estree && estree.comments) || []
if (estree) {
state.comments.push(...comments)
attachComments(estree, comments)
state.esm.push(...estree.body)
}
}