Skip to content

Commit 7afcf79

Browse files
committed
Updating documentation
1 parent 9cfbe8d commit 7afcf79

File tree

2 files changed

+11
-2
lines changed

2 files changed

+11
-2
lines changed

README.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ This is particularly useful when tracking in custom variables in analytics:
1515
_gaq.push(['_trackEvent', 'Engagement', 'Click', selector]);
1616
}, false);
1717

18+
Selector uniqueness is determined based on the given element's root node. Elements rendered within Shadow DOM will derive a selector unique within the associated ShadowRoot context. Otherwise, a selector unique within an element's owning document will be derived.
1819

1920
Installation
2021
------------
@@ -74,6 +75,11 @@ Eric Clemmons : [@ericclemmons](https://twitter.com/ericclemmons)
7475

7576
Releases
7677
--------
78+
79+
- v2.1.0
80+
81+
-
82+
7783
- v0.1.0
7884

7985
- Big refactor/rewrite using es6

src/isUnique.js

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,11 @@
11
/**
2-
* Checks if the selector is unique
2+
* Checks if the selector is unique. The selector is unique
3+
* if the elements root node (either its owner document, or a shadow root)
4+
* has exactly one element matching the selector.
5+
*
36
* @param { Object } element
47
* @param { String } selector
5-
* @return { Array }
8+
* @return { Boolean }
69
*/
710
export function isUnique( el, selector )
811
{

0 commit comments

Comments
 (0)