Skip to content

Commit d09a735

Browse files
committed
Refactor code-style
* Add more docs to JSDoc
1 parent 6f688e1 commit d09a735

File tree

3 files changed

+12
-6
lines changed

3 files changed

+12
-6
lines changed

.github/workflows/main.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,4 +18,4 @@ jobs:
1818
matrix:
1919
node:
2020
- lts/fermium
21-
- node
21+
- node

index.js

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,19 @@
11
/**
2-
* @typedef {import('hast').Element & {tagName: 'article'|'aside'|'nav'|'section'}} Sectioning
3-
* @typedef {import('hast-util-is-element').AssertPredicate<Sectioning>} AssertSectioning
2+
* @typedef {import('hast').Element} Element
43
*/
54

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

87
/**
9-
* Check if a node is a sectioning element.
10-
* @type {AssertSectioning}
8+
* Check if a node is sectioning content.
9+
*
10+
* @type {import('hast-util-is-element').AssertPredicate<Element & {tagName: 'article' | 'aside' | 'nav' | 'section'}>}
11+
* @param value
12+
* Thing to check (typically `Node`).
13+
* @returns
14+
* Whether `value` is an element considered sectioning content.
15+
*
16+
* The elements `article`, `aside`, `nav`, and `section` are sectioning.
1117
*/
1218
// @ts-expect-error Sure, the assertion matches.
1319
export const sectioning = convertElement(['article', 'aside', 'nav', 'section'])

readme.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -218,6 +218,6 @@ abide by its terms.
218218

219219
[element]: https://github.com/syntax-tree/hast#element
220220

221-
[spec]: https://html.spec.whatwg.org/#sectioning-content
221+
[spec]: https://html.spec.whatwg.org/multipage/dom.html#sectioning-content
222222

223223
[xss]: https://en.wikipedia.org/wiki/Cross-site_scripting

0 commit comments

Comments
 (0)