Skip to content

refactor(adf): replace patcher switch with handler map#20

Merged
SmartBrandStrategies merged 1 commit intomainfrom
refactor/patcher-handlers
Mar 3, 2026
Merged

refactor(adf): replace patcher switch with handler map#20
SmartBrandStrategies merged 1 commit intomainfrom
refactor/patcher-handlers

Conversation

@SmartBrandStrategies
Copy link
Copy Markdown
Contributor

Summary

  • Replace applyOne() switch statement with keyed handler map for easier extension
  • Extract checkBounds() helper to eliminate 4 repeated index bounds checks
  • Extract parseColonEntry() helper to eliminate 2 duplicated colon-parsing blocks
  • Net reduction: 218 → 186 LOC (patcher.ts)

Closes #12

Test plan

  • All 22 existing patcher tests pass without modification (behavior identical)
  • pnpm run build clean
  • pnpm run test — 243 tests pass
  • ADF evidence ceilings green

🤖 Generated with Claude Code

…pers

Extract checkBounds() and parseColonEntry() helpers to eliminate 4 repeated
index bounds checks and 2 duplicated colon-parsing blocks. Replace applyOne()
switch statement with a keyed handler map for easier extension.

Closes #12

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@SmartBrandStrategies SmartBrandStrategies merged commit c7a1753 into main Mar 3, 2026
4 checks passed
@SmartBrandStrategies SmartBrandStrategies deleted the refactor/patcher-handlers branch March 3, 2026 11:10
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.

refactor(adf): replace patcher switch branches with operation handlers

2 participants