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

domassist

Package Overview
Dependencies
Maintainers
7
Versions
34
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

domassist - npm Package Compare versions

Comparing version 1.11.0 to 1.11.1

2

dist/domassist.js

@@ -324,3 +324,3 @@ var Domassist = (function (exports) {

function closest(el, selector) {
var parent = el.parentElement;
var parent = el.tagName.toLowerCase() === 'svg' ? el.parentNode : el.parentElement;
while (parent.parentElement && !matches(parent, selector)) {

@@ -327,0 +327,0 @@ parent = parent.parentElement;

import matches from './matches';
function closest(el, selector) {
let parent = el.parentElement;
let parent = el.tagName.toLowerCase() === 'svg' ? el.parentNode : el.parentElement;
while (parent.parentElement && !matches(parent, selector)) {

@@ -6,0 +6,0 @@ parent = parent.parentElement;

{
"name": "domassist",
"version": "1.11.0",
"version": "1.11.1",
"description": "Various dom helpers",

@@ -5,0 +5,0 @@ "main": "dist/domassist.js",

@@ -107,2 +107,14 @@ /* eslint no-console: 0 */

test('closest of an SVG element', assert => {
const node = document.createElement('div');
node.className = 'svg-wrapper';
const svg = document.createElementNS('http://www.w3.org/2000/svg', 'svg');
node.appendChild(svg);
const closest = domassist.closest(svg, '.svg-wrapper');
assert.equal(closest, node, 'Found closest');
assert.end();
});
test('Events - delegate', assert => {

@@ -109,0 +121,0 @@ const el = domassist.findOne('#domassist');

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