Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 2acb387

Browse filesBrowse files
committed
tasks: generalise patch minified task
- bumping to node v6 disrupted the "a(r)" assumption
1 parent 5b4bee8 commit 2acb387
Copy full SHA for 2acb387

File tree

Expand file treeCollapse file tree

1 file changed

+19
-3
lines changed
Filter options
Expand file treeCollapse file tree

1 file changed

+19
-3
lines changed

‎tasks/util/patch_minified.js

Copy file name to clipboardExpand all lines: tasks/util/patch_minified.js
+19-3Lines changed: 19 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
1-
var STR_TO_REPLACE = 'require("+a(r)+");';
2-
var STR_NEW = 'require("+ a(r) +");';
1+
var ALPHABET = 'abcdefghijklmnopqrstuvwxyz'.split('');
2+
var FRONT = 'require("+';
3+
var BACK = '+");';
34

45
/* Uber hacky in-house fix to
56
*
@@ -11,5 +12,20 @@ var STR_NEW = 'require("+ a(r) +");';
1112
*
1213
*/
1314
module.exports = function patchMinified(minifiedCode) {
14-
return minifiedCode.replace(STR_TO_REPLACE, STR_NEW);
15+
for(var i = 0; i < ALPHABET.length; i++) {
16+
var li = ALPHABET[i];
17+
18+
for(var j = 0; j < ALPHABET.length; j++) {
19+
var lj = ALPHABET[j];
20+
21+
var MIDDLE = li + '(' + lj + ')';
22+
23+
var strOld = FRONT + MIDDLE + BACK,
24+
strNew = FRONT + ' ' + MIDDLE + ' ' + BACK;
25+
26+
minifiedCode = minifiedCode.replace(strOld, strNew);
27+
}
28+
}
29+
30+
return minifiedCode;
1531
};

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.