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

30
node_modules/@mdx-js/mdx/lib/plugin/rehype-recma.js generated vendored Normal file
View File

@@ -0,0 +1,30 @@
/**
* @typedef {import('estree-jsx').Program} Program
*
* @typedef {import('hast').Root} Root
*
* @typedef {import('../core.js').ProcessorOptions} ProcessorOptions
*/
import {toEstree} from 'hast-util-to-estree'
/**
* A plugin to transform an HTML (hast) tree to a JS (estree).
* `hast-util-to-estree` does all the work for us!
*
* @param {Readonly<ProcessorOptions>} options
* Configuration (optional).
* @returns
* Transform.
*/
export function rehypeRecma(options) {
/**
* @param {Root} tree
* Tree (hast).
* @returns {Program}
* Program (esast).
*/
return function (tree) {
return toEstree(tree, options)
}
}