refactor(): complex refactoring

This commit is contained in:
Aleksandr Bukhalo
2020-01-12 02:41:27 +03:00
parent 2617c19af9
commit b67b859810
19 changed files with 44 additions and 59 deletions

View File

@@ -0,0 +1,18 @@
import { Type } from '@nestjs/common'
import { ContextTransformer } from '../interfaces'
import { addHandlerToStore } from './'
export const PipeContext = <T>(transform: Type<ContextTransformer<T>>) => (
target: Object,
propertyKey: string,
parameterIndex: number,
) => {
addHandlerToStore(target, propertyKey, {
transformations: [
{
index: parameterIndex,
transform,
},
],
})
}