Skip to content

Commit 118db85

Browse files
chore: remove exist util function as it is not used
1 parent 55700b3 commit 118db85

File tree

2 files changed

+0
-19
lines changed

2 files changed

+0
-19
lines changed

src/utils/dom.js

-14
Original file line numberDiff line numberDiff line change
@@ -21,20 +21,6 @@ export function siblings (node) {
2121
return []
2222
}
2323

24-
/**
25-
* Checks if passed node exist and is a valid element.
26-
*
27-
* @param {Element} node
28-
* @return {Boolean}
29-
*/
30-
export function exist (node) {
31-
if (node && node instanceof window.HTMLElement) {
32-
return true
33-
}
34-
35-
return false
36-
}
37-
3824
/**
3925
* Coerces a NodeList to an Array.
4026
*

tests/unit/dom.test.js

-5
Original file line numberDiff line numberDiff line change
@@ -11,11 +11,6 @@ describe('Function', () => {
1111
`
1212
})
1313

14-
test('`exist` should check if passed HTMLElement is present', () => {
15-
expect(exist(document.querySelector('.parent'))).toBe(true)
16-
expect(exist(document.querySelector('.missing'))).toBe(false)
17-
})
18-
1914
test('`siblings` should return siblings of the passed HTMLElements', () => {
2015
let children = document.querySelectorAll('.child')
2116

0 commit comments

Comments
 (0)