Skip to content

Commit

Permalink
refactor: rename n to index
Browse files Browse the repository at this point in the history
  • Loading branch information
mmackz committed Jan 26, 2024
1 parent 9c82aa7 commit 8b36b8a
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions src/filter/filters.ts
Original file line number Diff line number Diff line change
Expand Up @@ -166,13 +166,13 @@ export const handleLast = (
*/
export const handleNth = (
context: any,
filter: { n: number; value: TransactionFilter | FilterObject },
filter: { index: number; value: TransactionFilter | FilterObject },
): boolean => {
const { n, value } = filter
if (n < 0 || n >= context.length) {
return false // Index out of bounds
const { index, value } = filter
if (index < 0 || index >= context.length) {
return false // index out of bounds
}
return apply(context[n], value)
return apply(context[index], value)
}

/**
Expand Down

0 comments on commit 8b36b8a

Please sign in to comment.