Skip to content

Commit 5ba9a94

Browse files
Merge branch 'jbpionnier-feat/accept_provide_abstract_class'
2 parents 0e33860 + a79e192 commit 5ba9a94

13 files changed

Lines changed: 24 additions & 16 deletions

File tree

packages/common/index.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/*
22
* Nest @common
3-
* Copyright(c) 2017 - 2018 Kamil Mysliwiec
3+
* Copyright(c) 2017 - 2019 Kamil Mysliwiec
44
* https://nestjs.com
55
* MIT Licensed
66
*/
@@ -12,6 +12,7 @@ export * from './enums';
1212
export * from './exceptions';
1313
export * from './http';
1414
export {
15+
Abstract,
1516
ArgumentMetadata,
1617
ArgumentsHost,
1718
CallHandler,

packages/common/interfaces/modules/module-metadata.interface.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,5 +18,6 @@ export interface ModuleMetadata {
1818
| Provider
1919
| ForwardReference
2020
| Abstract<any>
21+
| Function
2122
>;
2223
}

packages/common/interfaces/modules/provider.interface.ts

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import { Abstract } from '../abstract.interface';
12
import { Scope } from '../scope-options.interface';
23
import { Type } from '../type.interface';
34

@@ -8,18 +9,18 @@ export type Provider<T = any> =
89
| FactoryProvider<T>;
910

1011
export interface ClassProvider<T = any> {
11-
provide: string | symbol | Type<any>;
12+
provide: string | symbol | Type<any> | Abstract<any> | Function;
1213
useClass: Type<T>;
1314
scope?: Scope;
1415
}
1516

1617
export interface ValueProvider<T = any> {
17-
provide: string | symbol | Type<any>;
18+
provide: string | symbol | Type<any> | Abstract<any> | Function;
1819
useValue: T;
1920
}
2021

2122
export interface FactoryProvider<T = any> {
22-
provide: string | symbol | Type<any>;
23+
provide: string | symbol | Type<any> | Abstract<any> | Function;
2324
useFactory: (...args: any[]) => T;
2425
inject?: Array<Type<any> | string | any>;
2526
scope?: Scope;

packages/core/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/*
22
* Nest @core
3-
* Copyright(c) 2017 - 2018 Kamil Mysliwiec
3+
* Copyright(c) 2017 - 2019 Kamil Mysliwiec
44
* https://nestjs.com
55
* MIT Licensed
66
*/

packages/core/scanner.ts

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,9 @@
1-
import { DynamicModule, ForwardReference, Provider } from '@nestjs/common';
1+
import {
2+
Abstract,
3+
DynamicModule,
4+
ForwardReference,
5+
Provider,
6+
} from '@nestjs/common';
27
import {
38
EXCEPTION_FILTERS_METADATA,
49
GUARDS_METADATA,
@@ -31,7 +36,7 @@ import { MetadataScanner } from './metadata-scanner';
3136
interface ApplicationProviderWrapper {
3237
moduleKey: string;
3338
providerKey: string;
34-
type: string | symbol | Type<any>;
39+
type: string | symbol | Type<any> | Abstract<any> | Function;
3540
}
3641

3742
export class DependenciesScanner {

packages/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/*
22
* Nest
3-
* Copyright(c) 2017 - 2018 Kamil Mysliwiec
3+
* Copyright(c) 2017 - 2019 Kamil Mysliwiec
44
* https://nestjs.com
55
* MIT Licensed
66
*/

packages/microservices/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/*
22
* Nest @microservices
3-
* Copyright(c) 2017 - 2018 Kamil Mysliwiec
3+
* Copyright(c) 2017 - 2019 Kamil Mysliwiec
44
* https://nestjs.com
55
* MIT Licensed
66
*/

packages/platform-express/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/*
22
* Nest @platform-express
3-
* Copyright(c) 2017 - 2018 Kamil Mysliwiec
3+
* Copyright(c) 2017 - 2019 Kamil Mysliwiec
44
* https://nestjs.com
55
* MIT Licensed
66
*/

packages/platform-fastify/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/*
22
* Nest @platform-express
3-
* Copyright(c) 2017 - 2018 Kamil Mysliwiec
3+
* Copyright(c) 2017 - 2019 Kamil Mysliwiec
44
* https://nestjs.com
55
* MIT Licensed
66
*/

packages/platform-socket.io/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/*
22
* Nest @platform-socket.io
3-
* Copyright(c) 2017 - 2018 Kamil Mysliwiec
3+
* Copyright(c) 2017 - 2019 Kamil Mysliwiec
44
* https://nestjs.com
55
* MIT Licensed
66
*/

0 commit comments

Comments
 (0)