Rocky_Mountain_Vending/.pnpm-store/v10/files/d0/b7c09e392285ddc491a1c3b7d6d906590f122f00eab52041914f6e12dd03bd9ce789bf1034c7464986700bcc918d507a228897565791556f81016a14b901f0
DMleadgen 46d973904b
Initial commit: Rocky Mountain Vending website
Next.js website for Rocky Mountain Vending company featuring:
- Product catalog with Stripe integration
- Service areas and parts pages
- Admin dashboard with Clerk authentication
- SEO optimized pages with JSON-LD structured data

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-02-12 16:22:15 -07:00

52 lines
No EOL
1.3 KiB
Text

/**
* @license
* Copyright 2023 Google Inc.
* SPDX-License-Identifier: Apache-2.0
*/
/**
* The HTTPResponse class represents responses which are received by the
* {@link Page} class.
*
* @public
*/
export class HTTPResponse {
/**
* @internal
*/
constructor() { }
/**
* True if the response was successful (status in the range 200-299).
*/
ok() {
// TODO: document === 0 case?
const status = this.status();
return status === 0 || (status >= 200 && status <= 299);
}
/**
* {@inheritDoc HTTPResponse.content}
*/
async buffer() {
const content = await this.content();
return Buffer.from(content);
}
/**
* Promise which resolves to a text (utf8) representation of response body.
*/
async text() {
const content = await this.content();
return new TextDecoder().decode(content);
}
/**
* Promise which resolves to a JSON representation of response body.
*
* @remarks
*
* This method will throw if the response body is not parsable via
* `JSON.parse`.
*/
async json() {
const content = await this.text();
return JSON.parse(content);
}
}
//# sourceMappingURL=HTTPResponse.js.map