From 8f6784a0ab99be7b1c5e8aad2bfb78c42306fa15 Mon Sep 17 00:00:00 2001 From: Alex Iglesias Date: Sun, 25 Apr 2021 19:59:32 +0200 Subject: [PATCH] Revert "Added removeChildElements helper" This reverts commit f2c5755d6e732915d82d75044001c66a565863d0. --- helpers/index.ts | 1 - helpers/removeChildElements.ts | 11 ----------- package.json | 2 +- 3 files changed, 1 insertion(+), 13 deletions(-) delete mode 100644 helpers/removeChildElements.ts diff --git a/helpers/index.ts b/helpers/index.ts index 099bd28..9888c8e 100644 --- a/helpers/index.ts +++ b/helpers/index.ts @@ -6,7 +6,6 @@ export { default as wait } from './wait'; export { default as throwError } from './throwError'; export { default as selectInputElement } from './selectInputElement'; export { default as queryElement } from './queryElement'; -export { default as removeChildElements } from './removeChildElements'; export { default as isVisible } from './isVisible'; export { default as isScrollable } from './isScrollable'; export { default as getObjectKeys } from './getObjectKeys'; diff --git a/helpers/removeChildElements.ts b/helpers/removeChildElements.ts deleted file mode 100644 index b4110d0..0000000 --- a/helpers/removeChildElements.ts +++ /dev/null @@ -1,11 +0,0 @@ -/** - * Remove all child elements from a parent element - * @param element Parent element - * @param selector Optional: only remove the elements that match this selector - */ -const removeChildElements = (element: Element, selector?: string): void => { - const childElements = element.querySelectorAll(selector || '*'); - childElements.forEach((childElement) => childElement.remove()); -}; - -export default removeChildElements; diff --git a/package.json b/package.json index e8f204e..8694c13 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@finsweet/ts-utils", - "version": "0.2.0", + "version": "0.1.1", "description": "Typescript utils for custom Webflow projects.", "main": "index.ts", "module": "index.ts",