Skip to content

Commit a2aade0

Browse files
authored
fix(transform): explicit variable cast to Function
1 parent 01007d4 commit a2aade0

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/TransformOperationExecutor.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -191,7 +191,7 @@ export class TransformOperationExecutor {
191191
}
192192

193193
// if value is an array try to get its custom array type
194-
const arrayType = Array.isArray(value[valueKey]) ? this.getReflectedType(targetType, propertyName) : undefined;
194+
const arrayType = Array.isArray(value[valueKey]) ? this.getReflectedType((targetType as Function), propertyName) : undefined;
195195

196196
// const subValueKey = TransformationType === TransformationType.PLAIN_TO_CLASS && newKeyName ? newKeyName : key;
197197
const subSource = source ? source[valueKey] : undefined;
@@ -217,14 +217,14 @@ export class TransformOperationExecutor {
217217
// Get original value
218218
finalValue = value[transformKey];
219219
// Apply custom transformation
220-
finalValue = this.applyCustomTransformations(finalValue, targetType, transformKey, value, this.transformationType);
220+
finalValue = this.applyCustomTransformations(finalValue, (targetType as Function), transformKey, value, this.transformationType);
221221
// If nothing change, it means no custom transformation was applied, so use the subValue.
222222
finalValue = (value[transformKey] === finalValue) ? subValue : finalValue;
223223
// Apply the default transformation
224224
finalValue = this.transform(subSource, finalValue, type, arrayType, isSubValueMap, level + 1);
225225
} else {
226226
finalValue = this.transform(subSource, subValue, type, arrayType, isSubValueMap, level + 1);
227-
finalValue = this.applyCustomTransformations(finalValue, targetType, transformKey, value, this.transformationType);
227+
finalValue = this.applyCustomTransformations(finalValue, (targetType as Function), transformKey, value, this.transformationType);
228228
}
229229

230230
if (newValue instanceof Map) {

0 commit comments

Comments
 (0)