Refactor parameter replacement logic
This commit is contained in:
parent
7fac86adbb
commit
0db95cad3d
3 changed files with 20 additions and 39 deletions
6
lib/util/regexp.js
Normal file
6
lib/util/regexp.js
Normal file
|
|
@ -0,0 +1,6 @@
|
|||
/**
|
||||
* @see https://stackoverflow.com/a/6969486
|
||||
* @param {string}
|
||||
* @returns {string}
|
||||
*/
|
||||
export const regExpEscape = str => str.replace(/[.*+?^${}()|[\]\\]/g, '\\$&');
|
||||
Loading…
Add table
Add a link
Reference in a new issue