https://github.com/eddyerburgh/is-dom-selector
JavaScript function to validate a DOM selector
https://github.com/eddyerburgh/is-dom-selector
Last synced: 6 months ago
JSON representation
JavaScript function to validate a DOM selector
- Host: GitHub
- URL: https://github.com/eddyerburgh/is-dom-selector
- Owner: eddyerburgh
- License: mit
- Created: 2017-01-28T16:00:43.000Z (over 9 years ago)
- Default Branch: master
- Last Pushed: 2017-02-09T09:05:38.000Z (over 9 years ago)
- Last Synced: 2025-01-30T20:41:43.981Z (over 1 year ago)
- Language: JavaScript
- Homepage:
- Size: 28.3 KB
- Stars: 1
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
# is-dom-selector [](https://circleci.com/gh/eddyerburgh/is-dom-selector/tree/master)
Returns true if passed a valid DOM selector as a string.
## Usage
```
npm install --save is-dom-selector
```
```js
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
```