MCPcopy
hub / github.com/mongodb/node-mongodb-native / isPromiseLike

Function isPromiseLike

src/utils.ts:171–178  ·  view source on GitHub ↗
(value?: unknown)

Source from the content-addressed store, hash-verified

169 * @returns true if the provided value is a Promise
170 */
171export function isPromiseLike<T = unknown>(value?: unknown): value is PromiseLike<T> {
172 return (
173 value != null &&
174 typeof value === 'object' &&
175 'then' in value &&
176 typeof value.then === 'function'
177 );
178}
179
180/**
181 * Applies collation to a given command.

Callers 2

withTransactionMethod · 0.90
logMethod · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected