From 118db85375a5c6da009b8d03fa2753edefdb8302 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C4=99drzej=20Cha=C5=82ubek?= Date: Thu, 4 Jul 2024 13:16:21 +0200 Subject: [PATCH] chore: remove exist util function as it is not used --- src/utils/dom.js | 14 -------------- tests/unit/dom.test.js | 5 ----- 2 files changed, 19 deletions(-) diff --git a/src/utils/dom.js b/src/utils/dom.js index 91289ccf..e9512111 100644 --- a/src/utils/dom.js +++ b/src/utils/dom.js @@ -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. * diff --git a/tests/unit/dom.test.js b/tests/unit/dom.test.js index 1029a65a..f31cd579 100644 --- a/tests/unit/dom.test.js +++ b/tests/unit/dom.test.js @@ -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')