Skip to content
This repository has been archived by the owner on May 17, 2022. It is now read-only.

Commit

Permalink
Merge branch 'master' of https://github.com/nestjs/nest
Browse files Browse the repository at this point in the history
  • Loading branch information
Kamil authored and Kamil committed Jun 20, 2018
2 parents f2d2d56 + 617bc70 commit 7ad6095
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 6 deletions.
4 changes: 4 additions & 0 deletions Readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,10 @@ Nest is an MIT-licensed open source project. It can grow thanks to the sponsors

<a href="https://valor-software.com/"><img src="https://docs.nestjs.com/assets/sponsors/valor-software.png" width="300" /></a>

#### Silver Sponsor

<a href="https://neoteric.eu/"><img src="https://nestjs.com/img/neoteric-cut.png" width="130" /></a>

#### Sponsors

<a href="https://scal.io"><img src="https://nestjs.com/img/scalio-logo.svg" width="120" /></a> &nbsp; <a href="https://www.swingdev.io"><img src="https://nestjs.com/img/swingdev-logo.svg#1" 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>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,13 +1,14 @@
import { CustomParamFactory } from '../../interfaces/features/custom-route-param-factory.interface';
import { PipeTransform } from '../../index';
import { Type } from '../../interfaces';
/**
* Creates HTTP route param decorator
* @param factory
*/
export declare function createParamDecorator(factory: CustomParamFactory): (data?: any, ...pipes: PipeTransform<any>[]) => ParameterDecorator;
export declare function createParamDecorator(factory: CustomParamFactory): (data?: any, ...pipes: (Type<PipeTransform> | PipeTransform)[]) => ParameterDecorator;
/**
* Creates HTTP route param decorator
* @deprecated
* @param factory
*/
export declare function createRouteParamDecorator(factory: CustomParamFactory): (data?: any, ...pipes: PipeTransform<any>[]) => ParameterDecorator;
export declare function createRouteParamDecorator(factory: CustomParamFactory): (data?: any, ...pipes: (Type<PipeTransform> | PipeTransform)[]) => ParameterDecorator;
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,15 @@ import { CustomParamFactory } from '../../interfaces/features/custom-route-param
import { RouteParamsMetadata, ParamData } from './route-params.decorator';
import { PipeTransform } from '../../index';
import { isNil, isString } from '../../utils/shared.utils';
import { Type } from '../../interfaces';

const assignCustomMetadata = (
args: RouteParamsMetadata,
paramtype: number | string,
index: number,
factory: CustomParamFactory,
data?: ParamData,
...pipes: PipeTransform<any>[],
...pipes: (Type<PipeTransform> | PipeTransform)[],
) => ({
...args,
[`${paramtype}${CUSTOM_ROUTE_AGRS_METADATA}:${index}`]: {
Expand All @@ -36,9 +37,9 @@ const randomString = () =>
*/
export function createParamDecorator(
factory: CustomParamFactory,
): (data?: any, ...pipes: PipeTransform<any>[]) => ParameterDecorator {
): (data?: any, ...pipes: (Type<PipeTransform> | PipeTransform)[]) => ParameterDecorator {
const paramtype = randomString() + randomString();
return (data?, ...pipes: PipeTransform<any>[]): ParameterDecorator => (
return (data?, ...pipes: (Type<PipeTransform> | PipeTransform)[]): ParameterDecorator => (
target,
key,
index,
Expand All @@ -61,7 +62,7 @@ export function createParamDecorator(
*/
export function createRouteParamDecorator(
factory: CustomParamFactory,
): (data?: any, ...pipes: PipeTransform<any>[]) => ParameterDecorator {
): (data?: any, ...pipes: (Type<PipeTransform> | PipeTransform)[]) => ParameterDecorator {
deprecate(
'The "createRouteParamDecorator" function is deprecated and will be removed within next major release. Use "createParamDecorator" instead.',
);
Expand Down

0 comments on commit 7ad6095

Please sign in to comment.