Skip to content

Commit dda63c6

Browse files
author
renjianhua
committed
fix: injectservice type
1 parent 77e8a95 commit dda63c6

File tree

3 files changed

+3
-4
lines changed

3 files changed

+3
-4
lines changed

package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "vue3-oop",
3-
"version": "1.0.2",
3+
"version": "1.0.3",
44
"main": "dist/vue3-oop.js",
55
"module": "dist/vue3-oop.mjs",
66
"types": "types/index.d.ts",

src/di/index.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -191,11 +191,11 @@ export function createCurrentInjector(
191191
export function injectService<T extends { new (...args: any[]): any }>(
192192
token: T,
193193
notFoundValue?: any
194-
): InstanceType<T> | undefined
194+
): InstanceType<T>
195195
export function injectService<T>(
196196
token: string | number | symbol,
197197
notFoundValue?: any
198-
): T | undefined {
198+
): T {
199199
const currentInjector = getCurrentInjector()
200200
if (!currentInjector) return notFoundValue
201201

tsconfig.json

-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@
1313
"experimentalDecorators": true,
1414
"emitDecoratorMetadata": true,
1515
"useDefineForClassFields": false,
16-
"verbatimModuleSyntax": true,
1716
"allowSyntheticDefaultImports": true,
1817
"strictPropertyInitialization": false,
1918
"declaration": true,

0 commit comments

Comments
 (0)