New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@qualweb/qw-element

Package Overview
Dependencies
Maintainers
3
Versions
74
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@qualweb/qw-element - npm Package Compare versions

Comparing version 0.1.8 to 0.1.9

41

dist/index.js

@@ -8,2 +8,3 @@ 'use strict';

this.elementsCSSRules = elementsCSSRules;
this.selector = "";
}

@@ -79,2 +80,3 @@ addCSSRulesPropertyToElement(element) {

const clonedElem = this.element.cloneNode(true);
clonedElem.removeAttribute("_cssRules");
if (fullElement) {

@@ -132,21 +134,26 @@ return clonedElem.outerHTML;

getElementSelector() {
if (this.element.tagName.toLowerCase() === 'html') {
return 'html';
if (this.selector === "") {
if (this.element.tagName.toLowerCase() === 'html') {
return 'html';
}
else if (this.element.tagName.toLowerCase() === 'head') {
return 'html > head';
}
else if (this.element.tagName.toLowerCase() === 'body') {
return 'html > body';
}
let selector = 'html > ';
const parents = new Array();
let parent = this.element.parentElement;
while (parent && parent.tagName.toLowerCase() !== 'html') {
parents.unshift(this.getSelfLocationInParent(parent));
parent = parent['parentElement'];
}
selector += parents.join(' > ');
selector += ' > ' + this.getSelfLocationInParent(this.element);
return selector;
}
else if (this.element.tagName.toLowerCase() === 'head') {
return 'html > head';
else {
return this.selector;
}
else if (this.element.tagName.toLowerCase() === 'body') {
return 'html > body';
}
let selector = 'html > ';
const parents = new Array();
let parent = this.element.parentElement;
while (parent && parent.tagName.toLowerCase() !== 'html') {
parents.unshift(this.getSelfLocationInParent(parent));
parent = parent['parentElement'];
}
selector += parents.join(' > ');
selector += ' > ' + this.getSelfLocationInParent(this.element);
return selector;
}

@@ -153,0 +160,0 @@ getSelfLocationInParent(element) {

{
"name": "@qualweb/qw-element",
"version": "0.1.8",
"version": "0.1.9",
"description": "Utilities module for qualweb",

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

@@ -7,2 +7,3 @@ 'use strict';

private readonly elementsCSSRules?: Map<Element, any>;
private selector:string;

@@ -12,2 +13,3 @@ constructor(element: Element, elementsCSSRules?: Map<Element, any>) {

this.elementsCSSRules = elementsCSSRules;
this.selector = "";
}

@@ -95,2 +97,3 @@

const clonedElem = <Element>this.element.cloneNode(true);
clonedElem.removeAttribute( "_cssRules");
if (fullElement) {

@@ -155,2 +158,4 @@ return clonedElem.outerHTML;

if(this.selector === ""){
if (this.element.tagName.toLowerCase() === 'html') {

@@ -176,3 +181,6 @@ return 'html';

return selector;
return selector;}
else{
return this.selector;
}
}

@@ -179,0 +187,0 @@

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