[Pkg-javascript-commits] [node-module-deps] 72/444: should not need to resolve the file before filtering it

Bastien Roucariès rouca at moszumanska.debian.org
Fri Dec 15 09:47:44 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 2a972322acd0c4f0101fa3cf8d11c8e235c90d73
Author: Dominic Tarr <dominic.tarr at gmail.com>
Date:   Thu Apr 25 13:36:10 2013 +0100

    should not need to resolve the file before filtering it
---
 index.js | 10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)

diff --git a/index.js b/index.js
index df6abec..aa11623 100644
--- a/index.js
+++ b/index.js
@@ -51,10 +51,6 @@ module.exports = function (mains, opts) {
             return pkg;
         };
         
-        if(opts.filter && !opts.filter(id)) {
-            if(cb) cb(false);
-            if (--pending === 0) output.queue(null);
-        }
         resolve(id, parent, function (err, file) {
             if (err) return output.emit('error', err);
             if (!file) return output.emit('error', new Error([
@@ -115,6 +111,12 @@ module.exports = function (mains, opts) {
         var resolved = {};
         
         deps.forEach(function (id) {
+            if(opts.filter && !opts.filter(id)) {
+                resolved[id] = false;
+                if (--p === 0) done();
+                return;
+            }
+
             walk(id, current, function (r) {
                 resolved[id] = r;
                 if (--p === 0) done();

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