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

Function isPromise

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

Source from the content-addressed store, hash-verified

1324 * @since 2.0.0
1325 */
1326export function isPromise(input: unknown): input is Promise<unknown> {
1327 return hasProperty(input, "then") && "catch" in input && isFunction(input.then) && isFunction(input.catch)
1328}
1329
1330/**
1331 * Checks whether a value is `PromiseLike` (has a `then` method).

Callers

nothing calls this directly

Calls 1

isFunctionFunction · 0.85

Tested by

no test coverage detected