[Pkg-javascript-commits] [node-module-deps] 298/444: do not apply transforms to opts.modules entries

Bastien Roucariès rouca at moszumanska.debian.org
Fri Dec 15 09:48:07 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 7f7aca3162e1bab87abf65f92889ae370a7e2ddd
Author: James Halliday <mail at substack.net>
Date:   Thu Jul 24 21:56:40 2014 -0700

    do not apply transforms to opts.modules entries
---
 index.js | 17 ++++++++++++-----
 1 file changed, 12 insertions(+), 5 deletions(-)

diff --git a/index.js b/index.js
index 259fd48..6720d6c 100644
--- a/index.js
+++ b/index.js
@@ -139,7 +139,7 @@ Deps.prototype.readFile = function (file, id, pkg) {
     var rs = fs.createReadStream(file);
     rs.on('error', function (err) { tr.emit('error', err) });
     this.emit('file', file, id);
-    return rs.pipe(this.getTransforms(file, pkg));
+    return rs;
 };
 
 Deps.prototype.getTransforms = function (file, pkg) {
@@ -286,9 +286,16 @@ Deps.prototype.walk = function (id, parent, cb) {
         var c = self.cache && self.cache[file];
         if (c) return fromDeps(file, c.source, c.package, Object.keys(c.deps));
         
-        self.readFile(file, id, pkg).pipe(concat(function (body) {
-            fromSource(body.toString('utf8'));
-        }));
+        self.readFile(file, id, pkg)
+            .pipe(
+                has(parent.modules, id)
+                ? through()
+                : self.getTransforms(file, pkg)
+            )
+            .pipe(concat(function (body) {
+                fromSource(body.toString('utf8'));
+            }))
+        ;
         
         function fromSource (src) {
             var deps = rec.noparse ? [] : self.parseDeps(file, src);
@@ -448,7 +455,7 @@ function xhas (obj) {
 }
 
 function has (obj, key) {
-    return Object.prototype.hasOwnProperty.call(obj, key);
+    return obj && Object.prototype.hasOwnProperty.call(obj, key);
 }
 
 function wrapTransform (tr) {

-- 
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