Skip to content

Commit

Permalink
findAllDOMElements to ts
Browse files Browse the repository at this point in the history
  • Loading branch information
arturi committed Sep 27, 2023
1 parent 3996dc7 commit 2c51ed5
Showing 1 changed file with 1 addition and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,8 @@ import isDOMElement from './isDOMElement.ts'

/**
* Find one or more DOM elements.
*
* @param {string|Node} element
* @returns {Node[]|null}
*/
export default function findAllDOMElements (element) {
export default function findAllDOMElements (element: string | Node): Node[] | null {
if (typeof element === 'string') {
const elements = document.querySelectorAll(element)
return elements.length === 0 ? null : Array.from(elements)
Expand Down

0 comments on commit 2c51ed5

Please sign in to comment.