@anthropic-ai/sdk
Version:
The official TypeScript library for the Anthropic API
18 lines • 552 B
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.promiseWithResolvers = promiseWithResolvers;
/**
* A deferred: a `Promise` together with its `resolve` / `reject` functions.
* This is `Promise.withResolvers()`, which is not available in all supported
* runtimes.
*/
function promiseWithResolvers() {
let resolve;
let reject;
const promise = new Promise((res, rej) => {
resolve = res;
reject = rej;
});
return { promise, resolve, reject };
}
//# sourceMappingURL=promise.js.map