Skip to content

Commit 5dbe279

Browse files
committed
rename function
1 parent 0aa0891 commit 5dbe279

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

lib/utils/regexp-ast/case-variation.ts

+4-4
Original file line numberDiff line numberDiff line change
@@ -146,7 +146,7 @@ export function isCaseVariant(
146146
// we need to check whether the associated capturing group
147147
// is case variant
148148

149-
const outside = getActualReferencedGroupOfBackreference(
149+
const outside = getReferencedGroupsFromBackreference(
150150
d,
151151
).filter(
152152
(resolved) => !hasSomeDescendant(element, resolved),
@@ -193,15 +193,15 @@ export function isCaseVariant(
193193
}
194194

195195
/**
196-
* Gets the groups in the same Alternative that the given Backreference refers to.
196+
* Returns the actually referenced capturing group from the given backreference.
197197
*/
198-
function getActualReferencedGroupOfBackreference(
198+
function getReferencedGroupsFromBackreference(
199199
backRef: Backreference,
200200
): CapturingGroup[] {
201201
return [backRef.resolved].flat().filter((group) => {
202202
const closestAncestor = getClosestAncestor(backRef, group)
203203
return (
204-
closestAncestor === group || closestAncestor.type === "Alternative"
204+
closestAncestor !== group && closestAncestor.type === "Alternative"
205205
)
206206
})
207207
}

0 commit comments

Comments
 (0)