Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@interactjs/utils

Package Overview
Dependencies
Maintainers
2
Versions
136
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@interactjs/utils - npm Package Compare versions

Comparing version 1.4.1 to 1.4.2

domUtils.spec.d.ts

4

domUtils.d.ts

@@ -6,3 +6,3 @@ export declare function nodeContains(parent: any, child: any): boolean;

export declare function indexOfDeepestElement(elements: any): number;
export declare function matchesUpTo(element: any, selector: any, limit: any): any;
export declare function matchesUpTo(element: Element, selector: string, limit: Node): any;
export declare function getActualElement(element: any): any;

@@ -29,3 +29,3 @@ export declare function getScrollXY(relevantWindow: any): {

};
export declare function getPath(element: any): any[];
export declare function getPath(node: any): any[];
export declare function trySelector(value: any): boolean;

@@ -42,2 +42,3 @@ import browser from './browser';

}
const getParent = (el) => el.parentNode ? el.parentNode : el.host;
// Test for the element that's "above" all other qualifiers

@@ -78,5 +79,5 @@ export function indexOfDeepestElement(elements) {

parent = deepestZone;
while (parent.parentNode && parent.parentNode !== parent.ownerDocument) {
while (getParent(parent) && getParent(parent) !== parent.ownerDocument) {
deepestZoneParents.unshift(parent);
parent = parent.parentNode;
parent = getParent(parent);
}

@@ -100,3 +101,3 @@ }

dropzoneParents.unshift(parent);
parent = parent.parentNode;
parent = getParent(parent);
}

@@ -177,7 +178,7 @@ n = 0;

}
export function getPath(element) {
export function getPath(node) {
const path = [];
while (element) {
path.push(element);
element = parentNode(element);
while (node) {
path.push(node);
node = parentNode(node);
}

@@ -194,2 +195,2 @@ return path;

}
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiZG9tVXRpbHMuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyJkb21VdGlscy50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQSxPQUFPLE9BQU8sTUFBTSxXQUFXLENBQUE7QUFDL0IsT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0V2luZG93KGVsZW1lbnQpKVxuXG4gICAgY2xpZW50UmVjdC5sZWZ0ICAgKz0gc2Nyb2xsLnhcbiAgICBjbGllbnRSZWN0LnJpZ2h0ICArPSBzY3JvbGwueFxuICAgIGNsaWVudFJlY3QudG9wICAgICs9IHNjcm9sbC55XG4gICAgY2xpZW50UmVjdC5ib3R0b20gKz0gc2Nyb2xsLnlcbiAgfVxuXG4gIHJldHVybiBjbGllbnRSZWN0XG59XG5cbmV4cG9ydCBmdW5jdGlvbiBnZXRQYXRoIChub2RlKSB7XG4gIGNvbnN0IHBhdGggPSBbXVxuXG4gIHdoaWxlIChub2RlKSB7XG4gICAgcGF0aC5wdXNoKG5vZGUpXG4gICAgbm9kZSA9IHBhcmVudE5vZGUobm9kZSlcbiAgfVxuXG4gIHJldHVybiBwYXRoXG59XG5cbmV4cG9ydCBmdW5jdGlvbiB0cnlTZWxlY3RvciAodmFsdWUpIHtcbiAgaWYgKCFpcy5zdHJpbmcodmFsdWUpKSB7IHJldHVybiBmYWxzZSB9XG5cbiAgLy8gYW4gZXhjZXB0aW9uIHdpbGwgYmUgcmFpc2VkIGlmIGl0IGlzIGludmFsaWRcbiAgZG9tT2JqZWN0cy5kb2N1bWVudC5xdWVyeVNlbGVjdG9yKHZhbHVlKVxuICByZXR1cm4gdHJ1ZVxufVxuIl19
{
"name": "@interactjs/utils",
"version": "1.4.1",
"version": "1.4.2",
"publishConfig": {

@@ -5,0 +5,0 @@ "access": "public"

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc