MCPcopy
hub / github.com/npm/node-semver / parse

Function parse

functions/parse.js:4–16  ·  view source on GitHub ↗
(version, options, throwErrors = false)

Source from the content-addressed store, hash-verified

2
3const SemVer = require('../classes/semver')
4const parse = (version, options, throwErrors = false) => {
5 if (version instanceof SemVer) {
6 return version
7 }
8 try {
9 return new SemVer(version, options)
10 } catch (er) {
11 if (!throwErrors) {
12 return null
13 }
14 throw er
15 }
16}
17
18module.exports = parse

Callers 12

truncate.jsFile · 0.85
parse.jsFile · 0.85
coerce.jsFile · 0.85
inc.jsFile · 0.85
diffFunction · 0.85
cloneInputVersionFunction · 0.85
validFunction · 0.85
cleanFunction · 0.85
prereleaseFunction · 0.85
coerceFunction · 0.85
bench-parse.jsFile · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected