[Pkg-javascript-commits] [node-module-deps] 112/444: use a package cache to hold onto package.json entries

Bastien Roucariès rouca at moszumanska.debian.org
Fri Dec 15 09:47:47 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 d5c2e1c8cdc25384bec5631ca500ea0b8360e88a
Author: James Halliday <mail at substack.net>
Date:   Wed Jul 3 20:39:57 2013 -0700

    use a package cache to hold onto package.json entries
---
 index.js | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/index.js b/index.js
index 98d070b..d7625be 100644
--- a/index.js
+++ b/index.js
@@ -11,6 +11,7 @@ var concat = require('concat-stream');
 module.exports = function (mains, opts) {
     if (!opts) opts = {};
     var cache = opts.cache;
+    var pkgCache = opts.packageCache;
     
     if (!Array.isArray(mains)) mains = [ mains ].filter(Boolean);
     var basedir = opts.basedir || process.cwd();
@@ -65,11 +66,12 @@ module.exports = function (mains, opts) {
             }));
         }
         
-        var c = opts.cache && opts.cache[parent.id];
+        var c = cache && cache[parent.id];
         var resolver = c && typeof c === 'object'
         && !Buffer.isBuffer(c) && c.deps[id]
             ? function (xid, xparent, cb) {
-                cb(null, opts.cache[parent.id].deps[id]);
+                var file = cache[parent.id].deps[id];
+                cb(null, file, pkgCache && pkgCache[file]);
             }
             : resolve;
         ;

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