Skip to content

Commit 5e332af

Browse files
authored
fix: Promise resolver <x> is not a function when transforming Promise (#463)
1 parent c8c7884 commit 5e332af

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

src/TransformOperationExecutor.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -116,6 +116,8 @@ export class TransformOperationExecutor {
116116
} else if (!!getGlobal().Buffer && (targetType === Buffer || value instanceof Buffer) && !isMap) {
117117
if (value === null || value === undefined) return value;
118118
return Buffer.from(value);
119+
} else if (!isMap && value !== null && typeof value === 'object' && typeof value.then === 'function') {
120+
return value; // skip promise transformation
119121
} else if (typeof value === 'object' && value !== null) {
120122
// try to guess the type
121123
if (!targetType && value.constructor !== Object /* && TransformationType === TransformationType.CLASS_TO_PLAIN*/)

0 commit comments

Comments
 (0)