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

xpath-helper

Package Overview
Dependencies
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

xpath-helper - npm Package Compare versions

Comparing version 0.1.1 to 0.1.2

2

dist/cjs/filter.d.ts

@@ -183,3 +183,3 @@ /**

/**
* Selects the nodes whose value is greater than ``value``.
* Selects the nodes whose value is greater than ``value``.
* @param {number} value - node value

@@ -186,0 +186,0 @@ * @returns {ValidExpressionFilter} a new instance of ValidExpressionFilter with the newly formed expression.

@@ -239,3 +239,3 @@ "use strict";

/**
* Selects the nodes whose value is greater than ``value``.
* Selects the nodes whose value is greater than ``value``.
* @param {number} value - node value

@@ -242,0 +242,0 @@ * @returns {ValidExpressionFilter} a new instance of ValidExpressionFilter with the newly formed expression.

@@ -29,3 +29,3 @@ import { EmptyFilter, IFilter } from "./filter";

/**
* Select the parent of the current element.
* Selects the parent of the current element.
* @return {XPathHelper} returns a new instance of XPathHelper

@@ -36,3 +36,3 @@ * @memberof XPathHelper

/**
* Select an element with an XPath selector ``xpath``.
* Selects an element with an XPath selector ``xpath``.
* @param {string} xpath - XPath expression

@@ -47,3 +47,3 @@ * @return {XPathHelper} returns a new instance of XPathHelper

/**
* Select the nodes filtered by ``filter``, below the node in reference no matter the depth.
* Selects the nodes filtered by ``filter``, below the node in reference no matter the depth.
* @param {IFilter} filter - filter object

@@ -55,3 +55,3 @@ * @return {XPathHelper} returns a new instance of XPathHelper

/**
* Select the nodes filtered by ``filter``, below the node in reference no matter the depth.
* Selects the nodes filtered by ``filter``, below the node in reference no matter the depth.
* @description This method is a synonym of ``getDescendant``.

@@ -64,3 +64,3 @@ * @param {IFilter} filter - filter object

/**
* Select the nodes with tag ``tag`` filtered by ``filter``, below the node in reference no matter the depth.
* Selects the nodes with tag ``tag`` filtered by ``filter``, below the node in reference no matter the depth.
* @param {string} tag - tag name

@@ -73,3 +73,3 @@ * @param {IFilter} [filter] - filter object

/**
* Select the nodes with tag ``tag`` filtered by ``filter``, below the node in reference no matter the depth.
* Selects the nodes with tag ``tag`` filtered by ``filter``, below the node in reference no matter the depth.
* @description This method is a synonym of ``getDescendantByTag``.

@@ -83,3 +83,3 @@ * @param {string} tag - tag name

/**
* Select the SVG nodes with SVG tag ``svgTag`` filtered by ``filter``, below the node in reference no matter the depth.
* Selects the SVG nodes with SVG tag ``svgTag`` filtered by ``filter``, below the node in reference no matter the depth.
* @param {string} svgTag - SVG tag name

@@ -92,3 +92,3 @@ * @param {IFilter} [filter] - filter object

/**
* Select the SVG nodes with SVG tag ``svgTag`` filtered by ``filter``, below the node in reference no matter the depth.
* Selects the SVG nodes with SVG tag ``svgTag`` filtered by ``filter``, below the node in reference no matter the depth.
* @description This method is a synonym of ``getDescendantBySVGTag``.

@@ -106,3 +106,3 @@ * @param {string} svgTag - SVG tag name

/**
* Select the nodes filtered by ``filter``, below the current node, but also returns the node in reference.
* Selects the nodes filtered by ``filter``, below the current node, but also returns the node in reference.
* @param {IFilter} filter - filter object

@@ -114,3 +114,3 @@ * @return {XPathHelper} returns a new instance of XPathHelper

/**
* Select the nodes with tag ``tag`` filtered by ``filter``, below the current node, but also returns the node in reference.
* Selects the nodes with tag ``tag`` filtered by ``filter``, below the current node, but also returns the node in reference.
* @param {string} tag - tag name

@@ -123,3 +123,3 @@ * @param {IFilter} [filter] - filter object

/**
* Select the SVG nodes with SVG tag ``svgTag`` filtered by ``filter``, below the current node, but also returns the node in reference.
* Selects the SVG nodes with SVG tag ``svgTag`` filtered by ``filter``, below the current node, but also returns the node in reference.
* @param {string} svgTag - SVG tag name

@@ -135,3 +135,3 @@ * @param {IFilter} [filter] - filter object

/**
* Select the nodes filtered by ``filter`` immediately below the node in reference.
* Selects the nodes filtered by ``filter`` immediately below the node in reference.
* @param {IFilter} filter - filter object

@@ -143,3 +143,3 @@ * @return {XPathHelper} returns a new instance of XPathHelper

/**
* Select the nodes with tag ``tag`` filtered by ``filter``, immediately below the node in reference.
* Selects the nodes with tag ``tag`` filtered by ``filter``, immediately below the node in reference.
* @param {string} tag - tag name

@@ -152,3 +152,3 @@ * @param {IFilter} [filter] - filter object

/**
* Select the SVG nodes with SVG tag ``svgTag`` filtered by ``filter``, immediately below the node in reference.
* Selects the SVG nodes with SVG tag ``svgTag`` filtered by ``filter``, immediately below the node in reference.
* @param {string} svgTag - SVG tag name

@@ -165,3 +165,3 @@ * @param {IFilter} [filter] - filter object

/**
* Select the nodes filtered by ``filter``,
* Selects the nodes filtered by ``filter``,
* that are ancestors, or the parent, and the parent's parent, and so on, to the node in reference.

@@ -174,3 +174,3 @@ * @param {IFilter} filter - filter object

/**
* Select the nodes with tag ``tag`` filtered by ``filter``,
* Selects the nodes with tag ``tag`` filtered by ``filter``,
* that are ancestors, or the parent, and the parent's parent, and so on, to the node in reference.

@@ -184,3 +184,3 @@ * @param {string} tag - tag name

/**
* Select the SVG nodes with SVG tag ``svgTag`` filtered by ``filter``,
* Selects the SVG nodes with SVG tag ``svgTag`` filtered by ``filter``,
* that are ancestors, or the parent, and the parent's parent, and so on, to the node in reference.

@@ -198,3 +198,3 @@ * @param {string} svgTag - SVG tag name

/**
* Select the nodes filtered by ``filter``,
* Selects the nodes filtered by ``filter``,
* that are ancestors, or the parent, and the parent's parent, and so on, including the node in reference.

@@ -207,3 +207,3 @@ * @param {IFilter} filter - filter object

/**
* Select the nodes with tag ``tag`` filtered by ``filter``,
* Selects the nodes with tag ``tag`` filtered by ``filter``,
* that are ancestors, or the parent, and the parent's parent, and so on, including the node in reference.

@@ -217,3 +217,3 @@ * @param {string} tag - tag name

/**
* Select the SVG nodes with SVG tag ``svgTag`` filtered by ``filter``,
* Selects the SVG nodes with SVG tag ``svgTag`` filtered by ``filter``,
* that are ancestors, or the parent, and the parent's parent, and so on, including the node in reference.

@@ -231,3 +231,3 @@ * @param {string} svgTag - SVG tag name

/**
* Select the nodes filtered by ``filter``, that are located on parent-level
* Selects the nodes filtered by ``filter``, that are located on parent-level
* and also after (following) its parent of the node in reference.

@@ -240,3 +240,3 @@ * @param {IFilter} filter - filter object

/**
* Select the nodes with tag ``tag`` filtered by ``filter``,
* Selects the nodes with tag ``tag`` filtered by ``filter``,
* that are located on parent-level and also after (following) its parent of the node in reference.

@@ -250,3 +250,3 @@ * @param {string} tag - tag name

/**
* Select the SVG nodes with SVG tag ``svgTag`` filtered by ``filter``,
* Selects the SVG nodes with SVG tag ``svgTag`` filtered by ``filter``,
* that are located on parent-level and also after (following) its parent of the node in reference.

@@ -262,3 +262,3 @@ * @param {IFilter} filter - filter object

/**
* Select the nodes filtered by ``filter``,
* Selects the nodes filtered by ``filter``,
* that are located on the same level who are located after (following) the node in reference.

@@ -271,3 +271,3 @@ * @param {IFilter} filter - filter object

/**
* Select the nodes with tag ``tag`` filtered by ``filter``,
* Selects the nodes with tag ``tag`` filtered by ``filter``,
* that are located on the same level who are located after (following) the node in reference.

@@ -281,3 +281,3 @@ * @param {string} tag - tag name

/**
* Select the SVG nodes with SVG tag ``svgTag`` filtered by ``filter``,
* Selects the SVG nodes with SVG tag ``svgTag`` filtered by ``filter``,
* that are located on the same level who are located after (following) the node in reference.

@@ -295,3 +295,3 @@ * @param {string} svgTag - SVG tag name

/**
* Select the nodes filtered by ``filter``, that are located on parent-level
* Selects the nodes filtered by ``filter``, that are located on parent-level
* and also before (preceding) its parent of the node in reference.

@@ -304,3 +304,3 @@ * @param {IFilter} filter - filter object

/**
* Select the nodes with tag ``tag`` filtered by ``filter``,
* Selects the nodes with tag ``tag`` filtered by ``filter``,
* that are located on parent-level and also before (preceding) its parent of the node in reference.

@@ -314,3 +314,3 @@ * @param {string} tag - tag name

/**
* Select the SVG nodes with SVG tag ``svgTag`` filtered by ``filter``,
* Selects the SVG nodes with SVG tag ``svgTag`` filtered by ``filter``,
* that are located on parent-level and also before (preceding) its parent of the node in reference.

@@ -328,3 +328,3 @@ * @param {string} svgTag - SVG tag name

/**
* Select the nodes filtered by ``filter``, that are located on the same level
* Selects the nodes filtered by ``filter``, that are located on the same level
* who are also located before (preceding) the node in reference.

@@ -337,3 +337,3 @@ * @param {IFilter} filter - filter object

/**
* Select the nodes with tag ``tag`` filtered by ``filter``,
* Selects the nodes with tag ``tag`` filtered by ``filter``,
* that are located on the same level who are also located before (preceding) the node in reference.

@@ -347,3 +347,3 @@ * @param {string} tag - tag name

/**
* Select the SVG nodes with SVG tag ``svgTag`` filtered by ``filter``,
* Selects the SVG nodes with SVG tag ``svgTag`` filtered by ``filter``,
* that are located on the same level who are also located before (preceding) the node in reference.

@@ -364,3 +364,3 @@ * @param {string} svgTag - SVG tag name

/**
* Add the given filter to the current xpath expression.
* Adds the given filter to the current xpath expression.
* @private

@@ -367,0 +367,0 @@ * @param {IFilter} [filter]

@@ -44,3 +44,3 @@ "use strict";

/**
* Select the parent of the current element.
* Selects the parent of the current element.
* @return {XPathHelper} returns a new instance of XPathHelper

@@ -53,3 +53,3 @@ * @memberof XPathHelper

/**
* Select an element with an XPath selector ``xpath``.
* Selects an element with an XPath selector ``xpath``.
* @param {string} xpath - XPath expression

@@ -66,3 +66,3 @@ * @return {XPathHelper} returns a new instance of XPathHelper

/**
* Select the nodes filtered by ``filter``, below the node in reference no matter the depth.
* Selects the nodes filtered by ``filter``, below the node in reference no matter the depth.
* @param {IFilter} filter - filter object

@@ -76,3 +76,3 @@ * @return {XPathHelper} returns a new instance of XPathHelper

/**
* Select the nodes filtered by ``filter``, below the node in reference no matter the depth.
* Selects the nodes filtered by ``filter``, below the node in reference no matter the depth.
* @description This method is a synonym of ``getDescendant``.

@@ -87,3 +87,3 @@ * @param {IFilter} filter - filter object

/**
* Select the nodes with tag ``tag`` filtered by ``filter``, below the node in reference no matter the depth.
* Selects the nodes with tag ``tag`` filtered by ``filter``, below the node in reference no matter the depth.
* @param {string} tag - tag name

@@ -101,3 +101,3 @@ * @param {IFilter} [filter] - filter object

/**
* Select the nodes with tag ``tag`` filtered by ``filter``, below the node in reference no matter the depth.
* Selects the nodes with tag ``tag`` filtered by ``filter``, below the node in reference no matter the depth.
* @description This method is a synonym of ``getDescendantByTag``.

@@ -113,3 +113,3 @@ * @param {string} tag - tag name

/**
* Select the SVG nodes with SVG tag ``svgTag`` filtered by ``filter``, below the node in reference no matter the depth.
* Selects the SVG nodes with SVG tag ``svgTag`` filtered by ``filter``, below the node in reference no matter the depth.
* @param {string} svgTag - SVG tag name

@@ -127,3 +127,3 @@ * @param {IFilter} [filter] - filter object

/**
* Select the SVG nodes with SVG tag ``svgTag`` filtered by ``filter``, below the node in reference no matter the depth.
* Selects the SVG nodes with SVG tag ``svgTag`` filtered by ``filter``, below the node in reference no matter the depth.
* @description This method is a synonym of ``getDescendantBySVGTag``.

@@ -143,3 +143,3 @@ * @param {string} svgTag - SVG tag name

/**
* Select the nodes filtered by ``filter``, below the current node, but also returns the node in reference.
* Selects the nodes filtered by ``filter``, below the current node, but also returns the node in reference.
* @param {IFilter} filter - filter object

@@ -156,3 +156,3 @@ * @return {XPathHelper} returns a new instance of XPathHelper

/**
* Select the nodes with tag ``tag`` filtered by ``filter``, below the current node, but also returns the node in reference.
* Selects the nodes with tag ``tag`` filtered by ``filter``, below the current node, but also returns the node in reference.
* @param {string} tag - tag name

@@ -170,3 +170,3 @@ * @param {IFilter} [filter] - filter object

/**
* Select the SVG nodes with SVG tag ``svgTag`` filtered by ``filter``, below the current node, but also returns the node in reference.
* Selects the SVG nodes with SVG tag ``svgTag`` filtered by ``filter``, below the current node, but also returns the node in reference.
* @param {string} svgTag - SVG tag name

@@ -190,3 +190,3 @@ * @param {IFilter} [filter] - filter object

/**
* Select the nodes filtered by ``filter`` immediately below the node in reference.
* Selects the nodes filtered by ``filter`` immediately below the node in reference.
* @param {IFilter} filter - filter object

@@ -200,3 +200,3 @@ * @return {XPathHelper} returns a new instance of XPathHelper

/**
* Select the nodes with tag ``tag`` filtered by ``filter``, immediately below the node in reference.
* Selects the nodes with tag ``tag`` filtered by ``filter``, immediately below the node in reference.
* @param {string} tag - tag name

@@ -214,3 +214,3 @@ * @param {IFilter} [filter] - filter object

/**
* Select the SVG nodes with SVG tag ``svgTag`` filtered by ``filter``, immediately below the node in reference.
* Selects the SVG nodes with SVG tag ``svgTag`` filtered by ``filter``, immediately below the node in reference.
* @param {string} svgTag - SVG tag name

@@ -232,3 +232,3 @@ * @param {IFilter} [filter] - filter object

/**
* Select the nodes filtered by ``filter``,
* Selects the nodes filtered by ``filter``,
* that are ancestors, or the parent, and the parent's parent, and so on, to the node in reference.

@@ -246,3 +246,3 @@ * @param {IFilter} filter - filter object

/**
* Select the nodes with tag ``tag`` filtered by ``filter``,
* Selects the nodes with tag ``tag`` filtered by ``filter``,
* that are ancestors, or the parent, and the parent's parent, and so on, to the node in reference.

@@ -261,3 +261,3 @@ * @param {string} tag - tag name

/**
* Select the SVG nodes with SVG tag ``svgTag`` filtered by ``filter``,
* Selects the SVG nodes with SVG tag ``svgTag`` filtered by ``filter``,
* that are ancestors, or the parent, and the parent's parent, and so on, to the node in reference.

@@ -283,3 +283,3 @@ * @param {string} svgTag - SVG tag name

/**
* Select the nodes filtered by ``filter``,
* Selects the nodes filtered by ``filter``,
* that are ancestors, or the parent, and the parent's parent, and so on, including the node in reference.

@@ -297,3 +297,3 @@ * @param {IFilter} filter - filter object

/**
* Select the nodes with tag ``tag`` filtered by ``filter``,
* Selects the nodes with tag ``tag`` filtered by ``filter``,
* that are ancestors, or the parent, and the parent's parent, and so on, including the node in reference.

@@ -312,3 +312,3 @@ * @param {string} tag - tag name

/**
* Select the SVG nodes with SVG tag ``svgTag`` filtered by ``filter``,
* Selects the SVG nodes with SVG tag ``svgTag`` filtered by ``filter``,
* that are ancestors, or the parent, and the parent's parent, and so on, including the node in reference.

@@ -334,3 +334,3 @@ * @param {string} svgTag - SVG tag name

/**
* Select the nodes filtered by ``filter``, that are located on parent-level
* Selects the nodes filtered by ``filter``, that are located on parent-level
* and also after (following) its parent of the node in reference.

@@ -348,3 +348,3 @@ * @param {IFilter} filter - filter object

/**
* Select the nodes with tag ``tag`` filtered by ``filter``,
* Selects the nodes with tag ``tag`` filtered by ``filter``,
* that are located on parent-level and also after (following) its parent of the node in reference.

@@ -363,3 +363,3 @@ * @param {string} tag - tag name

/**
* Select the SVG nodes with SVG tag ``svgTag`` filtered by ``filter``,
* Selects the SVG nodes with SVG tag ``svgTag`` filtered by ``filter``,
* that are located on parent-level and also after (following) its parent of the node in reference.

@@ -383,3 +383,3 @@ * @param {IFilter} filter - filter object

/**
* Select the nodes filtered by ``filter``,
* Selects the nodes filtered by ``filter``,
* that are located on the same level who are located after (following) the node in reference.

@@ -397,3 +397,3 @@ * @param {IFilter} filter - filter object

/**
* Select the nodes with tag ``tag`` filtered by ``filter``,
* Selects the nodes with tag ``tag`` filtered by ``filter``,
* that are located on the same level who are located after (following) the node in reference.

@@ -412,3 +412,3 @@ * @param {string} tag - tag name

/**
* Select the SVG nodes with SVG tag ``svgTag`` filtered by ``filter``,
* Selects the SVG nodes with SVG tag ``svgTag`` filtered by ``filter``,
* that are located on the same level who are located after (following) the node in reference.

@@ -434,3 +434,3 @@ * @param {string} svgTag - SVG tag name

/**
* Select the nodes filtered by ``filter``, that are located on parent-level
* Selects the nodes filtered by ``filter``, that are located on parent-level
* and also before (preceding) its parent of the node in reference.

@@ -448,3 +448,3 @@ * @param {IFilter} filter - filter object

/**
* Select the nodes with tag ``tag`` filtered by ``filter``,
* Selects the nodes with tag ``tag`` filtered by ``filter``,
* that are located on parent-level and also before (preceding) its parent of the node in reference.

@@ -463,3 +463,3 @@ * @param {string} tag - tag name

/**
* Select the SVG nodes with SVG tag ``svgTag`` filtered by ``filter``,
* Selects the SVG nodes with SVG tag ``svgTag`` filtered by ``filter``,
* that are located on parent-level and also before (preceding) its parent of the node in reference.

@@ -485,3 +485,3 @@ * @param {string} svgTag - SVG tag name

/**
* Select the nodes filtered by ``filter``, that are located on the same level
* Selects the nodes filtered by ``filter``, that are located on the same level
* who are also located before (preceding) the node in reference.

@@ -499,3 +499,3 @@ * @param {IFilter} filter - filter object

/**
* Select the nodes with tag ``tag`` filtered by ``filter``,
* Selects the nodes with tag ``tag`` filtered by ``filter``,
* that are located on the same level who are also located before (preceding) the node in reference.

@@ -514,3 +514,3 @@ * @param {string} tag - tag name

/**
* Select the SVG nodes with SVG tag ``svgTag`` filtered by ``filter``,
* Selects the SVG nodes with SVG tag ``svgTag`` filtered by ``filter``,
* that are located on the same level who are also located before (preceding) the node in reference.

@@ -541,3 +541,3 @@ * @param {string} svgTag - SVG tag name

/**
* Add the given filter to the current xpath expression.
* Adds the given filter to the current xpath expression.
* @private

@@ -544,0 +544,0 @@ * @param {IFilter} [filter]

@@ -183,3 +183,3 @@ /**

/**
* Selects the nodes whose value is greater than ``value``.
* Selects the nodes whose value is greater than ``value``.
* @param {number} value - node value

@@ -186,0 +186,0 @@ * @returns {ValidExpressionFilter} a new instance of ValidExpressionFilter with the newly formed expression.

@@ -249,3 +249,3 @@ /**

/**
* Selects the nodes whose value is greater than ``value``.
* Selects the nodes whose value is greater than ``value``.
* @param {number} value - node value

@@ -252,0 +252,0 @@ * @returns {ValidExpressionFilter} a new instance of ValidExpressionFilter with the newly formed expression.

@@ -29,3 +29,3 @@ import { EmptyFilter, IFilter } from "./filter";

/**
* Select the parent of the current element.
* Selects the parent of the current element.
* @return {XPathHelper} returns a new instance of XPathHelper

@@ -36,3 +36,3 @@ * @memberof XPathHelper

/**
* Select an element with an XPath selector ``xpath``.
* Selects an element with an XPath selector ``xpath``.
* @param {string} xpath - XPath expression

@@ -47,3 +47,3 @@ * @return {XPathHelper} returns a new instance of XPathHelper

/**
* Select the nodes filtered by ``filter``, below the node in reference no matter the depth.
* Selects the nodes filtered by ``filter``, below the node in reference no matter the depth.
* @param {IFilter} filter - filter object

@@ -55,3 +55,3 @@ * @return {XPathHelper} returns a new instance of XPathHelper

/**
* Select the nodes filtered by ``filter``, below the node in reference no matter the depth.
* Selects the nodes filtered by ``filter``, below the node in reference no matter the depth.
* @description This method is a synonym of ``getDescendant``.

@@ -64,3 +64,3 @@ * @param {IFilter} filter - filter object

/**
* Select the nodes with tag ``tag`` filtered by ``filter``, below the node in reference no matter the depth.
* Selects the nodes with tag ``tag`` filtered by ``filter``, below the node in reference no matter the depth.
* @param {string} tag - tag name

@@ -73,3 +73,3 @@ * @param {IFilter} [filter] - filter object

/**
* Select the nodes with tag ``tag`` filtered by ``filter``, below the node in reference no matter the depth.
* Selects the nodes with tag ``tag`` filtered by ``filter``, below the node in reference no matter the depth.
* @description This method is a synonym of ``getDescendantByTag``.

@@ -83,3 +83,3 @@ * @param {string} tag - tag name

/**
* Select the SVG nodes with SVG tag ``svgTag`` filtered by ``filter``, below the node in reference no matter the depth.
* Selects the SVG nodes with SVG tag ``svgTag`` filtered by ``filter``, below the node in reference no matter the depth.
* @param {string} svgTag - SVG tag name

@@ -92,3 +92,3 @@ * @param {IFilter} [filter] - filter object

/**
* Select the SVG nodes with SVG tag ``svgTag`` filtered by ``filter``, below the node in reference no matter the depth.
* Selects the SVG nodes with SVG tag ``svgTag`` filtered by ``filter``, below the node in reference no matter the depth.
* @description This method is a synonym of ``getDescendantBySVGTag``.

@@ -106,3 +106,3 @@ * @param {string} svgTag - SVG tag name

/**
* Select the nodes filtered by ``filter``, below the current node, but also returns the node in reference.
* Selects the nodes filtered by ``filter``, below the current node, but also returns the node in reference.
* @param {IFilter} filter - filter object

@@ -114,3 +114,3 @@ * @return {XPathHelper} returns a new instance of XPathHelper

/**
* Select the nodes with tag ``tag`` filtered by ``filter``, below the current node, but also returns the node in reference.
* Selects the nodes with tag ``tag`` filtered by ``filter``, below the current node, but also returns the node in reference.
* @param {string} tag - tag name

@@ -123,3 +123,3 @@ * @param {IFilter} [filter] - filter object

/**
* Select the SVG nodes with SVG tag ``svgTag`` filtered by ``filter``, below the current node, but also returns the node in reference.
* Selects the SVG nodes with SVG tag ``svgTag`` filtered by ``filter``, below the current node, but also returns the node in reference.
* @param {string} svgTag - SVG tag name

@@ -135,3 +135,3 @@ * @param {IFilter} [filter] - filter object

/**
* Select the nodes filtered by ``filter`` immediately below the node in reference.
* Selects the nodes filtered by ``filter`` immediately below the node in reference.
* @param {IFilter} filter - filter object

@@ -143,3 +143,3 @@ * @return {XPathHelper} returns a new instance of XPathHelper

/**
* Select the nodes with tag ``tag`` filtered by ``filter``, immediately below the node in reference.
* Selects the nodes with tag ``tag`` filtered by ``filter``, immediately below the node in reference.
* @param {string} tag - tag name

@@ -152,3 +152,3 @@ * @param {IFilter} [filter] - filter object

/**
* Select the SVG nodes with SVG tag ``svgTag`` filtered by ``filter``, immediately below the node in reference.
* Selects the SVG nodes with SVG tag ``svgTag`` filtered by ``filter``, immediately below the node in reference.
* @param {string} svgTag - SVG tag name

@@ -165,3 +165,3 @@ * @param {IFilter} [filter] - filter object

/**
* Select the nodes filtered by ``filter``,
* Selects the nodes filtered by ``filter``,
* that are ancestors, or the parent, and the parent's parent, and so on, to the node in reference.

@@ -174,3 +174,3 @@ * @param {IFilter} filter - filter object

/**
* Select the nodes with tag ``tag`` filtered by ``filter``,
* Selects the nodes with tag ``tag`` filtered by ``filter``,
* that are ancestors, or the parent, and the parent's parent, and so on, to the node in reference.

@@ -184,3 +184,3 @@ * @param {string} tag - tag name

/**
* Select the SVG nodes with SVG tag ``svgTag`` filtered by ``filter``,
* Selects the SVG nodes with SVG tag ``svgTag`` filtered by ``filter``,
* that are ancestors, or the parent, and the parent's parent, and so on, to the node in reference.

@@ -198,3 +198,3 @@ * @param {string} svgTag - SVG tag name

/**
* Select the nodes filtered by ``filter``,
* Selects the nodes filtered by ``filter``,
* that are ancestors, or the parent, and the parent's parent, and so on, including the node in reference.

@@ -207,3 +207,3 @@ * @param {IFilter} filter - filter object

/**
* Select the nodes with tag ``tag`` filtered by ``filter``,
* Selects the nodes with tag ``tag`` filtered by ``filter``,
* that are ancestors, or the parent, and the parent's parent, and so on, including the node in reference.

@@ -217,3 +217,3 @@ * @param {string} tag - tag name

/**
* Select the SVG nodes with SVG tag ``svgTag`` filtered by ``filter``,
* Selects the SVG nodes with SVG tag ``svgTag`` filtered by ``filter``,
* that are ancestors, or the parent, and the parent's parent, and so on, including the node in reference.

@@ -231,3 +231,3 @@ * @param {string} svgTag - SVG tag name

/**
* Select the nodes filtered by ``filter``, that are located on parent-level
* Selects the nodes filtered by ``filter``, that are located on parent-level
* and also after (following) its parent of the node in reference.

@@ -240,3 +240,3 @@ * @param {IFilter} filter - filter object

/**
* Select the nodes with tag ``tag`` filtered by ``filter``,
* Selects the nodes with tag ``tag`` filtered by ``filter``,
* that are located on parent-level and also after (following) its parent of the node in reference.

@@ -250,3 +250,3 @@ * @param {string} tag - tag name

/**
* Select the SVG nodes with SVG tag ``svgTag`` filtered by ``filter``,
* Selects the SVG nodes with SVG tag ``svgTag`` filtered by ``filter``,
* that are located on parent-level and also after (following) its parent of the node in reference.

@@ -262,3 +262,3 @@ * @param {IFilter} filter - filter object

/**
* Select the nodes filtered by ``filter``,
* Selects the nodes filtered by ``filter``,
* that are located on the same level who are located after (following) the node in reference.

@@ -271,3 +271,3 @@ * @param {IFilter} filter - filter object

/**
* Select the nodes with tag ``tag`` filtered by ``filter``,
* Selects the nodes with tag ``tag`` filtered by ``filter``,
* that are located on the same level who are located after (following) the node in reference.

@@ -281,3 +281,3 @@ * @param {string} tag - tag name

/**
* Select the SVG nodes with SVG tag ``svgTag`` filtered by ``filter``,
* Selects the SVG nodes with SVG tag ``svgTag`` filtered by ``filter``,
* that are located on the same level who are located after (following) the node in reference.

@@ -295,3 +295,3 @@ * @param {string} svgTag - SVG tag name

/**
* Select the nodes filtered by ``filter``, that are located on parent-level
* Selects the nodes filtered by ``filter``, that are located on parent-level
* and also before (preceding) its parent of the node in reference.

@@ -304,3 +304,3 @@ * @param {IFilter} filter - filter object

/**
* Select the nodes with tag ``tag`` filtered by ``filter``,
* Selects the nodes with tag ``tag`` filtered by ``filter``,
* that are located on parent-level and also before (preceding) its parent of the node in reference.

@@ -314,3 +314,3 @@ * @param {string} tag - tag name

/**
* Select the SVG nodes with SVG tag ``svgTag`` filtered by ``filter``,
* Selects the SVG nodes with SVG tag ``svgTag`` filtered by ``filter``,
* that are located on parent-level and also before (preceding) its parent of the node in reference.

@@ -328,3 +328,3 @@ * @param {string} svgTag - SVG tag name

/**
* Select the nodes filtered by ``filter``, that are located on the same level
* Selects the nodes filtered by ``filter``, that are located on the same level
* who are also located before (preceding) the node in reference.

@@ -337,3 +337,3 @@ * @param {IFilter} filter - filter object

/**
* Select the nodes with tag ``tag`` filtered by ``filter``,
* Selects the nodes with tag ``tag`` filtered by ``filter``,
* that are located on the same level who are also located before (preceding) the node in reference.

@@ -347,3 +347,3 @@ * @param {string} tag - tag name

/**
* Select the SVG nodes with SVG tag ``svgTag`` filtered by ``filter``,
* Selects the SVG nodes with SVG tag ``svgTag`` filtered by ``filter``,
* that are located on the same level who are also located before (preceding) the node in reference.

@@ -364,3 +364,3 @@ * @param {string} svgTag - SVG tag name

/**
* Add the given filter to the current xpath expression.
* Adds the given filter to the current xpath expression.
* @private

@@ -367,0 +367,0 @@ * @param {IFilter} [filter]

@@ -42,3 +42,3 @@ import { EmptyFilter } from "./filter";

/**
* Select the parent of the current element.
* Selects the parent of the current element.
* @return {XPathHelper} returns a new instance of XPathHelper

@@ -51,3 +51,3 @@ * @memberof XPathHelper

/**
* Select an element with an XPath selector ``xpath``.
* Selects an element with an XPath selector ``xpath``.
* @param {string} xpath - XPath expression

@@ -64,3 +64,3 @@ * @return {XPathHelper} returns a new instance of XPathHelper

/**
* Select the nodes filtered by ``filter``, below the node in reference no matter the depth.
* Selects the nodes filtered by ``filter``, below the node in reference no matter the depth.
* @param {IFilter} filter - filter object

@@ -74,3 +74,3 @@ * @return {XPathHelper} returns a new instance of XPathHelper

/**
* Select the nodes filtered by ``filter``, below the node in reference no matter the depth.
* Selects the nodes filtered by ``filter``, below the node in reference no matter the depth.
* @description This method is a synonym of ``getDescendant``.

@@ -85,3 +85,3 @@ * @param {IFilter} filter - filter object

/**
* Select the nodes with tag ``tag`` filtered by ``filter``, below the node in reference no matter the depth.
* Selects the nodes with tag ``tag`` filtered by ``filter``, below the node in reference no matter the depth.
* @param {string} tag - tag name

@@ -99,3 +99,3 @@ * @param {IFilter} [filter] - filter object

/**
* Select the nodes with tag ``tag`` filtered by ``filter``, below the node in reference no matter the depth.
* Selects the nodes with tag ``tag`` filtered by ``filter``, below the node in reference no matter the depth.
* @description This method is a synonym of ``getDescendantByTag``.

@@ -111,3 +111,3 @@ * @param {string} tag - tag name

/**
* Select the SVG nodes with SVG tag ``svgTag`` filtered by ``filter``, below the node in reference no matter the depth.
* Selects the SVG nodes with SVG tag ``svgTag`` filtered by ``filter``, below the node in reference no matter the depth.
* @param {string} svgTag - SVG tag name

@@ -125,3 +125,3 @@ * @param {IFilter} [filter] - filter object

/**
* Select the SVG nodes with SVG tag ``svgTag`` filtered by ``filter``, below the node in reference no matter the depth.
* Selects the SVG nodes with SVG tag ``svgTag`` filtered by ``filter``, below the node in reference no matter the depth.
* @description This method is a synonym of ``getDescendantBySVGTag``.

@@ -141,3 +141,3 @@ * @param {string} svgTag - SVG tag name

/**
* Select the nodes filtered by ``filter``, below the current node, but also returns the node in reference.
* Selects the nodes filtered by ``filter``, below the current node, but also returns the node in reference.
* @param {IFilter} filter - filter object

@@ -154,3 +154,3 @@ * @return {XPathHelper} returns a new instance of XPathHelper

/**
* Select the nodes with tag ``tag`` filtered by ``filter``, below the current node, but also returns the node in reference.
* Selects the nodes with tag ``tag`` filtered by ``filter``, below the current node, but also returns the node in reference.
* @param {string} tag - tag name

@@ -168,3 +168,3 @@ * @param {IFilter} [filter] - filter object

/**
* Select the SVG nodes with SVG tag ``svgTag`` filtered by ``filter``, below the current node, but also returns the node in reference.
* Selects the SVG nodes with SVG tag ``svgTag`` filtered by ``filter``, below the current node, but also returns the node in reference.
* @param {string} svgTag - SVG tag name

@@ -188,3 +188,3 @@ * @param {IFilter} [filter] - filter object

/**
* Select the nodes filtered by ``filter`` immediately below the node in reference.
* Selects the nodes filtered by ``filter`` immediately below the node in reference.
* @param {IFilter} filter - filter object

@@ -198,3 +198,3 @@ * @return {XPathHelper} returns a new instance of XPathHelper

/**
* Select the nodes with tag ``tag`` filtered by ``filter``, immediately below the node in reference.
* Selects the nodes with tag ``tag`` filtered by ``filter``, immediately below the node in reference.
* @param {string} tag - tag name

@@ -212,3 +212,3 @@ * @param {IFilter} [filter] - filter object

/**
* Select the SVG nodes with SVG tag ``svgTag`` filtered by ``filter``, immediately below the node in reference.
* Selects the SVG nodes with SVG tag ``svgTag`` filtered by ``filter``, immediately below the node in reference.
* @param {string} svgTag - SVG tag name

@@ -230,3 +230,3 @@ * @param {IFilter} [filter] - filter object

/**
* Select the nodes filtered by ``filter``,
* Selects the nodes filtered by ``filter``,
* that are ancestors, or the parent, and the parent's parent, and so on, to the node in reference.

@@ -244,3 +244,3 @@ * @param {IFilter} filter - filter object

/**
* Select the nodes with tag ``tag`` filtered by ``filter``,
* Selects the nodes with tag ``tag`` filtered by ``filter``,
* that are ancestors, or the parent, and the parent's parent, and so on, to the node in reference.

@@ -259,3 +259,3 @@ * @param {string} tag - tag name

/**
* Select the SVG nodes with SVG tag ``svgTag`` filtered by ``filter``,
* Selects the SVG nodes with SVG tag ``svgTag`` filtered by ``filter``,
* that are ancestors, or the parent, and the parent's parent, and so on, to the node in reference.

@@ -281,3 +281,3 @@ * @param {string} svgTag - SVG tag name

/**
* Select the nodes filtered by ``filter``,
* Selects the nodes filtered by ``filter``,
* that are ancestors, or the parent, and the parent's parent, and so on, including the node in reference.

@@ -295,3 +295,3 @@ * @param {IFilter} filter - filter object

/**
* Select the nodes with tag ``tag`` filtered by ``filter``,
* Selects the nodes with tag ``tag`` filtered by ``filter``,
* that are ancestors, or the parent, and the parent's parent, and so on, including the node in reference.

@@ -310,3 +310,3 @@ * @param {string} tag - tag name

/**
* Select the SVG nodes with SVG tag ``svgTag`` filtered by ``filter``,
* Selects the SVG nodes with SVG tag ``svgTag`` filtered by ``filter``,
* that are ancestors, or the parent, and the parent's parent, and so on, including the node in reference.

@@ -332,3 +332,3 @@ * @param {string} svgTag - SVG tag name

/**
* Select the nodes filtered by ``filter``, that are located on parent-level
* Selects the nodes filtered by ``filter``, that are located on parent-level
* and also after (following) its parent of the node in reference.

@@ -346,3 +346,3 @@ * @param {IFilter} filter - filter object

/**
* Select the nodes with tag ``tag`` filtered by ``filter``,
* Selects the nodes with tag ``tag`` filtered by ``filter``,
* that are located on parent-level and also after (following) its parent of the node in reference.

@@ -361,3 +361,3 @@ * @param {string} tag - tag name

/**
* Select the SVG nodes with SVG tag ``svgTag`` filtered by ``filter``,
* Selects the SVG nodes with SVG tag ``svgTag`` filtered by ``filter``,
* that are located on parent-level and also after (following) its parent of the node in reference.

@@ -381,3 +381,3 @@ * @param {IFilter} filter - filter object

/**
* Select the nodes filtered by ``filter``,
* Selects the nodes filtered by ``filter``,
* that are located on the same level who are located after (following) the node in reference.

@@ -395,3 +395,3 @@ * @param {IFilter} filter - filter object

/**
* Select the nodes with tag ``tag`` filtered by ``filter``,
* Selects the nodes with tag ``tag`` filtered by ``filter``,
* that are located on the same level who are located after (following) the node in reference.

@@ -410,3 +410,3 @@ * @param {string} tag - tag name

/**
* Select the SVG nodes with SVG tag ``svgTag`` filtered by ``filter``,
* Selects the SVG nodes with SVG tag ``svgTag`` filtered by ``filter``,
* that are located on the same level who are located after (following) the node in reference.

@@ -432,3 +432,3 @@ * @param {string} svgTag - SVG tag name

/**
* Select the nodes filtered by ``filter``, that are located on parent-level
* Selects the nodes filtered by ``filter``, that are located on parent-level
* and also before (preceding) its parent of the node in reference.

@@ -446,3 +446,3 @@ * @param {IFilter} filter - filter object

/**
* Select the nodes with tag ``tag`` filtered by ``filter``,
* Selects the nodes with tag ``tag`` filtered by ``filter``,
* that are located on parent-level and also before (preceding) its parent of the node in reference.

@@ -461,3 +461,3 @@ * @param {string} tag - tag name

/**
* Select the SVG nodes with SVG tag ``svgTag`` filtered by ``filter``,
* Selects the SVG nodes with SVG tag ``svgTag`` filtered by ``filter``,
* that are located on parent-level and also before (preceding) its parent of the node in reference.

@@ -483,3 +483,3 @@ * @param {string} svgTag - SVG tag name

/**
* Select the nodes filtered by ``filter``, that are located on the same level
* Selects the nodes filtered by ``filter``, that are located on the same level
* who are also located before (preceding) the node in reference.

@@ -497,3 +497,3 @@ * @param {IFilter} filter - filter object

/**
* Select the nodes with tag ``tag`` filtered by ``filter``,
* Selects the nodes with tag ``tag`` filtered by ``filter``,
* that are located on the same level who are also located before (preceding) the node in reference.

@@ -512,3 +512,3 @@ * @param {string} tag - tag name

/**
* Select the SVG nodes with SVG tag ``svgTag`` filtered by ``filter``,
* Selects the SVG nodes with SVG tag ``svgTag`` filtered by ``filter``,
* that are located on the same level who are also located before (preceding) the node in reference.

@@ -539,3 +539,3 @@ * @param {string} svgTag - SVG tag name

/**
* Add the given filter to the current xpath expression.
* Adds the given filter to the current xpath expression.
* @private

@@ -542,0 +542,0 @@ * @param {IFilter} [filter]

{
"name": "xpath-helper",
"version": "0.1.1",
"version": "0.1.2",
"description": "A simple and chainnable API to build complicated XPath queries without the hassle.",

@@ -5,0 +5,0 @@ "keywords": ["xpath", "helper", "selenium", "test", "selector", "scraping"],

@@ -40,11 +40,11 @@ <p align="center">

// Find a paragraph <p> containing a CSS class 'very-nice-p'
// Finds a paragraph <p> containing a CSS class 'very-nice-p'
const p = xh.getElementByTag('p', filter.attributeContains('class', 'very-nice-p'));
p.toString(); // "//p[contains(@class, 'very-nice-p')]"
// Find the paragraph that is following the above one
// Finds the paragraph that is following the above one
const nextP = p.getFollowingSiblingByTag('p');
nextP.toString(); // "//p[contains(@class, 'very-nice-p')]/following-sibling::p"
// Find the modal containing a button with text "Register"
// Finds the modal containing a button with text "Register"
const modal = xh

@@ -73,3 +73,3 @@ .getElement(filter.valueEquals('Register'))

***The complete filter API can be found [here](https://jrebecchi.github.io/xpath-helper/javascript/api.html#xpathhelper-xh).***
***The complete JavaScript API can be found [here](https://jrebecchi.github.io/xpath-helper/javascript/api.html#xpathhelper-xh).***

@@ -80,4 +80,4 @@

// Find an element into the page, move to its parent,
// find a brother node of the parent positioned after it.
// Finds an element into the page, moves to its parent,
// finds a brother node of the parent positioned after it.
const el = xh.getElementByTag('p', filter.attributeContains('class', 'very-nice-p'))

@@ -88,5 +88,5 @@ .getParent()

// Find an element into the page, move to its ancestor
// Finds an element into the page, moves to its ancestor
// containing 'very-nice-p' ass CSS class,
// find a brother node of the ancestor positioned before it.
// finds a brother node of the ancestor positioned before it.
el = xh.getElementByTag('p', filter.attributeContains('class', 'very-nice-p'))

@@ -101,7 +101,7 @@ .getAncestorByTag('div')

import { xh, filter } from 'xpath-helper';
// Store the path of a modal window
// Stores the path of a modal window
const modal = xh.getElement(filter.attributeContains('class', 'modal'));
// Find the Submit button inside the modal window
// Finds the Submit button inside the modal window
const submitButton = modal.getElementByTag('button', filter.valueEquals('Submit'));
// Find the Cancel button inside the modal window
// Finds the Cancel button inside the modal window
const cancelButton = modal.getElementByTag('button', filter.valueEquals('Cancel'));

@@ -158,3 +158,3 @@ ```

// Find an element that has a CSS class 'a-link' and contains an attribute href
// Finds an element that has a CSS class 'a-link' and contains an attribute href
let el = xh.getElement(

@@ -167,3 +167,3 @@ filter.attributeContains('class', 'a-link').and(

// Find an element that has a CSS class 'foo' or a CSS class 'bar'
// Finds an element that has a CSS class 'foo' or a CSS class 'bar'
el = xh.getElement(

@@ -176,3 +176,3 @@ filter.attributeContains('class', 'foo').or(

// Build complex logical expression combining and & or
// Builds a complex logical expression combining and & or
el = xh.getElement(

@@ -195,3 +195,3 @@ filter.and(

// Store the path of a modal window
// Stores the path of a modal window
const path = xh.getElementBySVGTag('path',

@@ -202,3 +202,3 @@ filter.attributeEquals('d', 'M 310 130 L 90 130 L 90 183.63')

// Find the Submit button inside the modal window
// Finds the Submit button inside the modal window
const g = xh.getElementBySVGTag('path', filter.attributeEquals('id', 'id-path'))

@@ -205,0 +205,0 @@ .getAncestorBySVGTag('g');

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