Skip to content

Commit

Permalink
Fix "unknown" type error
Browse files Browse the repository at this point in the history
  • Loading branch information
blootsvoets committed Dec 13, 2022
1 parent d325542 commit 9d83cf0
Showing 1 changed file with 9 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -149,9 +149,16 @@ export class UsersListComponent implements AfterViewInit {
private createTableFilterPredicate() {
return function (data: UserData, filter: string): boolean {
const searchTerms = JSON.parse(filter);
return Object.entries(searchTerms)
return Object.keys(searchTerms)
.map(key => {
const value = searchTerms[key]
if (value) {
return [key, value.toString().toLocaleLowerCase()]
} else {
return [key, '']
}
})
.filter(([, value]) => value)
.map(([key, value]) => [key, (value as any).toString().toLowercase()])
.every(([key, value]) => {
switch (key) {
case 'userId':
Expand Down

0 comments on commit 9d83cf0

Please sign in to comment.