[Pkg-javascript-commits] [node-module-deps] 371/444: Readability improvement

Bastien Roucariès rouca at moszumanska.debian.org
Fri Dec 15 09:48:14 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 3533caca8b2f1ff0639990099618d2052927f14c
Author: Andres Suarez <zertosh at gmail.com>
Date:   Tue May 5 14:10:25 2015 -0400

    Readability improvement
    
    Pull `fromSource` in `walk`'s resolve callback into the same scope
    level as `fromDeps`.
---
 index.js | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/index.js b/index.js
index 8e88f34..fc2ede6 100644
--- a/index.js
+++ b/index.js
@@ -332,7 +332,7 @@ Deps.prototype.walk = function (id, parent, cb) {
             var ts = self.getTransforms(file, pkg);
             ts.pipe(concat(function (body) {
                 rec.source = body.toString('utf8');
-                fromSource(rec.source);
+                fromSource(file, rec.source, pkg);
             }));
             return ts.end(rec.source);
         }
@@ -354,7 +354,7 @@ Deps.prototype.walk = function (id, parent, cb) {
             var ts = self.getTransforms(file, pkg);
             ts.pipe(concat(function (body) {
                 rec.source = body.toString('utf8');
-                fromSource(rec.source);
+                fromSource(file, rec.source, pkg);
             }));
             return ts.end(rec.source);
         }
@@ -367,15 +367,15 @@ Deps.prototype.walk = function (id, parent, cb) {
                 builtin: has(parent.modules, id)
             }))
             .pipe(concat(function (body) {
-                fromSource(body.toString('utf8'));
+                fromSource(file, body.toString('utf8'), pkg);
             }))
         ;
-        
-        function fromSource (src) {
-            var deps = rec.noparse ? [] : self.parseDeps(file, src);
-            if (deps) fromDeps(file, src, pkg, deps);
-        }
     });
+
+    function fromSource (file, src, pkg) {
+        var deps = rec.noparse ? [] : self.parseDeps(file, src);
+        if (deps) fromDeps(file, src, pkg, deps);
+    }
     
     function fromDeps (file, src, pkg, deps) {
         var p = deps.length;

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