Skip to content

Commit

Permalink
fix: coalesce version to valid string (#7)
Browse files Browse the repository at this point in the history
  • Loading branch information
ishbu authored Nov 17, 2024
1 parent 9b622b4 commit 2a12a01
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/hook.ts
Original file line number Diff line number Diff line change
Expand Up @@ -45,9 +45,9 @@ export function usePermit({
functionName: "version",
});

const validatedVersionFromContract = [1, 2, '1', '2'].includes(versionFromContract)
? versionFromContract
: null;
const validatedVersionFromContract = [1, 2, '1', '2'].includes(versionFromContract ?? "")
? versionFromContract
: null;

const version = permitVersion ?? validatedVersionFromContract ?? '1';

Expand Down

0 comments on commit 2a12a01

Please sign in to comment.