fix(InputMenu/SelectMenu): regex breaks build

This commit is contained in:
Benjamin Canac
2024-11-05 17:57:49 +01:00
parent 22da1a839a
commit cb6f5f2d71
2 changed files with 2 additions and 2 deletions

View File

@@ -402,7 +402,7 @@ export default defineComponent({
})
function escapeRegExp(string: string) {
return string.replace(/[.*+?^${}()|[\]\\]/g, '\\$&')
return string.replace(/[.*+?^${}()|[\]\\]/g, match => `\\${match}`)
}
const filteredOptions = computed(() => {

View File

@@ -486,7 +486,7 @@ export default defineComponent({
})
function escapeRegExp(string: string) {
return string.replace(/[.*+?^${}()|[\]\\]/g, '\\$&')
return string.replace(/[.*+?^${}()|[\]\\]/g, match => `\\${match}`)
}
function accessor<T extends Record<string, any>>(obj: T, key: string) {