mirror of
https://github.com/lensapp/lens.git
synced 2025-05-20 05:10:56 +00:00
* add no-unused-vars and no-unused-imports * added quotes: double, and remove ignore pattern * move itif and describeif into utils Signed-off-by: Sebastian Malton <sebastian@malton.name>
6 lines
216 B
TypeScript
6 lines
216 B
TypeScript
// Helper to sanitize / escape special chars for passing to RegExp-constructor
|
|
|
|
export function escapeRegExp(str: string) {
|
|
return str.replace(/[.*+?^${}()|[\]\\]/g, "\\$&"); // $& means the whole matched string
|
|
}
|