Skip to content

Commit 51a9ce5

Browse files
committed
fix: enforce 'jsr:' prefix for import specifiers
Also replaces String.prototype.substr with #slice as the API is considered legacy.
1 parent 2cd09dd commit 51a9ce5

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

lib/npa.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ function isJsrSpec (spec) {
8282
if (!spec) {
8383
return false
8484
}
85-
return spec.toLowerCase().startsWith('jsr:')
85+
return spec.startsWith('jsr:')
8686
}
8787

8888
function resolve (name, spec, where, arg) {
@@ -464,7 +464,7 @@ function fromAlias (res, where) {
464464

465465
function fromJsr (res, where) {
466466
// Remove 'jsr:' prefix
467-
const jsrSpec = res.rawSpec.substr(4)
467+
const jsrSpec = res.rawSpec.slice(4)
468468

469469
// Parse the JSR specifier to extract name and version
470470
// JSR format: @scope/name or @scope/name@version

0 commit comments

Comments
 (0)