MCPcopy
hub / github.com/vuejs/core / isPromise

Function isPromise

packages/shared/src/general.ts:56–62  ·  view source on GitHub ↗
(val: unknown)

Source from the content-addressed store, hash-verified

54 val !== null && typeof val === 'object'
55
56export const isPromise = <T = any>(val: unknown): val is Promise<T> => {
57 return (
58 (isObject(val) || isFunction(val)) &&
59 isFunction((val as any).then) &&
60 isFunction((val as any).catch)
61 )
62}
63
64export const objectToString: typeof Object.prototype.toString =
65 Object.prototype.toString

Callers 11

pushFunction · 0.90
renderComponentVNodeFunction · 0.90
unrollBufferFunction · 0.90
pipeToWebWritableFunction · 0.90
nestedUnrollBufferFunction · 0.90
ssrRenderTeleportFunction · 0.90
applyOptionsFunction · 0.90
withAsyncContextFunction · 0.90
setupStatefulComponentFunction · 0.90

Calls 2

isObjectFunction · 0.85
isFunctionFunction · 0.85

Tested by

no test coverage detected