Socket
Book a DemoInstallSign in
Socket

xpath-has-class

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

xpath-has-class

Utility functions to help you write parts of xpaths for DOM, more spcificaly hasClass

1.0.3
latest
Source
npmnpm
Version published
Weekly downloads
0
Maintainers
1
Weekly downloads
 
Created
Source

xpath-has-class

  • functions that help you to create xpaths, more specifically shortcuts for writing contains(concat(' ', normalize-space(@class), ' '), ' "+className+" ') and similar

API


hasClass = require('xpath-has-class');

hasClass.one("foo");
//returns "contains(concat(' ', normalize-space(@class), ' '), ' foo ')"

hasClass.notOne("foo");
//would be the same as 
hasClass.not( hasClass.one("foo") );
//returns "not(contains(concat(' ', normalize-space(@class), ' '), ' foo '))"

hasClass.all(["bar","bar-foo"]);
//returns "contains(concat(' ', normalize-space(@class), ' '), ' bar ') and contains(concat(' ', normalize-space(@class), ' '), ' bar-foo ')";"

To sum up, there are methods:

  • not
  • one
  • notOne

And a few, where you need to pass an array:

  • all
  • some
  • notAny

Keywords

xpath

FAQs

Package last updated on 18 Feb 2016

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

About

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.

  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc

U.S. Patent No. 12,346,443 & 12,314,394. Other pending.