Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix outdated command breaks on previous comment format #50

Merged
merged 6 commits into from
Feb 4, 2024
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Handle packages that have an at symbol at the name
tonysm committed Feb 4, 2024
commit e68f2bfe7bae3031100d14668694e2c85dbb0dec
2 changes: 1 addition & 1 deletion src/Npm.php
Original file line number Diff line number Diff line change
@@ -95,7 +95,7 @@ private function findPackagesFromCdnMatches(string $content)

private function findPackagesFromLocalMatches(string $content)
{
preg_match_all('/^Importmap::pin\([\'\"](.+?)[\'\"].*\)\;\s*\/\/\s*.*@(.+?)\s+.*\r?$/m', $content, $matches);
preg_match_all('/^Importmap::pin\([\'\"](.+?)[\'\"].*\)\;\s*\/\/\s*.*@(\d+\.\d+\.\d+.*?)\s+.*\r?$/m', $content, $matches);

if (count($matches) !== 3) {
return collect();