Skip to content

Commit

Permalink
Fix issue with backslash crashing the app (#291)
Browse files Browse the repository at this point in the history
  • Loading branch information
2xic authored Jan 19, 2024
1 parent e8f9816 commit fd07aeb
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions components/Reference/columns.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,15 @@ import { Row } from 'react-table'

import { StackBox } from 'components/ui'

const filter = (rows: Row[], id: string, filterValue: string) => {
const re = new RegExp(`${filterValue}`, 'i')
return rows.filter((row: any) => row.original[id].match(re))
// Possible fields are defined in `Opcodes.json`
type OpcodeRow = Row<Record<string, string | undefined>>

const filter = (rows: OpcodeRow[], id: string, filterValue: string) => {
return rows.filter((row) =>
row.original[id]
?.toLocaleLowerCase()
.includes(filterValue.toLocaleLowerCase()),
)
}

const columns = (isPrecompiled: boolean) => [
Expand Down

1 comment on commit fd07aeb

@vercel
Copy link

@vercel vercel bot commented on fd07aeb Jan 19, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.