Skip to content

Commit 651ce97

Browse files
committed
Update zwitch
1 parent c47743b commit 651ce97

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

lib/index.js

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -41,9 +41,7 @@ export function toMarkdown(tree, options = {}) {
4141
/** @type {Handle} */
4242
context.handle = zwitch('type', {
4343
invalid,
44-
// @ts-expect-error: hush.
4544
unknown,
46-
// @ts-expect-error: hush.
4745
handlers: context.handlers
4846
})
4947

@@ -78,16 +76,19 @@ export function toMarkdown(tree, options = {}) {
7876
/**
7977
* @type {Handle}
8078
* @param {unknown} value
79+
* @returns {never}
8180
*/
8281
function invalid(value) {
8382
throw new Error('Cannot handle value `' + value + '`, expected node')
8483
}
8584

8685
/**
8786
* @type {Handle}
88-
* @param {Node} node
87+
* @param {unknown} node
88+
* @returns {never}
8989
*/
9090
function unknown(node) {
91+
// @ts-expect-error: fine.
9192
throw new Error('Cannot handle unknown node `' + node.type + '`')
9293
}
9394

0 commit comments

Comments
 (0)