File tree 3 files changed +26
-23
lines changed 3 files changed +26
-23
lines changed Original file line number Diff line number Diff line change 2
2
* @typedef {import('mdast').PhrasingContent } PhrasingContent
3
3
*/
4
4
5
- /**
6
- * @typedef {import('unist-util-is').AssertPredicate<PhrasingContent> } AssertPredicatePhrasing
7
- */
8
-
9
5
import { convert } from 'unist-util-is'
10
6
11
7
/**
12
8
* Check if the given value is *phrasing content*.
13
9
*
14
- * @param
10
+ * > 👉 **Note**: Excludes `html`, which can be both phrasing or flow.
11
+ *
12
+ * @param node
15
13
* Thing to check, typically `Node`.
16
14
* @returns
17
15
* Whether `value` is phrasing content.
18
16
*/
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
+ )
Original file line number Diff line number Diff line change 32
32
" index.js"
33
33
],
34
34
"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"
37
37
},
38
38
"devDependencies" : {
39
39
"@types/node" : " ^20.0.0" ,
Original file line number Diff line number Diff line change @@ -82,6 +82,8 @@ There is no default export.
82
82
83
83
Check if the given value is * [ phrasing content] [ phrasing ] * .
84
84
85
+ > 👉 ** Note** : Excludes ` html ` , which can be both phrasing or flow.
86
+
85
87
###### Parameters
86
88
87
89
* ` value ` (` unknown ` )
You can’t perform that action at this time.
0 commit comments