Avoid carousel init duplication.

This commit is contained in:
Dermot Duffy
2023-08-13 10:00:29 -07:00
parent c61ceb905d
commit b4595867b3
4 changed files with 42 additions and 16 deletions
+7 -1
View File
@@ -225,4 +225,10 @@ export const setOrRemoveAttribute = (
/**
* Allow typescript to narrow types based on truthy filter.
*/
export const filterTruthy = <T>(x: T | false | undefined | null | '' | 0): x is T => !!x;
export const isTruthy = <T>(x: T | false | undefined | null | '' | 0): x is T => !!x;
/**
* Allow typescript to narrow types for HTMLElements.
*/
export const isHTMLElement = (element: unknown): element is HTMLElement =>
element instanceof HTMLElement;