🏠 Home
Benchmark Hub
📊 All Benchmarks 🦖 Dinosaur v1 🦖 Dinosaur v2 ✅ To-Do List Applications 🎨 Creative Free Pages 🎯 FSACB - Ultimate Showcase 🌍 Translation Benchmark
Models
🏆 Top 10 Models 🆓 Free Models 📋 All Models ⚙️ Kilo Code
Resources
💬 Prompts Library 📖 AI Glossary 🔗 Useful Links
advanced

Legacy Code Refactoring to TypeScript

#refactoring #typescript #architecture #solid-principles

Refactor a complex legacy module to modern TypeScript using SOLID principles.

Act as a Senior Software Architect. You are presented with a legacy module written in older JavaScript that suffers from tight coupling, global state reliance, and lack of error handling. Your task is to: 1. Rewrite the code using modern TypeScript features, specifically utilizing generics and utility types. 2. Refactor the structure to strictly adhere to SOLID principles, decoupling dependencies where necessary. 3. Implement robust error handling with custom error classes. 4. Add JSDoc comments for all public interfaces. 5. Provide a detailed diff-style explanation justifying the architectural choices made to improve maintainability and testability.