Skip to content

Commit 5eb0258

Browse files
committed
test(coverage): c8-ignore unreachable recursive-prefix branch in pathRelativeToTarget
`recursiveTargetPrefix = \`${targetPrefix}**/\`` so any path matching `startsWith(recursiveTargetPrefix)` ALSO matches the earlier `startsWith(targetPrefix)` check on line 145 — the line-149 branch is dead code. Added c8-ignore + explanation.
1 parent 500b358 commit 5eb0258

1 file changed

Lines changed: 1 addition & 0 deletions

File tree

packages/cli/src/commands/scan/exclude-paths.mts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -145,6 +145,7 @@ export function pathRelativeToTarget(
145145
if (normalized.startsWith(targetPrefix)) {
146146
return normalized.slice(targetPrefix.length)
147147
}
148+
/* c8 ignore next 4 - unreachable: recursiveTargetPrefix = `${targetPrefix}**\/` so any startsWith(recursiveTargetPrefix) match would have been caught by the startsWith(targetPrefix) check above. */
148149
const recursiveTargetPrefix = `${targetPrefix}**/`
149150
if (normalized.startsWith(recursiveTargetPrefix)) {
150151
return normalized.slice(targetPrefix.length)

0 commit comments

Comments
 (0)