Skip to content

Commit 02f3792

Browse files
committed
Update @types/mdast, mdast utilities
1 parent 63773b7 commit 02f3792

File tree

3 files changed

+13
-15
lines changed

3 files changed

+13
-15
lines changed

lib/index.js

+6-8
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,11 @@
11
/**
2-
* @typedef {import('mdast').Root} Root
3-
* @typedef {import('mdast').Content} Content
4-
* @typedef {import('mdast').HTML} HTML
5-
* @typedef {import('mdast-util-mdx-expression').MDXFlowExpression} MDXFlowExpression
6-
* @typedef {import('mdast-util-mdx-expression').MDXTextExpression} MDXTextExpression
2+
* @typedef {import('mdast').Html} Html
3+
* @typedef {import('mdast').Nodes} Nodes
4+
* @typedef {import('mdast-util-mdx-expression').MdxFlowExpression} MdxFlowExpression
5+
* @typedef {import('mdast-util-mdx-expression').MdxTextExpression} MdxTextExpression
76
*/
87

98
/**
10-
* @typedef {Root | Content} Node
119
*
1210
* @typedef Mdx1CommentNode
1311
* @property {'comment'} type
@@ -31,7 +29,7 @@
3129
* Value after name.
3230
* @property {MarkerParameters} parameters
3331
* Parsed attributes.
34-
* @property {HTML | Mdx1CommentNode | MDXFlowExpression | MDXTextExpression} node
32+
* @property {Html | Mdx1CommentNode | MdxFlowExpression | MdxTextExpression} node
3533
* Reference to given node.
3634
*/
3735

@@ -152,7 +150,7 @@ function parseParameters(value) {
152150
*
153151
* @param {unknown} value
154152
* Thing.
155-
* @returns {value is Node}
153+
* @returns {value is Nodes}
156154
* It’s a node!
157155
*/
158156
function isNode(value) {

package.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,8 @@
3333
"index.js"
3434
],
3535
"dependencies": {
36-
"@types/mdast": "^3.0.0",
37-
"mdast-util-mdx-expression": "^1.1.0"
36+
"@types/mdast": "^4.0.0",
37+
"mdast-util-mdx-expression": "^2.0.0"
3838
},
3939
"devDependencies": {
4040
"@types/node": "^20.0.0",

test.js

+5-5
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
/**
22
* @typedef {import('mdast').Literal} Literal
33
* @typedef {import('mdast').Paragraph} Paragraph
4-
* @typedef {import('mdast').HTML} HTML
5-
* @typedef {import('mdast-util-mdx-expression').MDXFlowExpression} MDXFlowExpression
6-
* @typedef {import('mdast-util-mdx-expression').MDXTextExpression} MDXTextExpression
4+
* @typedef {import('mdast').Html} Html
5+
* @typedef {import('mdast-util-mdx-expression').MdxFlowExpression} MdxFlowExpression
6+
* @typedef {import('mdast-util-mdx-expression').MdxTextExpression} MdxTextExpression
77
*/
88

99
import assert from 'node:assert/strict'
@@ -26,7 +26,7 @@ test('commentMaker', () => {
2626

2727
assert.equal(commentMarker(paragraph), null, 'should work without html node')
2828

29-
/** @type {HTML} */
29+
/** @type {Html} */
3030
let html = {type: 'html', value: '<div></div>'}
3131

3232
assert.equal(commentMarker(html), null, 'should work without comment')
@@ -326,7 +326,7 @@ test('comment node', () => {
326326
})
327327

328328
test('MDX@2 expressions', () => {
329-
/** @type {MDXFlowExpression|MDXTextExpression} */
329+
/** @type {MdxFlowExpression | MdxTextExpression} */
330330
let node = {
331331
type: 'mdxFlowExpression',
332332
value: '/* lint disable heading-style */'

0 commit comments

Comments
 (0)