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
4
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.2.4 to 0.2.5

6

dist/index.d.ts

@@ -34,4 +34,6 @@ /// <reference types="@qualweb/types" />

getElementNextSibling(): QWElement | null;
getPreviousSibling(): QWElement | string | undefined | null;
getNextSibling(): QWElement | string | undefined | null;
getAllPreviousSiblings(): Array<QWElement | string>;
getAllNextSiblings(): Array<QWElement | string>;
getPreviousSibling(): QWElement | string | null;
getNextSibling(): QWElement | string | null;
getElementParent(): QWElement | null;

@@ -38,0 +40,0 @@ getParentAllContexts(): QWElement | null;

@@ -259,2 +259,36 @@ "use strict";

}
getAllPreviousSiblings() {
const siblings = new Array();
let sibling = this.element.previousSibling;
while (sibling !== null) {
if (sibling.nodeType === 1) {
const qwSibling = this.convertElementToQWElement(sibling);
if (qwSibling) {
siblings.unshift(qwSibling);
}
}
else if (sibling.nodeType === 3 && sibling.textContent) {
siblings.unshift(sibling.textContent);
}
sibling = sibling.previousSibling;
}
return siblings;
}
getAllNextSiblings() {
const siblings = new Array();
let sibling = this.element.nextSibling;
while (sibling !== null) {
if (sibling.nodeType === 1) {
const qwSibling = this.convertElementToQWElement(sibling);
if (qwSibling) {
siblings.unshift(qwSibling);
}
}
else if (sibling.nodeType === 3 && sibling.textContent) {
siblings.unshift(sibling.textContent);
}
sibling = sibling.nextSibling;
}
return siblings;
}
getPreviousSibling() {

@@ -270,3 +304,15 @@ const sibling = this.element.previousSibling;

else {
return undefined;
let siblingNode = sibling.previousSibling;
let previousSibling = null;
while (siblingNode !== null) {
if (siblingNode.nodeType === 1) {
previousSibling = this.convertElementToQWElement(siblingNode);
break;
}
else if (siblingNode.nodeType === 3) {
previousSibling = siblingNode.textContent;
}
siblingNode = siblingNode.previousSibling;
}
return previousSibling;
}

@@ -286,3 +332,15 @@ }

else {
return undefined;
let siblingNode = sibling.nextSibling;
let nextSibling = null;
while (siblingNode !== null) {
if (siblingNode.nodeType === 1) {
nextSibling = this.convertElementToQWElement(siblingNode);
break;
}
else if (siblingNode.nodeType === 3) {
nextSibling = siblingNode.textContent;
}
siblingNode = siblingNode.nextSibling;
}
return nextSibling;
}

@@ -289,0 +347,0 @@ }

{
"name": "@qualweb/qw-element",
"version": "0.2.4",
"version": "0.2.5",
"description": "QualWeb element interface and utilities",

@@ -37,7 +37,7 @@ "main": "dist/index.js",

"devDependencies": {
"@qualweb/types": "^0.6.10",
"@qualweb/types": "^0.6.11",
"@tsconfig/recommended": "^1.0.1",
"@types/node": "^16.3.3",
"@typescript-eslint/eslint-plugin": "^4.28.3",
"@typescript-eslint/parser": "^4.28.3",
"@typescript-eslint/eslint-plugin": "^4.28.4",
"@typescript-eslint/parser": "^4.28.4",
"chai": "^4.3.4",

@@ -44,0 +44,0 @@ "eslint": "^7.31.0",

Sorry, the diff of this file is not supported yet

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