diff options
author | Rebecca Turner <me@re-becca.org> | 2017-04-13 02:20:08 +0300 |
---|---|---|
committer | Kat Marchán <kzm@sykosomatic.org> | 2017-04-28 01:02:14 +0300 |
commit | cbaf1c914036bc8ac1f9ea965ccba4fd690c8c45 (patch) | |
tree | 496b4daad1ecec5a4f00d31545df8359bcb0bf71 /lib/outdated.js | |
parent | 319f861d421877446c5896e1b8b6bba2f34b717c (diff) |
*: Patch to support npm-package-arg@5
Diffstat (limited to 'lib/outdated.js')
-rw-r--r-- | lib/outdated.js | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/lib/outdated.js b/lib/outdated.js index 546d14b13..01cf39d10 100644 --- a/lib/outdated.js +++ b/lib/outdated.js @@ -292,7 +292,7 @@ function outdated_ (args, path, tree, parentHas, depth, cb) { var required = (tree.package.dependencies)[name] || (tree.package.optionalDependencies)[name] || (tree.package.devDependencies)[name] || - dep.package._requested && dep.package._requested.spec || + dep.package._requested && dep.package._requested.fetchSpec || '*' if (!long) return shouldUpdate(args, dep, name, has, required, depth, path, cb) @@ -327,7 +327,7 @@ function shouldUpdate (args, tree, dep, has, req, depth, pkgpath, cb, type) { } if (args.length && args.indexOf(dep) === -1) return skip() - var parsed = npa(dep + '@' + req) + var parsed = npa.resolve(dep, req) if (tree.isLink && tree.parent && tree.parent.isTop) { return doIt('linked', 'linked') } @@ -343,7 +343,7 @@ function shouldUpdate (args, tree, dep, has, req, depth, pkgpath, cb, type) { }) function updateLocalDeps (latestRegistryVersion) { - readJson(path.resolve(parsed.spec, 'package.json'), function (er, localDependency) { + readJson(path.resolve(parsed.fetchSpec, 'package.json'), function (er, localDependency) { if (er) return cb() var wanted = localDependency.version @@ -367,7 +367,7 @@ function shouldUpdate (args, tree, dep, has, req, depth, pkgpath, cb, type) { function updateDeps (er, d) { if (er) { - if (parsed.type !== 'local') return cb(er) + if (parsed.type !== 'directory' && parsed.type !== 'file') return cb(er) return updateLocalDeps() } @@ -413,7 +413,7 @@ function shouldUpdate (args, tree, dep, has, req, depth, pkgpath, cb, type) { dFromUrl && cFromUrl && d._from !== curr.from || d.version !== curr.version || d.version !== l.version) { - if (parsed.type === 'local') return updateLocalDeps(l.version) + if (parsed.type === 'file' || parsed.type === 'directory') return updateLocalDeps(l.version) doIt(d.version, l.version) } else { |