MCPcopy Index your code
hub / github.com/nodejs/node / checkIsPromise

Function checkIsPromise

lib/assert.js:587–595  ·  view source on GitHub ↗
(obj)

Source from the content-addressed store, hash-verified

585}
586
587function checkIsPromise(obj) {
588 // Accept native ES6 promises and promises that are implemented in a similar
589 // way. Do not accept thenables that use a function as `obj` and that have no
590 // `catch` handler.
591 return isPromise(obj) ||
592 (obj !== null && typeof obj === 'object' &&
593 typeof obj.then === 'function' &&
594 typeof obj.catch === 'function');
595}
596
597async function waitForActual(promiseFn) {
598 let resultPromise;

Callers 1

waitForActualFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…