Socket
Socket
Sign inDemoInstall

min-dom

Package Overview
Dependencies
Maintainers
8
Versions
28
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

min-dom - npm Package Compare versions

Comparing version 5.0.0 to 5.1.0

48

dist/index.js

@@ -207,12 +207,8 @@ import { forEach } from 'min-dash';

* Remove all children from the given element.
*
* @param {Element} el
*/
function clear(el) {
el.replaceChildren();
var c;
while (el.childNodes.length) {
c = el.childNodes[0];
el.removeChild(c);
}
return el;

@@ -222,32 +218,12 @@ }

/**
* @param { HTMLElement } element
* @param { String } selector
*
* @return { boolean }
*/
function matches(element, selector) {
return element && typeof element.matches === 'function' && element.matches(selector);
}
/**
* Closest
*
* @param {Element} el
* @param {String} selector
* @param {Boolean} checkYourSelf (optional)
* @param {string} selector
* @param {boolean} checkYourSelf (optional)
*/
function closest(element, selector, checkYourSelf) {
var currentElem = checkYourSelf ? element : element.parentNode;
var actualElement = checkYourSelf ? element : element.parentNode;
while (currentElem && currentElem.nodeType !== document.DOCUMENT_NODE &&
currentElem.nodeType !== document.DOCUMENT_FRAGMENT_NODE) {
if (matches(currentElem, selector)) {
return currentElem;
}
currentElem = currentElem.parentNode;
}
return matches(currentElem, selector) ? currentElem : null;
return actualElement && typeof actualElement.closest === 'function' && actualElement.closest(selector) || null;
}

@@ -365,2 +341,12 @@

/**
* @param { HTMLElement } element
* @param { String } selector
*
* @return { boolean }
*/
function matches(element, selector) {
return element && typeof element.matches === 'function' && element.matches(selector) || false;
}
function query(selector, el) {

@@ -367,0 +353,0 @@ el = el || document;

{
"name": "min-dom",
"version": "5.0.0",
"version": "5.1.0",
"description": "A minimal dom utility toolbelt",

@@ -5,0 +5,0 @@ "type": "module",

Sorry, the diff of this file is not supported yet

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