mirror of
https://github.com/x1xhlol/system-prompts-and-models-of-ai-tools.git
synced 2025-09-15 12:27:30 +00:00
19 lines
331 B
JavaScript
19 lines
331 B
JavaScript
'use strict'
|
|
|
|
const SemVer = require('../classes/semver')
|
|
const parse = (version, options, throwErrors = false) => {
|
|
if (version instanceof SemVer) {
|
|
return version
|
|
}
|
|
try {
|
|
return new SemVer(version, options)
|
|
} catch (er) {
|
|
if (!throwErrors) {
|
|
return null
|
|
}
|
|
throw er
|
|
}
|
|
}
|
|
|
|
module.exports = parse
|