From 8d43759e51e466eb8178953c041df36868881fa8 Mon Sep 17 00:00:00 2001 From: Luc Patiny Date: Thu, 19 Dec 2024 11:57:42 +0100 Subject: [PATCH] fix: use thenable in recursiveResolve --- src/utils/recursiveResolve.ts | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/utils/recursiveResolve.ts b/src/utils/recursiveResolve.ts index 123c3dc5..e70554c2 100644 --- a/src/utils/recursiveResolve.ts +++ b/src/utils/recursiveResolve.ts @@ -15,8 +15,10 @@ export async function recursiveResolve(object: unknown) { function appendPromises(object: any, promises: Array>) { if (typeof object !== 'object') return object; for (const key in object) { - if (object[key] instanceof Promise) { - promises.push(object[key].then((value) => (object[key] = value))); + if (typeof object[key].then === 'function') { + promises.push( + object[key].then((value: unknown) => (object[key] = value)), + ); } else if (typeof object[key] === 'object') { appendPromises(object[key], promises); }