@arizeai/phoenix-evals
Version:
A library for running evaluations for AI use cases
16 lines • 629 B
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.isPromise = isPromise;
/**
* Type guard for if a function is a Promise
* @param value
* @returns true if it is a Promise
*/
function isPromise(value) {
return (!!value &&
// eslint-disable-next-line @typescript-eslint/no-explicit-any
typeof (value === null || value === void 0 ? void 0 : value.then) === "function" &&
// eslint-disable-next-line @typescript-eslint/no-explicit-any
typeof (value === null || value === void 0 ? void 0 : value.catch) === "function");
}
//# sourceMappingURL=typeUtils.js.map