🎉 initiate project *astro_rewrite*
This commit is contained in:
parent
ffd4d5e86c
commit
2ba37bfbe3
8658 changed files with 2268794 additions and 2538 deletions
27
node_modules/@mdx-js/mdx/lib/util/estree-util-create.js
generated
vendored
Normal file
27
node_modules/@mdx-js/mdx/lib/util/estree-util-create.js
generated
vendored
Normal file
|
|
@ -0,0 +1,27 @@
|
|||
/**
|
||||
* @typedef {import('estree-jsx').Node} Node
|
||||
*/
|
||||
|
||||
/**
|
||||
* @param {Node} from
|
||||
* Node to take from.
|
||||
* @param {Node} to
|
||||
* Node to add to.
|
||||
* @returns {void}
|
||||
* Nothing.
|
||||
*/
|
||||
export function create(from, to) {
|
||||
/** @type {Array<keyof Node>} */
|
||||
// @ts-expect-error: `start`, `end`, `comments` are custom Acorn fields.
|
||||
const fields = ['start', 'end', 'loc', 'range', 'comments']
|
||||
let index = -1
|
||||
|
||||
while (++index < fields.length) {
|
||||
const field = fields[index]
|
||||
|
||||
if (field in from) {
|
||||
// @ts-expect-error: assume they’re settable.
|
||||
to[field] = from[field]
|
||||
}
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue