Skip to content

Commit 7ca1e48

Browse files
committed
fix: #143 Add comments to explain algo
1 parent 9a63b36 commit 7ca1e48

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/TransformOperationExecutor.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -167,10 +167,13 @@ export class TransformOperationExecutor {
167167
let finalValue;
168168

169169
if (this.transformationType === TransformationType.CLASS_TO_PLAIN) {
170+
// Get original value
170171
finalValue = value[transformKey];
172+
// Apply custom transformation
171173
finalValue = this.applyCustomTransformations(finalValue, targetType, transformKey, value, this.transformationType);
174+
// If nothing change, it means no custom transformation was applied, so use the subValue.
172175
finalValue = (value[transformKey] === finalValue) ? subValue : finalValue;
173-
// value[transformKey] = finalValue;
176+
// Apply the default transformation
174177
finalValue = this.transform(subSource, finalValue, type, arrayType, isSubValueMap, level + 1);
175178
} else {
176179
finalValue = this.transform(subSource, subValue, type, arrayType, isSubValueMap, level + 1);

0 commit comments

Comments
 (0)