Skip to content

Commit

Permalink
chore: remove exist util function as it is not used
Browse files Browse the repository at this point in the history
  • Loading branch information
jedrzejchalubek committed Jul 4, 2024
1 parent 55700b3 commit 118db85
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 19 deletions.
14 changes: 0 additions & 14 deletions src/utils/dom.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,20 +21,6 @@ export function siblings (node) {
return []
}

/**
* Checks if passed node exist and is a valid element.
*
* @param {Element} node
* @return {Boolean}
*/
export function exist (node) {
if (node && node instanceof window.HTMLElement) {
return true
}

return false
}

/**
* Coerces a NodeList to an Array.
*
Expand Down
5 changes: 0 additions & 5 deletions tests/unit/dom.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,6 @@ describe('Function', () => {
`
})

test('`exist` should check if passed HTMLElement is present', () => {
expect(exist(document.querySelector('.parent'))).toBe(true)
expect(exist(document.querySelector('.missing'))).toBe(false)
})

test('`siblings` should return siblings of the passed HTMLElements', () => {
let children = document.querySelectorAll('.child')

Expand Down

0 comments on commit 118db85

Please sign in to comment.