Skip to content

Commit

Permalink
add exclude regex for ID and class names (#35)
Browse files Browse the repository at this point in the history
  • Loading branch information
patmood authored and AvraamMavridis committed Nov 19, 2018
1 parent 021c8df commit 43b867e
Show file tree
Hide file tree
Showing 4 changed files with 4,418 additions and 6 deletions.
18 changes: 16 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ Options
------------
e.g.1 DomElement = `<span id="test"></span>`

```
```
import unique from 'unique-selector';
// Optional Options
Expand All @@ -51,13 +51,27 @@ options = {
unique( DomElement, options ); // [test="2"]
```

e.g.3 DomElement = `<div id="xyz" class="abc test"></div>`

```
import unique from 'unique-selector';
// Optional Options
options = {
// Regular expression of ID and class names to ignore
excludeRegex : RegExp( 'xyz|abc' )
}
unique( DomElement, options ); // .test
```


Tests
-----

$ npm run test


Contributing
-----
Feel free to open issues, make suggestions or send PRs.
Expand Down
Loading

0 comments on commit 43b867e

Please sign in to comment.