cleanup: Remove unneeded escapes in regex

. and ) lose their special meaning in character sets, so they don't
need escaping. The same applies to - when it isn't part of a range.

Spotted by eslint.

https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/607
This commit is contained in:
Florian Müllner
2019-01-29 23:44:38 +01:00
parent 321730fcb9
commit e7d44bb349
2 changed files with 3 additions and 3 deletions

View File

@ -248,7 +248,7 @@ class NotificationApplicationPolicy extends NotificationPolicy {
_canonicalizeId(id) {
// Keys are restricted to lowercase alphanumeric characters and dash,
// and two dashes cannot be in succession
return id.toLowerCase().replace(/[^a-z0-9\-]/g, '-').replace(/--+/g, '-');
return id.toLowerCase().replace(/[^a-z0-9-]/g, '-').replace(/--+/g, '-');
}
get enable() {