Skip to content

Commit 56f84e7

Browse files
committed
Fix the scan when the pinned package has a version and has options after it
1 parent af71ded commit 56f84e7

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

lib/importmap/npm.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ def vulnerable_packages
5151
def packages_with_versions
5252
# We cannot use the name after "pin" because some dependencies are loaded from inside packages
5353
# Eg. pin "buffer", to: "https://ga.jspm.io/npm:@jspm/[email protected]/nodelibs/browser/buffer.js"
54-
with_versions = importmap.scan(/^pin .*(?<=npm:|npm\/|skypack\.dev\/|unpkg\.com\/)(.*)(?=@\d+\.\d+\.\d+)@(\d+\.\d+\.\d+(?:[^\/\s["']]*)).*$/) |
54+
with_versions = importmap.scan(/^pin .*(?<=npm:|npm\/|skypack\.dev\/|unpkg\.com\/)([^@\/]+)@(\d+\.\d+\.\d+(?:[^\/\s"']*))/) |
5555
importmap.scan(/#{PIN_REGEX} #.*@(\d+\.\d+\.\d+(?:[^\s]*)).*$/)
5656

5757
vendored_packages_without_version(with_versions).each do |package, path|

0 commit comments

Comments
 (0)