billy-herrington-utils 1.0.1 → 1.0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/src/utils/dom/index.ts +1 -1
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "billy-herrington-utils",
|
|
3
3
|
"description": "daddy told us not to be ashamed of our utils",
|
|
4
|
-
"version": "1.0.
|
|
4
|
+
"version": "1.0.2",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"keywords": ["utils", "observer", "dom", "fetch", "arrays"],
|
|
7
7
|
"author": "smartacephale atm.mormon@protonmail.com (https://github.com/smartacephale)",
|
package/src/utils/dom/index.ts
CHANGED
|
@@ -19,7 +19,7 @@ export function replaceElementTag(e: HTMLElement | Element, tagName: string) {
|
|
|
19
19
|
|
|
20
20
|
export function getAllUniqueParents(elements: HTMLCollection): Array<HTMLElement | Element> {
|
|
21
21
|
return Array.from(elements).reduce((acc, v) => {
|
|
22
|
-
if (v.parentElement && acc.includes(v.parentElement as HTMLElement)) { acc.push(v.parentElement); }
|
|
22
|
+
if (v.parentElement && !acc.includes(v.parentElement as HTMLElement)) { acc.push(v.parentElement); }
|
|
23
23
|
return acc;
|
|
24
24
|
}, [] as Array<HTMLElement | Element>);
|
|
25
25
|
}
|