Skip to content

refactor: extract requireValidAddress/requireValidToken helpers#400

Open
TimNooren wants to merge 1 commit intomainfrom
code-simplifier/apr7
Open

refactor: extract requireValidAddress/requireValidToken helpers#400
TimNooren wants to merge 1 commit intomainfrom
code-simplifier/apr7

Conversation

@TimNooren
Copy link
Copy Markdown
Contributor

Summary

  • Extracted two small helpers (requireValidAddress, requireValidToken) in api.js that replace 21 identical validate-and-throw blocks
  • Each 3–4 line block (validate, check result, throw) becomes a single function call
  • Net: −43 lines (37 added, 80 removed), single file change

Test plan

  • npm test — all 1281 tests pass
  • npm run lint — clean
  • No behavior change — helpers throw the exact same NansenError with the same error/code

🤖 Generated with Claude Code

…duplicate 21 validate-and-throw blocks

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants