Skip to content

Commit ebde05d

Browse files
committed
Refactor to move implementation to lib/
1 parent 7ede65f commit ebde05d

File tree

3 files changed

+21
-19
lines changed

3 files changed

+21
-19
lines changed

index.js

Lines changed: 1 addition & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1 @@
1-
/**
2-
* @typedef {import('hast').Element} Element
3-
*/
4-
5-
import {convertElement} from 'hast-util-is-element'
6-
7-
/**
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.
17-
*/
18-
// @ts-expect-error Sure, the assertion matches.
19-
export const sectioning = convertElement(['article', 'aside', 'nav', 'section'])
1+
export {sectioning} from './lib/index.js'

lib/index.js

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
/**
2+
* @typedef {import('hast').Element} Element
3+
*/
4+
5+
import {convertElement} from 'hast-util-is-element'
6+
7+
/**
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.
17+
*/
18+
// @ts-expect-error Sure, the assertion matches.
19+
export const sectioning = convertElement(['article', 'aside', 'nav', 'section'])

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@
2828
"main": "index.js",
2929
"types": "index.d.ts",
3030
"files": [
31+
"lib/",
3132
"index.d.ts",
3233
"index.js"
3334
],

0 commit comments

Comments
 (0)