Skip to content

Commit 3a2a7af

Browse files
committed
Update @types/nlcst, utilities
1 parent 293e092 commit 3a2a7af

File tree

2 files changed

+8
-12
lines changed

2 files changed

+8
-12
lines changed

lib/index.js

+5-9
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,9 @@
33
* @typedef {import('unist').Parent} UnistParent
44
* @typedef {import('unist-util-assert').AssertionError} AssertionError
55
*
6+
* @typedef {import('nlcst').Nodes} Nodes
7+
* @typedef {import('nlcst').Parents} Parents
68
* @typedef {import('nlcst').Root} Root
7-
* @typedef {import('nlcst').Content} Content
8-
*/
9-
10-
/**
11-
* @typedef {Root | Content} Node
12-
* @typedef {Extract<Node, UnistParent>} Parent
139
*/
1410

1511
import nodeAssert from 'node:assert'
@@ -33,7 +29,7 @@ import {
3329
* Thing to assert.
3430
* @param {UnistParent | null | undefined} [parent]
3531
* Optional, valid parent.
36-
* @returns {asserts tree is Node}
32+
* @returns {asserts tree is Nodes}
3733
* Nothing.
3834
* @throws {AssertionError}
3935
* When `tree` (or its descendants) is not a nlcst node.
@@ -53,7 +49,7 @@ export function assert(tree, parent) {
5349
* Thing to assert.
5450
* @param {UnistParent | null | undefined} [parent]
5551
* Optional, valid parent.
56-
* @returns {asserts tree is Parent}
52+
* @returns {asserts tree is Parents}
5753
* Nothing.
5854
* @throws {AssertionError}
5955
* When `tree` is not a parent or its descendants are not nodes.
@@ -107,7 +103,7 @@ function unknown(node, parent) {
107103
*
108104
* @param {unknown} [tree]
109105
* Thing to assert.
110-
* @returns {asserts tree is Parent}
106+
* @returns {asserts tree is Parents}
111107
* Nothing.
112108
* @throws {AssertionError}
113109
* When `tree` is not a parent or its descendants are not nodes.

package.json

+3-3
Original file line numberDiff line numberDiff line change
@@ -33,10 +33,10 @@
3333
"index.js"
3434
],
3535
"dependencies": {
36-
"@types/nlcst": "^1.0.0",
37-
"@types/unist": "^2.0.0",
36+
"@types/nlcst": "^2.0.0",
37+
"@types/unist": "^3.0.0",
3838
"mapz": "^2.0.0",
39-
"unist-util-assert": "^3.0.0",
39+
"unist-util-assert": "^4.0.0",
4040
"zwitch": "^2.0.0"
4141
},
4242
"devDependencies": {

0 commit comments

Comments
 (0)