Skip to content

Commit 4cd7454

Browse files
minor update
1 parent ad71f9d commit 4cd7454

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

lib/core/utils/get-ancestry.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ import getShadowSelector from './get-shadow-selector';
33
function generateAncestry(node) {
44
const nodeName = node.nodeName.toLowerCase();
55
const parentElement = node.parentElement;
6+
// eslint-disable-next-line no-unused-vars
67
const parentNode = node.parentNode;
78

89
let nthChild = '';
@@ -31,7 +32,7 @@ function generateAncestry(node) {
3132
}
3233
nthChild = count > 1 ? `:nth-child(${index})` : '';
3334
} else {
34-
index = Array.prototype.indexOf.call(parentNode.children, node) + 1;
35+
index = Array.prototype.indexOf.call(parentElement.children, node) + 1;
3536
nthChild = `:nth-child(${index})`;
3637
}
3738
}

0 commit comments

Comments
 (0)