- Fix execution time checking by keeping lastUpdatedTime in db by @ikreymer in https://github.com/webrecorder/browsertrix-cloud/pull/1573 - disable postcss-lit for var css - Prevent closing tooltips from closing collection share dialog by @SuaYoo in https://github.com/webrecorder/browsertrix-cloud/pull/1579 - Fix pending exclusion pagination by @SuaYoo in https://github.com/webrecorder/browsertrix-cloud/pull/1578 - Fix regex escape in exclusion editor text match by @SuaYoo in https://github.com/webrecorder/browsertrix-cloud/pull/1577 --------- Co-authored-by: emma <hi@emma.cafe> Co-authored-by: sua yoo <sua@webrecorder.org>
12 lines
320 B
TypeScript
12 lines
320 B
TypeScript
/**
|
|
* Escape string to use as regex
|
|
* From https://github.com/tc39/proposal-regex-escaping/blob/main/polyfill.js#L3
|
|
*/
|
|
export function regexEscape(s: unknown) {
|
|
return String(s).replace(/[\\^$*+?.()|[\]{}]/g, "\\$&");
|
|
}
|
|
|
|
export function regexUnescape(s: unknown) {
|
|
return String(s).replace(/(\\|\/\.\*)/g, "");
|
|
}
|