MCPcopy Create free account
hub / github.com/Effect-TS/effect / isPromise

Function isPromise

packages/effect/src/Predicate.ts:1374–1376  ·  view source on GitHub ↗
(input: unknown)

Source from the content-addressed store, hash-verified

1372 * @since 2.0.0
1373 */
1374export function isPromise(input: unknown): input is Promise<unknown> {
1375 return hasProperty(input, "then") && "catch" in input && isFunction(input.then) && isFunction(input.catch)
1376}
1377
1378/**
1379 * Checks whether a value is `PromiseLike` (has a `then` method).

Callers

nothing calls this directly

Calls 2

hasPropertyFunction · 0.85
isFunctionFunction · 0.85

Tested by

no test coverage detected