refactor(common): remove `i` (ignore case) regex flag where it is not needed (#39077)
It is not necessary to set IGNORECASE flag when the regex pattern does not contain alphabetic characters PR Close #39077
This commit is contained in:
parent
5fa012efb8
commit
f28b451b0c
|
@ -309,10 +309,7 @@ function toKeyValue(obj: {[k: string]: unknown}) {
|
|||
* Logic from https://github.com/angular/angular.js/blob/864c7f0/src/Angular.js#L1437
|
||||
*/
|
||||
function encodeUriSegment(val: string) {
|
||||
return encodeUriQuery(val, true)
|
||||
.replace(/%26/gi, '&')
|
||||
.replace(/%3D/gi, '=')
|
||||
.replace(/%2B/gi, '+');
|
||||
return encodeUriQuery(val, true).replace(/%26/g, '&').replace(/%3D/gi, '=').replace(/%2B/gi, '+');
|
||||
}
|
||||
|
||||
|
||||
|
@ -331,7 +328,7 @@ function encodeUriSegment(val: string) {
|
|||
*/
|
||||
function encodeUriQuery(val: string, pctEncodeSpaces: boolean = false) {
|
||||
return encodeURIComponent(val)
|
||||
.replace(/%40/gi, '@')
|
||||
.replace(/%40/g, '@')
|
||||
.replace(/%3A/gi, ':')
|
||||
.replace(/%24/g, '$')
|
||||
.replace(/%2C/gi, ',')
|
||||
|
|
Loading…
Reference in New Issue