Skip to content

Commit 0927092

Browse files
committed
Update @types/mdast
1 parent 43f601a commit 0927092

File tree

3 files changed

+26
-23
lines changed

3 files changed

+26
-23
lines changed

lib/index.js

Lines changed: 22 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -2,33 +2,34 @@
22
* @typedef {import('mdast').PhrasingContent} PhrasingContent
33
*/
44

5-
/**
6-
* @typedef {import('unist-util-is').AssertPredicate<PhrasingContent>} AssertPredicatePhrasing
7-
*/
8-
95
import {convert} from 'unist-util-is'
106

117
/**
128
* Check if the given value is *phrasing content*.
139
*
14-
* @param
10+
* > 👉 **Note**: Excludes `html`, which can be both phrasing or flow.
11+
*
12+
* @param node
1513
* Thing to check, typically `Node`.
1614
* @returns
1715
* Whether `value` is phrasing content.
1816
*/
19-
export const phrasing = /** @type {AssertPredicatePhrasing} */ (
20-
convert([
21-
'break',
22-
'delete',
23-
'emphasis',
24-
'footnote',
25-
'footnoteReference',
26-
'image',
27-
'imageReference',
28-
'inlineCode',
29-
'link',
30-
'linkReference',
31-
'strong',
32-
'text'
33-
])
34-
)
17+
18+
export const phrasing =
19+
/** @type {(node?: unknown) => node is PhrasingContent} */
20+
(
21+
convert([
22+
'break',
23+
'delete',
24+
'emphasis',
25+
'footnote',
26+
'footnoteReference',
27+
'image',
28+
'imageReference',
29+
'inlineCode',
30+
'link',
31+
'linkReference',
32+
'strong',
33+
'text'
34+
])
35+
)

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,8 +32,8 @@
3232
"index.js"
3333
],
3434
"dependencies": {
35-
"@types/mdast": "^3.0.0",
36-
"unist-util-is": "^5.0.0"
35+
"@types/mdast": "^4.0.0",
36+
"unist-util-is": "^6.0.0"
3737
},
3838
"devDependencies": {
3939
"@types/node": "^20.0.0",

readme.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,8 @@ There is no default export.
8282

8383
Check if the given value is *[phrasing content][phrasing]*.
8484

85+
> 👉 **Note**: Excludes `html`, which can be both phrasing or flow.
86+
8587
###### Parameters
8688

8789
* `value` (`unknown`)

0 commit comments

Comments
 (0)