[Pkg-javascript-commits] [node-module-deps] 87/444: also check isBuffer()

Bastien Roucariès rouca at moszumanska.debian.org
Fri Dec 15 09:47:45 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 f2947045433c583883c0da8daab75cb7c37a8966
Author: James Halliday <mail at substack.net>
Date:   Thu May 30 06:54:25 2013 -0700

    also check isBuffer()
---
 index.js | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/index.js b/index.js
index 6ef5e40..6649ef2 100644
--- a/index.js
+++ b/index.js
@@ -53,8 +53,9 @@ module.exports = function (mains, opts) {
             return pkg;
         };
         
-        var resolver = opts.cache && typeof opts.cache[parent.id] === 'object'
-        && opts.cache[parent.id].deps[id]
+        var c = opts.cache && opts.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]);
             }
@@ -113,7 +114,7 @@ module.exports = function (mains, opts) {
     
     function parseDeps (file, src) {
         var deps;
-        if (typeof src === 'object') {
+        if (!Buffer.isBuffer(src) && typeof src === 'object') {
             deps = Object.keys(src.deps);
             src = src.source;
         }

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