• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

package-url / packageurl-go / 32365331253
89%
master: 89%

Build:
Build:
LAST BUILD BRANCH: type-constants
DEFAULT BRANCH: master
Ran 20 Aug 2026 11:48AM UTC
Jobs 2
Files 1
Run time 1min
Badge
Embed ▾
README BADGES
x

If you need to use a raster PNG badge, change the '.svg' to '.png' in the link

Markdown

Textile

RDoc

HTML

Rst

20 Aug 2026 11:44AM UTC coverage: 88.889% (+0.07%) from 88.821%
32365331253

Pull #95

github

petergardfjall
Reject npm purl with bare scope and no name

Since v0.1.5, separateNamespaceNameVersion skips the missing-name guard
for npm so that scoped packages such as "pkg:npm/@babel/core" parse. That
exception is too broad: a remainder like "@4.17.21" has a leading '@' but
no '/', so it is a bare scope with no name, yet it was accepted with
name="@4.17.21" and no error. In v0.1.3 the same input correctly returned
"purl is missing name".

Add a narrow npm-only guard: when the remainder starts with '@' and
contains no '/', there is no scope/name separator, so return the
missing-name error. Valid scoped forms ("pkg:npm/@scope/name@1.0.0") and
unscoped forms ("pkg:npm/lodash@4.17.21") are unaffected because they
either contain a '/' or do not start with '@'. Other purl types are
untouched: they already reject a leading '@' through the existing guard.

Add TestNpmScopeWithoutName covering the regression and the valid cases.

Fixes #91

Signed-off-by: Arpit Jain <arpitjain099@gmail.com>
Pull Request #95: Reject npm purl with bare scope and no name

3 of 3 new or added lines in 1 file covered. (100.0%)

440 of 495 relevant lines covered (88.89%)

1316.68 hits per line

Jobs
ID Job ID Ran Files Coverage
1 32365331253.1 20 Aug 2026 11:48AM UTC 1
88.89
GitHub Action Run
2 32365331253.2 20 Aug 2026 11:49AM UTC 1
88.89
GitHub Action Run
Source Files on build 32365331253
  • Tree
  • List 1
  • Changed 1
  • Source Changed 0
  • Coverage Changed 1
Coverage ∆ File Lines Relevant Covered Missed Hits/Line
  • Back to Repo
  • Pull Request #95
  • PR Base - master (#32361826075)
  • Delete
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE TRIAL · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc