Skip to content

Commit

Permalink
Merge pull request #68 from rabbitholegg/mmackz-remove-unused-operators
Browse files Browse the repository at this point in the history
refactor(questdk): remove unused filter operator functions
  • Loading branch information
mmackz authored Jan 20, 2024
2 parents d39cc8c + ba54370 commit 3649c88
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 27 deletions.
5 changes: 5 additions & 0 deletions .changeset/yellow-pears-cough.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@rabbitholegg/questdk": minor
---

remove references to unused filter functions
7 changes: 0 additions & 7 deletions src/filter/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,6 @@ export {
Equal,
LessThanOrEqual,
GreaterThanOrEqual,
Or,
Any,
And,
All,
Some,
First,
Last,
} from './operators.js'

export type {
Expand Down
11 changes: 0 additions & 11 deletions src/filter/operators.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
import type { FilterOperator } from './types.js'

export const GreaterThan = (amount: bigint | number | string) => ({
$gt: BigInt(amount),
})
Expand All @@ -19,12 +17,3 @@ export const LessThanOrEqual = (amount: bigint | number | string) => ({
export const GreaterThanOrEqual = (amount: bigint | number | string) => ({
$gte: BigInt(amount),
})

export const Or = ($or: FilterOperator[]) => ({ $or })
export const And = ($and: FilterOperator[]) => ({ $and })
export const Some = ($some: FilterOperator[]) => ({ $some })
export const First = ($first: FilterOperator) => ({ $first })
export const Last = ($last: FilterOperator) => ({ $last })

export const Any = Or
export const All = And
7 changes: 0 additions & 7 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -46,12 +46,5 @@ export {
LessThan,
LessThanOrEqual,
GreaterThanOrEqual,
Or,
And,
Some,
First,
Last,
Any,
All,
Equal,
} from './filter/operators.js'
3 changes: 1 addition & 2 deletions src/quests/deployQuest.test.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import { Any } from '../filter/operators.js'
import type { LogicalOperator } from '../index.js'
import { QUEST_FACTORY_ADDRESS } from './constants.js'
import { deployQuest } from './deployQuest.js'
Expand All @@ -22,7 +21,7 @@ describe('deployQuest', () => {
max: 5000,
}

actions = Any([])
actions = { $or: [] }
})

test('should create a transaction with expected values', async () => {
Expand Down

0 comments on commit 3649c88

Please sign in to comment.