Skip to content

Commit

Permalink
- improved tsconfig.json
Browse files Browse the repository at this point in the history
  • Loading branch information
mrcwbr committed Aug 8, 2023
1 parent ec878a1 commit b294265
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
4 changes: 2 additions & 2 deletions src/ServiceContainer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ export default {
}

if (!service.instance) {
service.instance = service.factory();
service.instance = service.factory?.();
service.factory = undefined;
}

Expand Down Expand Up @@ -63,6 +63,6 @@ function getFactory(factoryOrClassReference: Factory | Function): Factory {

type Factory = () => any;
type Service = {
factory: () => any;
factory?: () => any;
instance?: any;
}
5 changes: 4 additions & 1 deletion tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,10 @@
"declaration": true,
"esModuleInterop": true,
"moduleResolution": "node",
"module": "commonjs"
"module": "commonjs",
"strict": true,
"noImplicitAny": true,
"strictPropertyInitialization": true
},
"include": [
"src/**/*"
Expand Down

0 comments on commit b294265

Please sign in to comment.