Skip to content

Commit 2208b4b

Browse files
committed
Refactor code-style
* Add more docs to JSDoc
1 parent 8cba127 commit 2208b4b

File tree

1 file changed

+10
-2
lines changed

1 file changed

+10
-2
lines changed

index.js

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,21 @@
11
/**
2-
* @typedef {import('hast').Element & {tagName: 'script'|'template'}} ScriptOrTemplate
3-
* @typedef {import('hast-util-is-element').AssertPredicate<ScriptOrTemplate>} AssertScriptOrTemplate
2+
* @typedef {import('hast').Element} Element
3+
*/
4+
5+
/**
6+
* @typedef {import('hast-util-is-element').AssertPredicate<Element & {tagName: 'script' | 'template'}>} AssertScriptOrTemplate
47
*/
58

69
import {convertElement} from 'hast-util-is-element'
710

811
/**
912
* Check if a node is a script-supporting element.
13+
*
1014
* @type {AssertScriptOrTemplate}
15+
* @param value
16+
* Thing to check (typically `Node`).
17+
* @returns
18+
* Whether `value` is a script-supporting element.
1119
*/
1220
// @ts-expect-error Sure, the assertion matches.
1321
export const scriptSupporting = convertElement(['script', 'template'])

0 commit comments

Comments
 (0)