angrykoala / is-xpath

Checks if string is an XPath

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

is-xpath

by @angrykoala

Tests if a string is a xPath. This is not a full xPath validation, but a simple way of figuring out if a given string is an xPath or css selector.

  • Works on Node.js and Browser.
  • No DOM.
  • No Dependencies.

Warning: This package does not provide full guarantee that the xPath is valid. This package is intended for code trying to check if a string is an xPath selector or css selector.

const isXPath=require('is-xpath');

isXPath("/p"); // true
isXPath(".p"); // false

License

This projects is under GPL-3.0 License

About

Checks if string is an XPath

License:GNU General Public License v3.0


Languages

Language:JavaScript 100.0%