Skip to content

Commit

Permalink
refactor: add the u flag in regular expressions
Browse files Browse the repository at this point in the history
It is recommended to use the `u` flag with regular expressions.
  • Loading branch information
deepsource-autofix[bot] authored and MrSuddenJoy committed Jun 17, 2024
1 parent 642003c commit 3aced0c
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion resources/js/components/searchbar/mixin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ export default class DecoratorMixin extends Vue {
// @ts-ignore
const value = this.value.replace(/[.*+?^${}()|[\]\\]/g, '\\$&');

const ascii = value.normalize('NFD').replace(/[\u0300-\u036f]/g, "");
const ascii = value.normalize('NFD').replace(/[\u0300-\u036f]/gu, "");
const re = new RegExp(`\\b(${value}|${ascii})`, "i");

return text.replace(re, "<strong>$1</strong>");
Expand Down

0 comments on commit 3aced0c

Please sign in to comment.