Skip to content
This repository was archived by the owner on Jun 19, 2026. It is now read-only.

Commit 170d9b9

Browse files
committed
fix(scan): fix yarn.lock scoped package parsing in PowerShell
The regex for non-scoped packages was incorrectly matching scoped packages due to PowerShell -or evaluation order. By checking the scoped package pattern (@scope/name) first, we ensure correct parsing. This mirrors the fix from PR #65 for the bash script.
1 parent ce56541 commit 170d9b9

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

scripts/shai-hulud-repo-check.ps1

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -287,8 +287,8 @@ function Parse-YarnLock {
287287

288288
$currentPkg = ""
289289
foreach ($line in $content) {
290-
# Package header line
291-
if ($line -match '^"?([^@][^"@]*)@' -or $line -match '^"?(@[^/]+/[^@"]+)@') {
290+
# Package header line - check scoped packages (@scope/name) FIRST to avoid false matches
291+
if ($line -match '^"?(@[^/]+/[^@"]+)@' -or $line -match '^"?([^@][^"@]*)@') {
292292
$currentPkg = $matches[1]
293293
}
294294
# Version line

0 commit comments

Comments
 (0)