Skip to content

Commit

Permalink
fix: optimistic parse (#541)
Browse files Browse the repository at this point in the history
  • Loading branch information
H4ad committed Apr 10, 2023
1 parent 796cbe2 commit f8b8b61
Showing 1 changed file with 0 additions and 10 deletions.
10 changes: 0 additions & 10 deletions functions/parse.js
@@ -1,11 +1,6 @@
const { MAX_LENGTH } = require('../internal/constants')
const { re, t } = require('../internal/re')
const SemVer = require('../classes/semver')

const parseOptions = require('../internal/parse-options')
const parse = (version, options) => {
options = parseOptions(options)

if (version instanceof SemVer) {
return version
}
Expand All @@ -18,11 +13,6 @@ const parse = (version, options) => {
return null
}

const r = options.loose ? re[t.LOOSE] : re[t.FULL]
if (!r.test(version)) {
return null
}

try {
return new SemVer(version, options)
} catch (er) {
Expand Down

0 comments on commit f8b8b61

Please sign in to comment.