MCPcopy
hub / github.com/loopbackio/loopback-next / isPromiseLike

Function isPromiseLike

packages/context/src/value-promise.ts:41–47  ·  view source on GitHub ↗
(
  value: T | PromiseLike<T> | undefined,
)

Source from the content-addressed store, hash-verified

39 * @param value - The value to check.
40 */
41export function isPromiseLike<T>(
42 value: T | PromiseLike<T> | undefined,
43): value is PromiseLike<T> {
44 if (!value) return false;
45 if (typeof value !== 'object' && typeof value !== 'function') return false;
46 return typeof (value as PromiseLike<T>).then === 'function';
47}
48
49/**
50 * Get nested properties of an object by path

Callers 12

toMethod · 0.90
getConfigSyncMethod · 0.90
getSyncMethod · 0.90
resolveMethod · 0.90
greetFromAllFunction · 0.90
resolveMapFunction · 0.85
resolveListFunction · 0.85
tryCatchFinallyFunction · 0.85
resolveUntilFunction · 0.85
transformValueOrPromiseFunction · 0.85
is-promise.unit.tsFile · 0.85
context.unit.tsFile · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected