thiagobustamante / typescript-ioc

A Lightweight annotation-based dependency injection container for typescript.
MIT License
526 stars 64 forks source link

Added generic type to 'get' an object from the container #36

Closed frankvdb7 closed 4 years ago

frankvdb7 commented 6 years ago

This adds a generic type check to the Container.get function so that the return type is equal to the source parameter type. This way it will not return 'any'.

There may be breaking changes for code relying on this function. But probably the previous version relied on 'any', thus not working at runtime anyway.

thiagobustamante commented 4 years ago

This feature is already included in the new library version