[Pkg-javascript-commits] [node-module-deps] 33/444: coerce opts.transform to an array

Bastien Roucariès rouca at moszumanska.debian.org
Fri Dec 15 09:47:40 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 a8a7e329307ed7d39b0ed462c84d6cf03ca2aab0
Author: James Halliday <mail at substack.net>
Date:   Wed Feb 27 04:07:04 2013 -0800

    coerce opts.transform to an array
---
 index.js | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/index.js b/index.js
index 7f78a39..cc501b9 100644
--- a/index.js
+++ b/index.js
@@ -21,7 +21,8 @@ module.exports = function (mains, opts) {
     
     if (!opts) opts = {};
     if (opts.cache === undefined) opts.cache = cache;
-    if (!opts.transform) opts.transform = [];
+    var transforms = [].concat(opts.transform).filter(Boolean);
+    
     var resolve = opts.resolve || browserResolve;
     opts.includeSource = true;
     
@@ -78,7 +79,7 @@ module.exports = function (mains, opts) {
                 ap(trs.slice(1));
             });
             ps.stdin.end(src);
-        })(opts.transform.slice());
+        })(transforms.slice());
         
         function done () {
             parseDeps(file, src);

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