MCPcopy
hub / github.com/Kong/insomnia / parse

Function parse

packages/insomnia/bin/yarn-standalone.js:3188–3207  ·  view source on GitHub ↗
(version, loose)

Source from the content-addressed store, hash-verified

3186
3187exports.parse = parse;
3188function parse(version, loose) {
3189 if (version instanceof SemVer)
3190 return version;
3191
3192 if (typeof version !== 'string')
3193 return null;
3194
3195 if (version.length > MAX_LENGTH)
3196 return null;
3197
3198 var r = loose ? re[LOOSE] : re[FULL];
3199 if (!r.test(version))
3200 return null;
3201
3202 try {
3203 return new SemVer(version, loose);
3204 } catch (er) {
3205 return null;
3206 }
3207}
3208
3209exports.valid = valid;
3210function valid(version, loose) {

Callers 15

convertFunction · 0.85
automock.test.tsFile · 0.85
GraphQLEditorFunction · 0.85
changeQueryFunction · 0.85
validFunction · 0.85
cleanFunction · 0.85
diffFunction · 0.85
prereleaseFunction · 0.85
coerceFunction · 0.85
concatMethod · 0.85
hexDigestMethod · 0.85
matchMethod · 0.85

Calls 15

parseMethod · 0.95
nextMethod · 0.95
_parseFunction · 0.85
stringifyFunction · 0.85
clearStateCharFunction · 0.85
globUnescapeFunction · 0.85
isNaNFunction · 0.85
parseIntFunction · 0.85
parserForArrayFormatFunction · 0.85
keysSorterFunction · 0.85
parseCookiePairFunction · 0.85
parseDateFunction · 0.85

Tested by

no test coverage detected