MCPcopy
hub / github.com/vercel/hyper / normalizeRange

Method normalizeRange

bin/yarn-standalone.js:38133–38154  ·  view source on GitHub ↗
(pattern)

Source from the content-addressed store, hash-verified

38131 }
38132
38133 normalizeRange(pattern) {
38134 var _this2 = this;
38135
38136 return (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* () {
38137 if (pattern.indexOf(':') > -1 || pattern.indexOf('@') > -1 || (0, (_index || _load_index()).getExoticResolver)(pattern)) {
38138 return pattern;
38139 }
38140
38141 if (!(_semver || _load_semver()).default.validRange(pattern)) {
38142 try {
38143 if (yield (_fs || _load_fs()).exists((_path || _load_path()).default.join(_this2.config.cwd, pattern, (_constants || _load_constants()).NODE_PACKAGE_JSON))) {
38144 _this2.reporter.warn(_this2.reporter.lang('implicitFileDeprecated', pattern));
38145 return `file:${pattern}`;
38146 }
38147 } catch (err) {
38148 // pass
38149 }
38150 }
38151
38152 return pattern;
38153 })();
38154 }
38155
38156 normalize(pattern) {
38157 var _this3 = this;

Callers 1

normalizeMethod · 0.80

Calls 9

_load_asyncToGeneratorFunction · 0.85
_load_indexFunction · 0.85
_load_semverFunction · 0.85
_load_fsFunction · 0.85
_load_pathFunction · 0.85
_load_constantsFunction · 0.85
indexOfMethod · 0.80
warnMethod · 0.45
langMethod · 0.45

Tested by

no test coverage detected