is-dom-selector
v1.1.0
Published
Validate if a string is a DOM selector
Downloads
3,938
Maintainers
Readme
is-dom-selector
Returns true if passed a valid DOM selector as a string.
Usage
npm install --save is-dom-selector
import isDomSelector from 'is-dom-selector'
isDomSelector('tag') // true
isDomSelector('.class-selector') // true
isDomSelector('#id-selector') // true
isDomSelector('[attribute="value"]') // true
isDomSelector('not $$ valid selector') // false