requires-regex
Advanced tools
Comparing version 0.1.1 to 0.1.2
@@ -10,3 +10,3 @@ 'use strict'; | ||
module.exports = function () { | ||
return /^(var[ \t]*([\w$]+)[ \t]*=[ \t]*)?require\(['"]([\w\W]+?)['"]\)/gm; | ||
return /^[ \t]*(var[ \t]*([\w$]+)[ \t]*=[ \t]*)?require\(['"]([\w\W]+?)['"]\)/gm; | ||
}; |
{ | ||
"name": "requires-regex", | ||
"description": "Regular expressions for node.js require statements.", | ||
"version": "0.1.1", | ||
"description": "Regular expressions for matching node.js require statements.", | ||
"version": "0.1.2", | ||
"homepage": "https://github.com/jonschlinkert/requires-regex", | ||
@@ -32,5 +32,3 @@ "author": { | ||
"mocha": "*", | ||
"should": "^4.0.4", | ||
"verb": ">= 0.2.6", | ||
"verb-tag-jscomments": ">= 0.2.0" | ||
"should": "^4.0.4" | ||
}, | ||
@@ -37,0 +35,0 @@ "keywords": [ |
# requires-regex [![NPM version](https://badge.fury.io/js/requires-regex.svg)](http://badge.fury.io/js/requires-regex) | ||
> Regular expressions for node.js require statements. | ||
> Regular expressions for matching node.js require statements. | ||
@@ -6,0 +6,0 @@ ## Install |
@@ -30,2 +30,7 @@ /*! | ||
}); | ||
it('should match indented variables', function () { | ||
var m = ' var path = require(\'path\');\n\nvar list = require(\'dirs\');'.match(re()); | ||
m.should.eql([ ' var path = require(\'path\')', 'var list = require(\'dirs\')' ]); | ||
}); | ||
}); |
6707
2
36