MCPcopy Index your code
hub / github.com/vercel/hyper / parse

Function parse

bin/yarn-standalone.js:3290–3309  ·  view source on GitHub ↗
(version, loose)

Source from the content-addressed store, hash-verified

3288
3289exports.parse = parse;
3290function parse(version, loose) {
3291 if (version instanceof SemVer)
3292 return version;
3293
3294 if (typeof version !== 'string')
3295 return null;
3296
3297 if (version.length > MAX_LENGTH)
3298 return null;
3299
3300 var r = loose ? re[LOOSE] : re[FULL];
3301 if (!r.test(version))
3302 return null;
3303
3304 try {
3305 return new SemVer(version, loose);
3306 } catch (er) {
3307 return null;
3308 }
3309}
3310
3311exports.valid = valid;
3312function valid(version, loose) {

Callers 15

validFunction · 0.70
cleanFunction · 0.70
diffFunction · 0.70
prereleaseFunction · 0.70
coerceFunction · 0.70
concatMethod · 0.70
hexDigestMethod · 0.70
matchMethod · 0.70
stringifyFunction · 0.70
fromHexFunction · 0.70
checkDataFunction · 0.70
integrityStreamFunction · 0.70

Calls 15

parseMethod · 0.95
nextMethod · 0.95
_parseFunction · 0.85
stringifyFunction · 0.85
safeLoadFunction · 0.85
isNaNFunction · 0.85
parseIntFunction · 0.85
parserForArrayFormatFunction · 0.85
keysSorterFunction · 0.85
parseCookiePairFunction · 0.85
parseDateFunction · 0.85
testMethod · 0.80

Tested by

no test coverage detected