Skip to content

Commit ae6c215

Browse files
committed
Update @types/mdast
1 parent a5ac22a commit ae6c215

File tree

3 files changed

+11
-16
lines changed

3 files changed

+11
-16
lines changed

lib/index.js

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,6 @@
11
/**
2-
* @typedef {import('mdast').Content} Content
2+
* @typedef {import('mdast').Nodes} Nodes
33
* @typedef {import('mdast').Heading} Heading
4-
* @typedef {import('mdast').Root} Root
5-
*/
6-
7-
// To do: when `mdast` is released, use `Nodes`.
8-
/**
9-
* @typedef {Content | Root} Node
104
*/
115

126
import {visit} from 'unist-util-visit'
@@ -17,7 +11,7 @@ const max = 6
1711
* Make sure that there is only one top-level heading in the document by
1812
* adjusting headings depths accordingly.
1913
*
20-
* @param {Node} tree
14+
* @param {Nodes} tree
2115
* Tree to change.
2216
* @returns {undefined}
2317
* Nothing.

package.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -37,20 +37,20 @@
3737
"index.js"
3838
],
3939
"dependencies": {
40-
"@types/mdast": "^3.0.0",
41-
"unist-util-visit": "^4.0.0"
40+
"@types/mdast": "^4.0.0",
41+
"unist-util-visit": "^5.0.0"
4242
},
4343
"devDependencies": {
4444
"@types/node": "^20.0.0",
4545
"c8": "^8.0.0",
46-
"mdast-util-from-markdown": "^1.2.0",
46+
"mdast-util-from-markdown": "^1.0.0",
4747
"prettier": "^2.0.0",
4848
"remark": "^14.0.0",
4949
"remark-cli": "^11.0.0",
5050
"remark-preset-wooorm": "^9.0.0",
5151
"type-coverage": "^2.0.0",
5252
"typescript": "^5.0.0",
53-
"unist-util-remove-position": "^4.0.0",
53+
"unist-util-remove-position": "^5.0.0",
5454
"xo": "^0.54.0"
5555
},
5656
"scripts": {

test/index.js

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -35,12 +35,13 @@ test('normalizeHeadings', async function (t) {
3535
const output = await fs.readFile(
3636
new URL('fixture/' + name + '.out', import.meta.url)
3737
)
38-
const actual = fromMarkdown(input)
39-
const expected = fromMarkdown(output)
38+
// To do: remove casts when `mdast-util-from-markdown` is released.
39+
const actual = /** @type {Root} */ (fromMarkdown(input))
40+
const expected = /** @type {Root} */ (fromMarkdown(output))
4041

4142
normalizeHeadings(actual)
42-
removePosition(actual, true)
43-
removePosition(expected, true)
43+
removePosition(actual, {force: true})
44+
removePosition(expected, {force: true})
4445

4546
assert.deepEqual(actual, expected)
4647
})

0 commit comments

Comments
 (0)