Welcome to mirror list, hosted at ThFree Co, Russian Federation.

getRewireRegExp.js « bundlers « lib - github.com/twbs/rewire.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 69e4ef5514b99cb40e7b3a9ac9df645e8d29484e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
/**
 * Returns a regular expression that matches all rewire() statements.
 *
 * Captures:
 *
 * 1. the character before rewire
 * 2. the path between the parenthesis without quotation marks
 *
 * @return {RegExp}
 */
function getRewireRegExp() {
    return /([^a-zA-Z0-9_])rewire\(["'](.+?)["']\)/g;
}

module.exports = getRewireRegExp;