Release Notes - v2.2.0
π§ Fallback Handler Improvements
This release focuses on improving the fallback handler functionality and error message formatting for better debugging experience.
π Migration Guide
From v2.1.x
No breaking changes! This release is fully backward compatible. You can continue using your existing code without modifications.
What's Different
- Error messages for unsupported object types will now show detailed object information
- Fallback handler integration is more robust
π Getting Started
Installation
npm install class-resolver@2.2.0Basic Usage (Unchanged)
import Resolver from 'class-resolver';
const resolver = new Resolver<string, string>();
resolver.addUpdater({
supports: (type: string) => type === 'test',
handle: (input: string) => `Processed: ${input}`
});
// Set fallback handler
resolver.setFallbackHandler((type: string) => `Fallback: ${type}`);
// Enhanced error handling for unsupported types
try {
const result = resolver.resolve('unsupported');
} catch (error) {
// Now provides more detailed error information for objects
console.log(error.message);
}Thank you for using class-resolver! π
If you find this release helpful, please consider giving us a β on GitHub.