MCPcopy Index your code
hub / github.com/nodejs/node / parseRange

Function parseRange

test/fixtures/snapshot/typescript.js:3473–3497  ·  view source on GitHub ↗
(text)

Source from the content-addressed store, hash-verified

3471 // caret ::= '^' partial
3472 var rangeRegExp = /^(~|\^|<|<=|>|>=|=)?\s*([a-z0-9-+.*]+)$/i;
3473 function parseRange(text) {
3474 var alternatives = [];
3475 for (var _i = 0, _a = ts.trimString(text).split(logicalOrRegExp); _i < _a.length; _i++) {
3476 var range = _a[_i];
3477 if (!range)
3478 continue;
3479 var comparators = [];
3480 range = ts.trimString(range);
3481 var match = hyphenRegExp.exec(range);
3482 if (match) {
3483 if (!parseHyphen(match[1], match[2], comparators))
3484 return undefined;
3485 }
3486 else {
3487 for (var _b = 0, _c = range.split(whitespaceRegExp); _b < _c.length; _b++) {
3488 var simple = _c[_b];
3489 var match_1 = rangeRegExp.exec(ts.trimString(simple));
3490 if (!match_1 || !parseComparator(match_1[1], match_1[2], comparators))
3491 return undefined;
3492 }
3493 }
3494 alternatives.push(comparators);
3495 }
3496 return alternatives;
3497 }
3498 function parsePartial(text) {
3499 var match = partialRegExp.exec(text);
3500 if (!match)

Callers 2

VersionRangeFunction · 0.85
typescript.jsFile · 0.85

Calls 5

parseHyphenFunction · 0.85
parseComparatorFunction · 0.85
splitMethod · 0.45
execMethod · 0.45
pushMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…