Describe the bug
When searching for "paquerette" there will be no result from steamApi because the data.applist.apps pulled includes the diacritic â in the app.name and the string matching only normalizes with .toLowerCase() so far.
To Reproduce
Steps to reproduce the behavior:
Search for "paquerette" with steamApi, obtain nothing
Search for "pâquerette" with steamApi, obtain correct resultlist
Expected behavior
Not common diacritics could be normalized and excluded when searching in a form akin to this:
for (const app of data.applist.apps) {
if (app.name.normalize('NFD').replace(/[\u0300-\u036f]/g, '').toLowerCase().includes(title.toLowerCase())) {
filteredData.push(app);
}
if (filteredData.length > 20) {
break;
}
}
Where .normalize('NFD').replace(/[\u0300-\u036f]/g, '') will decompose â to ^a and then replace all diacritics in the usual unicode range indicated by the regex /[\u0300-\u036f]/g.
Occurs on
[x] Windows
[x] macOS
[ ] Linux
[x] Android
[ ] iOS
Plugin version
0.6.0
Additional context
I did not submit a pull request because:
I am not sure this is the best way to do it and don't know if it impacts performance in any way,
I do not know if this is a desirable change for the author of the plugin
maybe there are other instances of this search and it would be best to abstract the normalization to its own util function
Describe the bug When searching for "paquerette" there will be no result from steamApi because the
data.applist.apps
pulled includes the diacriticâ
in theapp.name
and the string matching only normalizes with.toLowerCase()
so far.To Reproduce Steps to reproduce the behavior:
Expected behavior Not common diacritics could be normalized and excluded when searching in a form akin to this:
Where
.normalize('NFD').replace(/[\u0300-\u036f]/g, '')
will decomposeâ
to^a
and then replace all diacritics in the usual unicode range indicated by the regex/[\u0300-\u036f]/g
.Occurs on
Plugin version 0.6.0
Additional context
I did not submit a pull request because: