Refactor DI container for better structure and clarity

- Moved `TSinjex` class to `classes` directory for better organization.
- Updated imports across the codebase to reflect the new location of `TSinjex`.
- Introduced `Identifier` type to standardize dependency identifiers.
- Enhanced JSDoc comments for improved clarity and consistency.
- Adjusted error messages for `DependencyResolutionError` to provide clearer information.
- Updated and expanded decorator and function types to use `Identifier` type.
This commit is contained in:
2024-08-16 16:13:17 +02:00
committed by Max P.
parent 5277f93df1
commit 41be08e02e
12 changed files with 221 additions and 157 deletions

View File

@@ -10,7 +10,7 @@ export class TSinjexError extends Error {
*/
constructor(message: string) {
super(message);
this.name = 'TSInjex';
this.name = 'TSinjex';
}
}
@@ -24,7 +24,7 @@ export class DependencyResolutionError extends TSinjexError {
* @param identifier **The identifier of the dependency**
*/
constructor(identifier: string) {
super(`Dependency ${identifier} not found.`);
this.name = 'TSInjexResolutionError';
super(`Dependency ${identifier} could not be resolved.`);
this.name = 'TSinjexResolutionError';
}
}