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

melody-idom

Package Overview
Dependencies
Maintainers
3
Versions
84
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

melody-idom - npm Package Compare versions

Comparing version 1.2.0-commit.33988325 to 1.2.0-commit.05c42290

19

built/dom_util.js

@@ -64,2 +64,19 @@ /**

/**
* Function that checks whether some element is contained inside a node. This function
* has a fallback implementation for cases where Node.prototype.contains is
* not implemented (e.g. IE11 for SVGElements).
* @param {!Node} node The node that should be parent of elm.
* @param {?Element} elm The element that should be child of elm.
* @return {Boolean} whether or not elm is contained within node.
*/
var nodeContainsElement = function (node, elm) {
if (node.contains) {
return node.contains(elm);
}
while (elm && elm !== node) {
elm = elm.parentNode;
}
return elm === node;
};
/**
* Gets the path of nodes that contain the focused node in the same document as

@@ -73,3 +90,3 @@ * a reference node, up until the root.

var activeElement = getActiveElement(node);
if (!activeElement || !node.contains(activeElement)) {
if (!activeElement || !nodeContainsElement(node, activeElement)) {
return [];

@@ -76,0 +93,0 @@ }

@@ -538,2 +538,19 @@ import _debounce from 'lodash/debounce';

/**
* Function that checks whether some element is contained inside a node. This function
* has a fallback implementation for cases where Node.prototype.contains is
* not implemented (e.g. IE11 for SVGElements).
* @param {!Node} node The node that should be parent of elm.
* @param {?Element} elm The element that should be child of elm.
* @return {Boolean} whether or not elm is contained within node.
*/
var nodeContainsElement = function nodeContainsElement(node, elm) {
if (node.contains) {
return node.contains(elm);
}
while (elm && elm !== node) {
elm = elm.parentNode;
}
return elm === node;
};
/**
* Gets the path of nodes that contain the focused node in the same document as

@@ -547,3 +564,3 @@ * a reference node, up until the root.

var activeElement = getActiveElement(node);
if (!activeElement || !node.contains(activeElement)) {
if (!activeElement || !nodeContainsElement(node, activeElement)) {
return [];

@@ -550,0 +567,0 @@ }

@@ -544,2 +544,19 @@ 'use strict';

/**
* Function that checks whether some element is contained inside a node. This function
* has a fallback implementation for cases where Node.prototype.contains is
* not implemented (e.g. IE11 for SVGElements).
* @param {!Node} node The node that should be parent of elm.
* @param {?Element} elm The element that should be child of elm.
* @return {Boolean} whether or not elm is contained within node.
*/
var nodeContainsElement = function nodeContainsElement(node, elm) {
if (node.contains) {
return node.contains(elm);
}
while (elm && elm !== node) {
elm = elm.parentNode;
}
return elm === node;
};
/**
* Gets the path of nodes that contain the focused node in the same document as

@@ -553,3 +570,3 @@ * a reference node, up until the root.

var activeElement = getActiveElement(node);
if (!activeElement || !node.contains(activeElement)) {
if (!activeElement || !nodeContainsElement(node, activeElement)) {
return [];

@@ -556,0 +573,0 @@ }

2

package.json
{
"name": "melody-idom",
"version": "1.2.0-commit.33988325",
"version": "1.2.0-commit.05c42290",
"description": "",

@@ -5,0 +5,0 @@ "main": "./lib/index.js",

@@ -73,2 +73,22 @@ /**

/**
* Function that checks whether some element is contained inside a node. This function
* has a fallback implementation for cases where Node.prototype.contains is
* not implemented (e.g. IE11 for SVGElements).
* @param {!Node} node The node that should be parent of elm.
* @param {?Element} elm The element that should be child of elm.
* @return {Boolean} whether or not elm is contained within node.
*/
const nodeContainsElement = function(node, elm) {
if (node.contains) {
return node.contains(elm);
}
while (elm && elm !== node) {
elm = elm.parentNode;
}
return elm === node;
};
/**
* Gets the path of nodes that contain the focused node in the same document as

@@ -83,3 +103,3 @@ * a reference node, up until the root.

if (!activeElement || !node.contains(activeElement)) {
if (!activeElement || !nodeContainsElement(node, activeElement)) {
return [];

@@ -86,0 +106,0 @@ }

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