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

Method checkOutdated

packages/insomnia/bin/yarn-standalone.js:32464–32501  ·  view source on GitHub ↗
(config, name, range)

Source from the content-addressed store, hash-verified

32462 }
32463
32464 checkOutdated(config, name, range) {
32465 var _this2 = this;
32466
32467 return (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* () {
32468 const escapedName = NpmRegistry.escapeName(name);
32469 const req = yield _this2.request(escapedName, { unfiltered: true });
32470 if (!req) {
32471 throw new Error(`couldn't find ${name}`);
32472 }
32473
32474 // By default use top level 'repository' and 'homepage' values
32475 let repository = req.repository,
32476 homepage = req.homepage;
32477
32478 const wantedPkg = yield (_npmResolver || _load_npmResolver()).default.findVersionInRegistryResponse(config, escapedName, range, req);
32479
32480 // But some local repositories like Verdaccio do not return 'repository' nor 'homepage'
32481 // in top level data structure, so we fallback to wanted package manifest
32482 if (!repository && !homepage) {
32483 repository = wantedPkg.repository;
32484 homepage = wantedPkg.homepage;
32485 }
32486
32487 let latest = req['dist-tags'].latest;
32488 // In certain cases, registries do not return a 'latest' tag.
32489 if (!latest) {
32490 latest = wantedPkg.version;
32491 }
32492
32493 const url = homepage || repository && repository.url || '';
32494
32495 return {
32496 latest,
32497 wanted: wantedPkg.version,
32498 url
32499 };
32500 })();
32501 }
32502
32503 getPossibleConfigLocations(filename, reporter) {
32504 var _this3 = this;

Callers 1

getOutdatedPackagesMethod · 0.45

Calls 5

_load_asyncToGeneratorFunction · 0.85
_load_npmResolverFunction · 0.85
escapeNameMethod · 0.80
requestMethod · 0.45

Tested by

no test coverage detected