Skip to content

Commit

Permalink
refactor: assert exhaustive account type handling in getSmartAccountC…
Browse files Browse the repository at this point in the history
…lient
  • Loading branch information
adamegyed committed Feb 10, 2025
1 parent 5afc25f commit f53e94b
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion account-kit/core/src/actions/getSmartAccountClient.ts
Original file line number Diff line number Diff line change
Expand Up @@ -245,7 +245,7 @@ export function getSmartAccountClient(
isLoadingClient: false,
};
default:
throw new Error("Unsupported account type");
assertNeverAccountType(account);
}
})();

Expand Down Expand Up @@ -300,3 +300,7 @@ function setSmartAccountClientState<
},
}));
}

function assertNeverAccountType(_accountType: never): never {
throw new Error("Unsupported account type");
}

0 comments on commit f53e94b

Please sign in to comment.