Commit b6225ea
src/deps.ts
@@ -98,8 +98,7 @@ const builtins = new Set([
'zlib',
])
-const nameRe =
- /^(?<name>(@[a-z0-9-~][a-z0-9-._~]*\/)?[a-z0-9-~][a-z0-9-._~]*)\/?.*$/i
+const nameRe = /^(?<name>(@[a-z\d-~][\w-.~]*\/)?[a-z\d-~][\w-.~]*)\/?.*$/i
const versionRe = /^@(?<version>[~^]?(v?[\dx*]+([-.][\d*a-z-]+)*))/i
export function parseDeps(content: Buffer | string): Record<string, string> {
src/util.ts
@@ -265,7 +265,7 @@ export function formatCmd(cmd?: string): string {
}
function word() {
- if (/[0-9a-z/_.]/i.test(ch)) return word
+ if (/[\w/.]/i.test(ch)) return word
return root
}