UNPKG

@vercel/sdk

Version:

<p align="center"> <a href="https://vercel.com"> <img src="https://assets.vercel.com/image/upload/v1588805858/repositories/vercel/logo.png" height="96"> <h3 align="center">Vercel</h3> </a> <p align="center">Develop. Preview. Ship.</p> </p>

28 lines 879 B
/* * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. */ export class APIPromise { #promise; #unwrapped; [Symbol.toStringTag] = "APIPromise"; constructor(p) { this.#promise = p instanceof Promise ? p : Promise.resolve(p); this.#unwrapped = p instanceof Promise ? null : Promise.resolve(p[0]); } #getUnwrapped() { return (this.#unwrapped ?? (this.#unwrapped = this.#promise.then(([value]) => value))); } then(onfulfilled, onrejected) { return this.#promise.then(onfulfilled ? ([value]) => onfulfilled(value) : void 0, onrejected); } catch(onrejected) { return this.#getUnwrapped().catch(onrejected); } finally(onfinally) { return this.#getUnwrapped().finally(onfinally); } $inspect() { return this.#promise; } } //# sourceMappingURL=async.js.map