issue-16-code-quality-enhancements
main
Closes #16
3.1 Duplicate Code:
3.2 Error Handling:
3.3 Type Safety:
3.4 Testing:
- Consolidate settings defaults: config.js is now single source of truth, state.js imports from config.js (eliminates ~300 lines of duplication) - Validator factory: createStringValidator() unifies sanitizeLocationName/ sanitizeItemName with configurable rules (blocked names, max length, rejects) - Refactor promptBuilder: Extract getCharacterCardsInfo into buildNarratorCardInfo, buildGroupCardInfo, buildSingleCardInfo, appendCharacterFields - Error handling: jsonRepair.js silent failures now log to console.debug - Testing: Fix ESM support (babel.config.json + jest.config.cjs transform), add security.test.js with 24 tests for validator factory and security utilities - Total: 78 tests passing (was 54)
✅ No issues found — changes look consistent with the stated intent. Ready to be merged.
No dependencies set.
The note is not visible to the blocked user.
Closes #16
3.1 Duplicate Code:
3.2 Error Handling:
3.3 Type Safety:
3.4 Testing:
✅ No issues found — changes look consistent with the stated intent. Ready to be merged.