reports/frontend/node_modules/es-toolkit/dist/compat/string/escapeRegExp.mjs
jtricerolph 1c411e402e Add settings page for managing forecasting API key and URL via UI
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-07-20 14:37:36 +00:00

19 lines
668 B
JavaScript

import { escapeRegExp as escapeRegExp$1 } from "../../string/escapeRegExp.mjs";
import { toString } from "../util/toString.mjs";
//#region src/compat/string/escapeRegExp.ts
/**
* Escapes the RegExp special characters "^", "$", "\\", ".", "*", "+", "?", "(", ")", "[", "]", "{", "}", and "|" in `str`.
*
* @param str The string to escape.
* @returns Returns the escaped string.
*
* @example
* import { escapeRegExp } from 'es-toolkit/string';
*
* escapeRegExp('[es-toolkit](https://es-toolkit.dev/)'); // returns '\[es-toolkit\]\(https://es-toolkit\.dev/\)'
*/
function escapeRegExp(str) {
return escapeRegExp$1(toString(str));
}
//#endregion
export { escapeRegExp };