Skip to content

Commit 6b49a48

Browse files
committed
add promise type guard
1 parent 044f1f6 commit 6b49a48

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

js/packages/openinference-core/src/utils/typeUtils.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,9 +42,10 @@ export function isObjectWithStringKeys(
4242
*/
4343
export function isPromise<T = unknown>(value: unknown): value is Promise<T> {
4444
return (
45-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
4645
!!value &&
46+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
4747
(value as any)?.then === "function" &&
48+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
4849
(value as any)?.catch === "function"
4950
);
5051
}

0 commit comments

Comments
 (0)