[Pkg-javascript-commits] [node-detective] 45/119: now works with shebang lines
Bastien Roucariès
rouca at moszumanska.debian.org
Wed Sep 6 09:44:33 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 2487a7b04e74ceaa4ff1a65dddba888c166786ce
Author: James Halliday <mail at substack.net>
Date: Sun Feb 24 16:30:05 2013 -0800
now works with shebang lines
---
index.js | 1 +
1 file changed, 1 insertion(+)
diff --git a/index.js b/index.js
index cb1991f..e7a1fde 100644
--- a/index.js
+++ b/index.js
@@ -31,6 +31,7 @@ exports.find = function (src, opts) {
if (!opts) opts = {};
var word = opts.word === undefined ? 'require' : opts.word;
if (typeof src !== 'string') src = String(src);
+ src = src.replace(/^#![^\n]*\n/, '');
function isRequire (node) {
var c = node.callee;
--
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