Clean up dependencies
All checks were successful
Build and Push / build (push) Successful in 18s

This commit is contained in:
2026-02-16 15:12:59 -05:00
parent d181f77fb2
commit 2f15523a55
14941 changed files with 0 additions and 2078483 deletions

View File

@@ -1,49 +0,0 @@
/**
* @typedef {import('unist').Node} Node
* @typedef {import('nlcst').Paragraph} Paragraph
* @typedef {import('unist').Position} Position
* @typedef {import('nlcst').Root} Root
* @typedef {import('nlcst').Sentence} Sentence
*/
import {visitChildren} from 'unist-util-visit-children'
// Patch the position on a parent node based on its first and last child.
export const patchPosition = visitChildren(
/**
* @type {import('unist-util-visit-children').Visitor<Paragraph | Root | Sentence>}
*/
function (child, index, node) {
const siblings = node.children
if (
child.position &&
index < 1 &&
/* c8 ignore next */
(!node.position || !node.position.start)
) {
patch(node)
node.position.start = child.position.start
}
if (
child.position &&
index === siblings.length - 1 &&
(!node.position || !node.position.end)
) {
patch(node)
node.position.end = child.position.end
}
}
)
/**
* @param {Node} node
* @returns {asserts node is Node & {position: Position}}
*/
function patch(node) {
if (!node.position) {
// @ts-expect-error: fine, well fill it later.
node.position = {}
}
}