[Pkg-javascript-commits] [node-module-deps] 205/444: stop looking for a package.json at a node_modules directory

Bastien Roucariès rouca at moszumanska.debian.org
Fri Dec 15 09:47:56 UTC 2017


This is an automated email from the git hooks/post-receive script.

rouca pushed a commit to branch master
in repository node-module-deps.

commit 568fcc76aaeab1548fa7a483138fed921f391642
Author: James Halliday <mail at substack.net>
Date:   Fri May 9 14:10:55 2014 -0700

    stop looking for a package.json at a node_modules directory
---
 index.js     | 5 +++++
 package.json | 3 ++-
 2 files changed, 7 insertions(+), 1 deletion(-)

diff --git a/index.js b/index.js
index 0e84b37..ad1d14a 100644
--- a/index.js
+++ b/index.js
@@ -329,9 +329,14 @@ Deps.prototype.lookupPackage = function (file, cb) {
     if (cached) return process.nextTick(function () { cb(null, cached) });
     
     var dirs = parents(path.dirname(file));
+    
     (function next () {
         if (dirs.length === 0) return cb(null, undefined);
         var dir = dirs.shift();
+        if (dir.split('/').slice(-1)[0] === 'node_modules') {
+            return cb(null, undefined);
+        }
+        
         var pkgfile = path.join(dir, 'package.json');
         
         var cached = self.pkgFileCachePending[pkgfile];
diff --git a/package.json b/package.json
index ed868e2..ebdd733 100644
--- a/package.json
+++ b/package.json
@@ -15,7 +15,8 @@
     "parents": "0.0.2",
     "resolve": "~0.6.0",
     "through": "~2.3.4",
-    "duplexer2": "0.0.2"
+    "duplexer2": "0.0.2",
+    "right-indexof": "^1.0.0"
   },
   "devDependencies": {
     "tape": "~2.3.2",

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-javascript/node-module-deps.git



More information about the Pkg-javascript-commits mailing list