This repository was archived by the owner on Jan 5, 2023. It is now read-only.
Commit 95f24b0 1 parent 81e4e60 commit 95f24b0 Copy full SHA for 95f24b0
File tree 2 files changed +2
-4
lines changed
2 files changed +2
-4
lines changed Original file line number Diff line number Diff line change @@ -18,7 +18,6 @@ var path = require('path');
18
18
var crypto = require ( 'crypto' ) ;
19
19
var fs = require ( 'fs' ) ;
20
20
var Levenshtein = require ( 'levenshtein' ) ;
21
- var escapeRegex = require ( 'escape-string-regexp' ) ;
22
21
23
22
const COLOR_RESET = '\033[0m' ;
24
23
const COLOR_RED_BOLD = '\033[1;31m' ;
@@ -130,7 +129,7 @@ function substituteWithOpaqueKeys(text) {
130
129
var substitutions = globalOptions . substitutions ;
131
130
for ( var i = 0 ; i < substitutions . length ; i ++ ) {
132
131
var subst = substitutions [ i ] ;
133
- text = text . replace ( new RegExp ( escapeRegex ( subst . actualValueFn ( ) ) , 'g' ) , subst . opaqueKey ) ;
132
+ text = text . split ( subst . actualValueFn ( ) ) . join ( subst . opaqueKey ) ;
134
133
}
135
134
return text ;
136
135
}
@@ -139,7 +138,7 @@ function substituteWithRealValues(text) {
139
138
var substitutions = globalOptions . substitutions ;
140
139
for ( var i = 0 ; i < substitutions . length ; i ++ ) {
141
140
var subst = substitutions [ i ] ;
142
- text = text . replace ( new RegExp ( escapeRegex ( subst . opaqueKey ) , 'g' ) , subst . actualValueFn ( ) ) ;
141
+ text = text . split ( subst . opaqueKey ) . join ( subst . actualValueFn ( ) ) ;
143
142
}
144
143
return text ;
145
144
}
Original file line number Diff line number Diff line change 36
36
},
37
37
"dependencies" : {
38
38
"colors" : " ^1.1.2" ,
39
- "escape-string-regexp" : " 1.0.5" ,
40
39
"express" : " ^4.14.0" ,
41
40
"http-proxy" : " ^1.15.2" ,
42
41
"levenshtein" : " ^1.0.5" ,
You can’t perform that action at this time.
0 commit comments