Skip to content

Commit d0421b6

Browse files
committed
Update dev-dependencies
1 parent 80087a0 commit d0421b6

File tree

3 files changed

+7
-15
lines changed

3 files changed

+7
-15
lines changed

index.js

Lines changed: 3 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -50,21 +50,12 @@ export function excerpt(tree, options = {}) {
5050
}
5151

5252
if (
53-
// @ts-expect-error: integrate w/ `mdast-util-mdx`
5453
(node.type === 'mdxFlowExpression' ||
55-
// @ts-expect-error
5654
node.type === 'mdxTextExpression') &&
57-
// @ts-expect-error
5855
node.data &&
59-
// @ts-expect-error
6056
node.data.estree &&
61-
// @ts-expect-error
6257
node.data.estree.comments &&
63-
// @ts-expect-error
64-
node.data.estree.comments.some(
65-
(/** @type {import('acorn').Comment} */ node) =>
66-
node.value.trim() === comment
67-
)
58+
node.data.estree.comments.some((node) => node.value.trim() === comment)
6859
) {
6960
found = true
7061
return
@@ -79,7 +70,8 @@ export function excerpt(tree, options = {}) {
7970
let index = -1
8071

8172
while (++index < node.children.length && !found) {
82-
const result = preorder(node.children[index])
73+
const child = /** @type {Node} */ (node.children[index])
74+
const result = preorder(child)
8375
// @ts-expect-error: assume content model matches.
8476
if (result) children.push(result)
8577
}

package.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -43,8 +43,8 @@
4343
"hast-util-select": "^5.0.0",
4444
"hastscript": "^7.0.0",
4545
"mdast-util-from-markdown": "^1.0.0",
46-
"mdast-util-mdx": "^1.0.0",
47-
"mdast-util-to-hast": "^11.0.0",
46+
"mdast-util-mdx": "^2.0.0",
47+
"mdast-util-to-hast": "^12.0.0",
4848
"micromark-extension-mdxjs": "^1.0.0",
4949
"prettier": "^2.0.0",
5050
"remark-cli": "^10.0.0",
@@ -55,7 +55,7 @@
5555
"typescript": "^4.0.0",
5656
"unist-builder": "^3.0.0",
5757
"unist-util-remove-position": "^4.0.0",
58-
"xo": "^0.44.0"
58+
"xo": "^0.49.0"
5959
},
6060
"scripts": {
6161
"prepack": "npm run build && npm run format",

test.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ test('hastUtilExcerpt', (t) => {
9191
removePosition(
9292
fromMarkdown('Some text\n\n{/* more */}\n\nSome more text', {
9393
extensions: [mdxjs()],
94-
mdastExtensions: [mdxFromMarkdown]
94+
mdastExtensions: [mdxFromMarkdown()]
9595
})
9696
),
9797
{passThrough: ['mdxFlowExpression', 'mdxTextExpression', 'mdxjsEsm']}

0 commit comments

Comments
 (0)