We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent fb759d6 commit b27081fCopy full SHA for b27081f
src/utils/pkg.ts
@@ -3,6 +3,8 @@ import * as semver from "./semver.ts"
3
4
/// allows inputs `nodejs.org@16` when `semver.parse` would reject
5
export function parse(input: string): PackageRequirement {
6
+ input = input.trim()
7
+
8
const match = input.match(/^(.+?)([\^=~<>@].+)?$/)
9
if (!match) throw new Error(`invalid pkgspec: ${input}`)
10
if (!match[2]) match[2] = "*"
0 commit comments