mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-02 12:50:23 +00:00
Merged via squash.
Prepared head SHA: 523623b7e1
Co-authored-by: gumadeiras <5599352+gumadeiras@users.noreply.github.com>
Co-authored-by: gumadeiras <5599352+gumadeiras@users.noreply.github.com>
Reviewed-by: @gumadeiras
9 lines
265 B
TypeScript
9 lines
265 B
TypeScript
export function isPromiseLike<T>(value: unknown): value is PromiseLike<T> {
|
|
return Boolean(
|
|
value &&
|
|
(typeof value === "object" || typeof value === "function") &&
|
|
"then" in value &&
|
|
typeof (value as { then?: unknown }).then === "function",
|
|
);
|
|
}
|