Skip to content

Commit 823155c

Browse files
committed
Fix types in normalizeParamValue method
1 parent 0e91408 commit 823155c

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/ActionParameterHandler.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -112,12 +112,12 @@ export class ActionParameterHandler<T extends BaseDriver> {
112112
// if param value is an object and param type match, normalize its string properties
113113
if (typeof value === "object" && ["queries", "headers", "params", "cookies"].some(paramType => paramType === param.type)) {
114114
Object.keys(value).map(key => {
115-
const keyValue = (value as any)[key];
115+
const keyValue = value[key];
116116
if (typeof keyValue === "string") {
117-
const ParamType = Reflect.getMetadata("design:type", param.targetType.prototype, key);
117+
const ParamType: Function|undefined = Reflect.getMetadata("design:type", param.targetType.prototype, key);
118118
if (ParamType) {
119-
const typeString = ParamType.name.toLowerCase(); // reflected type is always constructor-like (?)
120-
(value as any)[key] = this.normalizeStringValue(keyValue, param.name, typeString);
119+
const typeString = ParamType.name.toLowerCase(); // reflected type is always constructor-like?
120+
value[key] = this.normalizeStringValue(keyValue, param.name, typeString);
121121
}
122122
}
123123
});

0 commit comments

Comments
 (0)