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.21 to 0.1.22

25

dist/index.js

@@ -6,2 +6,4 @@ "use strict";

constructor(element, elementsCSSRules) {
this.computedStyle = getComputedStyle(element, null);
;
this.element = element;

@@ -150,3 +152,23 @@ this.elementsCSSRules = elementsCSSRules;

if (fullElement) {
let children = this.element.children;
let attributeArray = [];
for (let child of children) {
let cssRulesValue = child.getAttribute('_cssRules');
let selectorValue = child.getAttribute('_selector');
attributeArray.push({ cssRulesValue, selectorValue });
child.removeAttribute('_cssRules');
child.removeAttribute('_selector');
}
result = this.element.outerHTML;
let i = 0;
for (let child of children) {
let atributes = attributeArray[i];
if (!!atributes.cssRulesValue) {
child.setAttribute('_cssRules', atributes.cssRulesValue);
}
if (!!atributes.selectorValue) {
child.setAttribute('_selector', atributes.selectorValue);
}
i++;
}
}

@@ -263,4 +285,3 @@ else if (withText) {

getElementStyleProperty(property, pseudoStyle) {
const styles = getComputedStyle(this.element, pseudoStyle);
return styles.getPropertyValue(property);
return this.computedStyle.getPropertyValue(property);
}

@@ -267,0 +288,0 @@ getElementTagName() {

2

package.json
{
"name": "@qualweb/qw-element",
"version": "0.1.21",
"version": "0.1.22",
"description": "Utilities module for qualweb",

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

@@ -6,4 +6,6 @@ class QWElement {

private selector: string;
private computedStyle:any;
constructor(element: Element, elementsCSSRules?: Map<Element, any>) {
this.computedStyle = getComputedStyle(element, null);;
this.element = element;

@@ -170,3 +172,23 @@ this.elementsCSSRules = elementsCSSRules;

if (fullElement) {
let children = this.element.children;
let attributeArray: any=[];
for(let child of children){
let cssRulesValue= child.getAttribute('_cssRules');
let selectorValue = child.getAttribute('_selector');
attributeArray.push({cssRulesValue,selectorValue})
child.removeAttribute('_cssRules');
child.removeAttribute('_selector');
}
result = this.element.outerHTML;
let i = 0;
for(let child of children){
let atributes= attributeArray[i];
if (!!atributes.cssRulesValue) {
child.setAttribute('_cssRules', atributes.cssRulesValue);
}
if (!!atributes.selectorValue) {
child.setAttribute('_selector', atributes.selectorValue);
}
i++;
}
}

@@ -300,4 +322,3 @@ else if (withText) {

public getElementStyleProperty(property: string, pseudoStyle: string | null): string {
const styles = getComputedStyle(this.element, pseudoStyle);
return styles.getPropertyValue(property);
return this.computedStyle.getPropertyValue(property);
}

@@ -304,0 +325,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