Refactor parameter replacement logic
This commit is contained in:
parent
7fac86adbb
commit
0db95cad3d
3 changed files with 20 additions and 39 deletions
|
|
@ -1,11 +1,6 @@
|
|||
// Utilities for scraping data from the Lodestone
|
||||
|
||||
/**
|
||||
* @see https://stackoverflow.com/a/6969486
|
||||
* @param {string}
|
||||
* @returns {string}
|
||||
*/
|
||||
const regExpEscape = str => str.replace(/[.*+?^${}()|[\]\\]/g, '\\$&');
|
||||
import {regExpEscape} from '../util/regexp.js';
|
||||
|
||||
/**
|
||||
* Creates a regular expression that matches a link to the named item and
|
||||
|
|
|
|||
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