source: node_modules/semver/functions/parse.js@ 81bc7da

finki-main main
Last change on this file since 81bc7da was 81bc7da, checked in by Klimentina Efremova <klimentina08642@…>, 3 months ago

Initial commit

  • Property mode set to 100644
File size: 331 bytes
Line 
1'use strict'
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
Note: See TracBrowser for help on using the repository browser.