[Pkg-javascript-commits] [node-detective] 21/119: pass in the word as a parameter instead

Bastien Roucariès rouca at moszumanska.debian.org
Wed Sep 6 09:44:31 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 f1b94a8ea2ff7d61400f8d3692c35a719faebaf6
Author: James Halliday <mail at substack.net>
Date:   Fri Nov 25 18:51:27 2011 -0800

    pass in the word as a parameter instead
---
 index.js | 14 ++++++--------
 1 file changed, 6 insertions(+), 8 deletions(-)

diff --git a/index.js b/index.js
index ba0d287..0dfb5e1 100644
--- a/index.js
+++ b/index.js
@@ -1,11 +1,13 @@
 var burrito = require('burrito');
-var word = 'require';
 
-var exports = module.exports = function (src) {
-    return exports.find(src).strings;
+var exports = module.exports = function (src, opts) {
+    return exports.find(src, opts).strings;
 };
 
-exports.find = function (src) {
+exports.find = function (src, opts) {
+    if (!opts) opts = {};
+    var word = opts.word === undefined ? 'require' : opts.word;
+    
     var modules = { strings : [], expressions : [] };
     
     if (src.toString().indexOf(word) == -1) return modules;
@@ -61,7 +63,3 @@ exports.find = function (src) {
     
     return modules;
 };
-
-exports.set = function (value) {
-    word = value;  
-};

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