@thisway/utils
Advanced tools
Comparing version 0.9.0 to 0.10.0-beta.0
10
index.js
@@ -229,7 +229,6 @@ import { derived } from "svelte/store"; | ||
} | ||
function buildHierarchy(target, boundary) { | ||
const checkBoundary = typeof boundary === "function" ? boundary : (node) => node !== boundary; | ||
function buildHierarchy(target) { | ||
const elements = []; | ||
let cursor = getParentElement(target); | ||
while (cursor && checkBoundary(cursor)) { | ||
while (cursor) { | ||
elements.push(cursor); | ||
@@ -471,4 +470,5 @@ cursor = getParentElement(cursor); | ||
function buildScrollHierarchy(target, boundary) { | ||
const hierarchy = buildHierarchy(target, boundary); | ||
const elements = hierarchy.filter(isScrollableElement); | ||
const checkBoundary = typeof boundary === "function" ? boundary : (node) => node !== boundary; | ||
const hierarchy = buildHierarchy(target); | ||
const elements = hierarchy.filter((el) => checkBoundary(el) && isScrollableElement(el)); | ||
const iframes = hierarchy.filter(checkElementType("iframe")); | ||
@@ -475,0 +475,0 @@ return [elements, iframes]; |
@@ -1,3 +0,3 @@ | ||
export declare function buildHierarchy(target: Element, boundary: Element | ((parent: Element) => boolean) | null | undefined): Element[]; | ||
export declare function buildHierarchy(target: Element): Element[]; | ||
export declare function isScrollableElement(element: Element): boolean; | ||
export declare function transformNestedBounding(bounding: DOMRectReadOnly, frames: readonly HTMLIFrameElement[]): DOMRectReadOnly; |
{ | ||
"name": "@thisway/utils", | ||
"version": "0.9.0", | ||
"version": "0.10.0-beta.0", | ||
"type": "module", | ||
@@ -5,0 +5,0 @@ "sideEffects": false, |
Sorry, the diff of this file is not supported yet
AI-detected possible typosquat
Supply chain riskAI has identified this package as a potential typosquat of a more popular package. This suggests that the package may be intentionally mimicking another package's name, description, or other metadata.
Found 1 instance in 1 package
0
44433