Skip to content

Commit

Permalink
Update @types/hast, utilities
Browse files Browse the repository at this point in the history
  • Loading branch information
wooorm committed Aug 1, 2023
1 parent 6e5522a commit 1f19951
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 12 deletions.
10 changes: 0 additions & 10 deletions lib/index.js
Original file line number Diff line number Diff line change
@@ -1,23 +1,13 @@
/**
* @typedef {import('hast').Element} Element
*/

/**
* @typedef {import('hast-util-is-element').AssertPredicate<Element & {tagName: 'script' | 'template'}>} AssertScriptOrTemplate
*/

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

/**
* Check if a node is a script-supporting element.
*
* @type {AssertScriptOrTemplate}
* @param value
* Thing to check (typically `Node`).
* @returns
* Whether `value` is a script-supporting element.
*
* The elements `script` and `template` are script-supporting.
*/
// @ts-expect-error Sure, the assertion matches.
export const scriptSupporting = convertElement(['script', 'template'])
3 changes: 1 addition & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,7 @@
"index.js"
],
"dependencies": {
"@types/hast": "^2.0.0",
"hast-util-is-element": "^2.0.0"
"hast-util-is-element": "^3.0.0"
},
"devDependencies": {
"@types/node": "^20.0.0",
Expand Down

0 comments on commit 1f19951

Please sign in to comment.