Skip to content

Commit d2a9cb3

Browse files
Copilotweshaggard
authored andcommitted
Simplify regex pattern as suggested by weshaggard
Co-authored-by: weshaggard <[email protected]>
1 parent 688624d commit d2a9cb3

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

eng/common/scripts/Verify-Links.ps1

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -168,7 +168,7 @@ function ProcessNpmLink([System.Uri]$linkUri) {
168168
# Handle non-versioned URLs: https://www.npmjs.com/package/@azure/ai-agents -> https://registry.npmjs.org/@azure/ai-agents
169169
# The regex captures the package name (which may contain a slash for scoped packages) and optionally the version
170170
$urlString = $linkUri.ToString()
171-
if ($urlString -match '^https?://(?:www\.)?npmjs\.com/package/([^/]+(?:/[^/]+)?)/v/(.+)$') {
171+
if ($urlString -match '^https?://(?:www\.)?npmjs\.com/package/(.+)/v/(.+)$') {
172172
# Versioned URL: remove the /v/ segment but keep the version
173173
$apiUrl = "https://registry.npmjs.org/$($matches[1])/$($matches[2])"
174174
}

0 commit comments

Comments
 (0)