[Pkg-javascript-commits] [node-module-deps] 76/444: skip parsing json files for requires

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 eea19180e5fb1e91800309fa26e2541162302f30
Author: James Halliday <mail at substack.net>
Date:   Wed May 8 15:56:11 2013 -0700

    skip parsing json files for requires
---
 index.js | 18 ++++++++++++------
 1 file changed, 12 insertions(+), 6 deletions(-)

diff --git a/index.js b/index.js
index 3efdbf3..bdde8a2 100644
--- a/index.js
+++ b/index.js
@@ -99,12 +99,18 @@ module.exports = function (mains, opts) {
     }
     
     function parseDeps (file, src) {
-        try { var deps = detective(src) }
-        catch (ex) {
-            var message = ex && ex.message ? ex.message : ex;
-            return output.emit('error', new Error(
-                'Parsing file ' + file + ': ' + message
-            ));
+        var deps;
+        if (/\.json$/.test(file)) {
+            deps = [];
+        }
+        else {
+            try { deps = detective(src) }
+            catch (ex) {
+                var message = ex && ex.message ? ex.message : ex;
+                return output.emit('error', new Error(
+                    'Parsing file ' + file + ': ' + message
+                ));
+            }
         }
         var p = deps.length;
         var current = { id: file, filename: file, paths: [] };

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