Skip to content

Commit 494bcb1

Browse files
committed
Refactor code-style
* Add more docs to JSDoc
1 parent 797fc83 commit 494bcb1

File tree

2 files changed

+12
-5
lines changed

2 files changed

+12
-5
lines changed

index.js

+11-4
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,20 @@
11
/**
2-
* @typedef {import('hast').Element & {tagName: 'audio'|'canvas'|'embed'|'iframe'|'img'|'math'|'object'|'picture'|'svg'|'video'}} Embedded
3-
* @typedef {import('hast-util-is-element').AssertPredicate<Embedded>} AssertEmbedded
2+
* @typedef {import('hast').Element} Element
43
*/
54

65
import {convertElement} from 'hast-util-is-element'
76

87
/**
9-
* Check if a node is an embedded element.
10-
* @type {AssertEmbedded}
8+
* Check if a node is a embedded content.
9+
*
10+
* @type {import('hast-util-is-element').AssertPredicate<Element & {tagName: 'audio' | 'canvas' | 'embed' | 'iframe' | 'img' | 'math' | 'object' | 'picture' | 'svg' | 'video'}>}
11+
* @param value
12+
* Thing to check (typically `Node`).
13+
* @returns
14+
* Whether `value` is an element considered embedded content.
15+
*
16+
* The elements `audio`, `canvas`, `embed`, `iframe`, `img`, `math`,
17+
* `object`, `picture`, `svg`, and `video` are embedded content.
1118
*/
1219
// @ts-expect-error Sure, the assertion matches.
1320
export const embedded = convertElement([

readme.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -209,7 +209,7 @@ abide by its terms.
209209

210210
[coc]: https://github.com/syntax-tree/.github/blob/main/code-of-conduct.md
211211

212-
[spec]: https://html.spec.whatwg.org/#embedded-content-2
212+
[spec]: https://html.spec.whatwg.org/multipage/dom.html#embedded-content-2
213213

214214
[hast]: https://github.com/syntax-tree/hast
215215

0 commit comments

Comments
 (0)