Skip to content

Commit fd07aeb

Browse files
authored
Fix issue with backslash crashing the app (#291)
1 parent e8f9816 commit fd07aeb

1 file changed

Lines changed: 9 additions & 3 deletions

File tree

components/Reference/columns.tsx

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,15 @@ import { Row } from 'react-table'
22

33
import { StackBox } from 'components/ui'
44

5-
const filter = (rows: Row[], id: string, filterValue: string) => {
6-
const re = new RegExp(`${filterValue}`, 'i')
7-
return rows.filter((row: any) => row.original[id].match(re))
5+
// Possible fields are defined in `Opcodes.json`
6+
type OpcodeRow = Row<Record<string, string | undefined>>
7+
8+
const filter = (rows: OpcodeRow[], id: string, filterValue: string) => {
9+
return rows.filter((row) =>
10+
row.original[id]
11+
?.toLocaleLowerCase()
12+
.includes(filterValue.toLocaleLowerCase()),
13+
)
814
}
915

1016
const columns = (isPrecompiled: boolean) => [

0 commit comments

Comments
 (0)