match-requires
Advanced tools
+5
-2
@@ -12,3 +12,5 @@ /*! | ||
| module.exports = function matchRequires(str, options = {}) { | ||
| module.exports = function matchRequires(str, options) { | ||
| options = options || {}; | ||
| if (typeof options === 'boolean' || typeof options === 'function') { | ||
@@ -34,3 +36,3 @@ options = { stripComments: options }; | ||
| Reflect.defineProperty(tok, 'match', { | ||
| Object.defineProperty(tok, 'match', { | ||
| enumerable: false, | ||
@@ -42,3 +44,4 @@ value: match | ||
| } | ||
| return matches; | ||
| }; |
+2
-2
| { | ||
| "name": "match-requires", | ||
| "description": "Match require statements in a string. Returns an array of matching require statements. Each match is an object with line number, variable name, and module name. Statements in code comments are ignored.", | ||
| "version": "2.0.0", | ||
| "version": "2.0.1", | ||
| "homepage": "https://github.com/jonschlinkert/match-requires", | ||
@@ -23,3 +23,3 @@ "author": "Jon Schlinkert (https://github.com/jonschlinkert)", | ||
| "dependencies": { | ||
| "requires-regex": "^1.0.2", | ||
| "requires-regex": "^1.0.4", | ||
| "strip-comments": "^1.0.1" | ||
@@ -26,0 +26,0 @@ }, |
+3
-1
@@ -104,3 +104,5 @@ # match-requires [](https://www.npmjs.com/package/match-requires) [](https://npmjs.org/package/match-requires) [](https://npmjs.org/package/match-requires) [](https://travis-ci.org/jonschlinkert/match-requires) | ||
| [requires-regex](https://www.npmjs.com/package/requires-regex): Regular expression for matching javascript require statements. | [homepage](https://github.com/jonschlinkert/requires-regex "Regular expression for matching javascript require statements.") | ||
| * [requires-regex](https://www.npmjs.com/package/requires-regex): Regular expression for matching javascript require statements. | [homepage](https://github.com/jonschlinkert/requires-regex "Regular expression for matching javascript require statements.") | ||
| * [to-regex-range](https://www.npmjs.com/package/to-regex-range): Pass two numbers, get a regex-compatible source string for matching ranges. Validated against more than… [more](https://github.com/micromatch/to-regex-range) | [homepage](https://github.com/micromatch/to-regex-range "Pass two numbers, get a regex-compatible source string for matching ranges. Validated against more than 2.78 million test assertions.") | ||
| * [year-range-regex](https://www.npmjs.com/package/year-range-regex): Generates a regular expression for validating a range of years. | [homepage](https://github.com/jonschlinkert/year-range-regex "Generates a regular expression for validating a range of years.") | ||
@@ -107,0 +109,0 @@ ### Author |
8588
9.01%33
3.13%123
1.65%Updated