[Pkg-javascript-commits] [node-detective] 16/119: drop the paren requirement for require checking, .toString() to buffers work

Bastien Roucariès rouca at moszumanska.debian.org
Wed Sep 6 09:44:30 UTC 2017


This is an automated email from the git hooks/post-receive script.

rouca pushed a commit to branch master
in repository node-detective.

commit 3c2218d2aff50b7de65fcb8a58860304cc6c5b2f
Author: James Halliday <mail at substack.net>
Date:   Wed Aug 3 15:36:26 2011 -0700

    drop the paren requirement for require checking, .toString() to buffers work
---
 index.js     | 4 ++--
 package.json | 2 +-
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/index.js b/index.js
index 5208762..b7044b5 100644
--- a/index.js
+++ b/index.js
@@ -6,8 +6,8 @@ var exports = module.exports = function (src) {
 
 exports.find = function (src) {
     var modules = { strings : [], expressions : [] };
-
-    if (src.indexOf('require(') == -1) return modules;
+    
+    if (src.toString().indexOf('require') == -1) return modules;
     
     burrito(src, function (node) {
         var isRequire = node.name === 'call'
diff --git a/package.json b/package.json
index 97d4029..f45a746 100644
--- a/package.json
+++ b/package.json
@@ -1,7 +1,7 @@
 {
     "name" : "detective",
     "description" : "Find all calls to require() no matter how crazily nested using a proper walk of the AST",
-    "version" : "0.0.1",
+    "version" : "0.0.2",
     "repository" : {
         "type" : "git",
         "url" : "git://github.com/substack/node-detective.git"

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-javascript/node-detective.git



More information about the Pkg-javascript-commits mailing list