MCPcopy
hub / github.com/toddbluhm/env-cmd / isPromise

Function isPromise

src/utils.ts:38–43  ·  view source on GitHub ↗
(value?: T | PromiseLike<T>)

Source from the content-addressed store, hash-verified

36 * A simple function to test if the value is a promise/thenable
37 */
38export function isPromise<T>(value?: T | PromiseLike<T>): value is PromiseLike<T> {
39 return value != null
40 && typeof value === 'object'
41 && 'then' in value
42 && typeof value.then === 'function'
43}
44
45/** @returns true if the error is `ERR_UNKNOWN_FILE_EXTENSION` */
46export function isLoaderError(error: unknown): error is Error {

Callers 3

utils.spec.tsFile · 0.85
getRCFileVarsFunction · 0.85
getEnvFileVarsFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected