Skip to content

Commit 1f0de49

Browse files
chore(@nestjs) publish v5.2.0 release
1 parent d5833e3 commit 1f0de49

File tree

139 files changed

+1046
-2681
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

139 files changed

+1046
-2681
lines changed

bundle/common/Readme.md

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -46,15 +46,19 @@ Nest is an MIT-licensed open source project. It can grow thanks to the sponsors
4646

4747
#### Principal Sponsor
4848

49-
<a href="https://valor-software.com/"><img src="https://docs.nestjs.com/assets/sponsors/valor-software.png" width="300" /></a>
49+
<a href="https://valor-software.com/"><img src="https://docs.nestjs.com/assets/sponsors/valor-software.png" width="320" /></a>
50+
51+
#### Gold Sponsors
52+
53+
<a href="http://xtremis.com/"><img src="https://nestjs.com/img/logo-xtremis.svg" width="220" /></a>
5054

5155
#### Silver Sponsors
5256

53-
<a href="https://neoteric.eu/"><img src="https://nestjs.com/img/neoteric-cut.png" width="130" /></a> &nbsp; <a href="https://www.swingdev.io"><img src="https://nestjs.com/img/swingdev-logo.svg#1" width="160" /></a>
57+
<a href="https://neoteric.eu/"><img src="https://nestjs.com/img/neoteric-cut.png" width="120" /></a> &nbsp; <a href="https://www.swingdev.io"><img src="https://nestjs.com/img/swingdev-logo.svg#1" width="150" /></a>
5458

5559
#### Sponsors
5660

57-
<a href="https://scal.io"><img src="https://nestjs.com/img/scalio-logo.svg" width="120" /></a> &nbsp; <a href="http://angularity.io"><img src="http://angularity.io/media/logo.svg" height="32" /></a> &nbsp; <a href="http://gojob.com"><img src="https://gojob.com/w/wp-content/uploads/2017/02/cropped-Logo-web-home.png" height="44" /> &nbsp; <a href="https://keycdn.com"><img src="https://nestjs.com/img/keycdn.svg" height="37" /></a> &nbsp; <a href="https://hostpresto.com"><img src="https://nestjs.com/img/hostpresto.png" height="32" /></a>
61+
<a href="https://scal.io"><img src="https://nestjs.com/img/scalio-logo.svg" width="110" /></a> &nbsp; <a href="http://angularity.io"><img src="http://angularity.io/media/logo.svg" height="30" /></a> &nbsp; <a href="http://gojob.com"><img src="https://gojob.com/w/wp-content/uploads/2017/02/cropped-Logo-web-home.png" height="40" /> &nbsp; <a href="https://keycdn.com"><img src="https://nestjs.com/img/keycdn.svg" height="30" /></a> &nbsp; <a href="https://hostpresto.com"><img src="https://nestjs.com/img/hostpresto.png" height="30" /></a>
5862

5963
## Backers
6064

bundle/common/constants.d.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ export declare const GLOBAL_MODULE_METADATA = "__globalModule__";
1111
export declare const PATH_METADATA = "path";
1212
export declare const PARAMTYPES_METADATA = "design:paramtypes";
1313
export declare const SELF_DECLARED_DEPS_METADATA = "self:paramtypes";
14+
export declare const OPTIONAL_DEPS_METADATA = "optional:paramtypes";
1415
export declare const METHOD_METADATA = "method";
1516
export declare const ROUTE_ARGS_METADATA = "__routeArguments__";
1617
export declare const CUSTOM_ROUTE_AGRS_METADATA = "__customRouteArgs__";

bundle/common/constants.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ exports.GLOBAL_MODULE_METADATA = '__globalModule__';
1313
exports.PATH_METADATA = 'path';
1414
exports.PARAMTYPES_METADATA = 'design:paramtypes';
1515
exports.SELF_DECLARED_DEPS_METADATA = 'self:paramtypes';
16+
exports.OPTIONAL_DEPS_METADATA = 'optional:paramtypes';
1617
exports.METHOD_METADATA = 'method';
1718
exports.ROUTE_ARGS_METADATA = '__routeArguments__';
1819
exports.CUSTOM_ROUTE_AGRS_METADATA = '__customRouteArgs__';
Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import 'reflect-metadata';
2+
import { Type } from '../../interfaces';
23
/**
34
* Defines the Exceptions Filter. Takes set of exception types as an argument which has to be caught by this Filter.
45
* The class should implement the `ExceptionFilter` interface.
56
*/
6-
export declare function Catch(...exceptions: any[]): ClassDecorator;
7+
export declare function Catch(...exceptions: Type<any>[]): ClassDecorator;

bundle/common/decorators/core/component.decorator.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,10 +55,10 @@ function Interceptor() {
5555
return (target) => { };
5656
}
5757
exports.Interceptor = Interceptor;
58+
let offset = Math.random() * 100;
5859
function mixin(mixinClass) {
59-
this.offset = this.offset ? ++this.offset : Math.random() * 100;
6060
Object.defineProperty(mixinClass, 'name', {
61-
value: JSON.stringify(this.offset),
61+
value: JSON.stringify(offset++),
6262
});
6363
Injectable()(mixinClass);
6464
return mixinClass;
Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,12 @@
1-
export * from './controller.decorator';
1+
export * from './bind.decorator';
2+
export * from './catch.decorator';
23
export * from './component.decorator';
4+
export * from './controller.decorator';
35
export * from './dependencies.decorator';
4-
export * from './inject.decorator';
5-
export * from './catch.decorator';
66
export * from './exception-filters.decorator';
7-
export * from './use-pipes.decorator';
8-
export * from './use-guards.decorator';
7+
export * from './inject.decorator';
8+
export * from './optional.decorator';
99
export * from './reflect-metadata.decorator';
10+
export * from './use-guards.decorator';
1011
export * from './use-interceptors.decorator';
11-
export * from './bind.decorator';
12+
export * from './use-pipes.decorator';

bundle/common/decorators/core/index.js

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,15 @@ function __export(m) {
33
for (var p in m) if (!exports.hasOwnProperty(p)) exports[p] = m[p];
44
}
55
Object.defineProperty(exports, "__esModule", { value: true });
6-
__export(require("./controller.decorator"));
6+
__export(require("./bind.decorator"));
7+
__export(require("./catch.decorator"));
78
__export(require("./component.decorator"));
9+
__export(require("./controller.decorator"));
810
__export(require("./dependencies.decorator"));
9-
__export(require("./inject.decorator"));
10-
__export(require("./catch.decorator"));
1111
__export(require("./exception-filters.decorator"));
12-
__export(require("./use-pipes.decorator"));
13-
__export(require("./use-guards.decorator"));
12+
__export(require("./inject.decorator"));
13+
__export(require("./optional.decorator"));
1414
__export(require("./reflect-metadata.decorator"));
15+
__export(require("./use-guards.decorator"));
1516
__export(require("./use-interceptors.decorator"));
16-
__export(require("./bind.decorator"));
17+
__export(require("./use-pipes.decorator"));

bundle/common/decorators/core/inject.decorator.d.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,4 @@ import 'reflect-metadata';
33
* Injects provider which has to be available in the current injector (module) scope.
44
* Providers are recognized by types or tokens.
55
*/
6-
export declare function Inject(token: any): ParameterDecorator;
6+
export declare function Inject<T = any>(token: T): ParameterDecorator;
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
import 'reflect-metadata';
2+
/**
3+
* Sets dependency as an optional one.
4+
*/
5+
export declare function Optional(): ParameterDecorator;
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
"use strict";
2+
Object.defineProperty(exports, "__esModule", { value: true });
3+
require("reflect-metadata");
4+
const constants_1 = require("../../constants");
5+
/**
6+
* Sets dependency as an optional one.
7+
*/
8+
function Optional() {
9+
return (target, key, index) => {
10+
const args = Reflect.getMetadata(constants_1.OPTIONAL_DEPS_METADATA, target) || [];
11+
Reflect.defineMetadata(constants_1.OPTIONAL_DEPS_METADATA, [...args, index], target);
12+
};
13+
}
14+
exports.Optional = Optional;

0 commit comments

Comments
 (0)