MCPcopy Create free account
hub / github.com/PageLeay/celestial-runtime / bodyText

Method bodyText

src.ts/utils/fetch.ts:812–820  ·  view source on GitHub ↗

* The response body as a UTF-8 encoded string, or the empty * string (i.e. ``""``) if there was no body. * * An error is thrown if the body is invalid UTF-8 data.

()

Source from the content-addressed store, hash-verified

810 * An error is thrown if the body is invalid UTF-8 data.
811 */
812 get bodyText(): string {
813 try {
814 return (this.#body == null) ? "": toUtf8String(this.#body);
815 } catch (error) {
816 assert(false, "response body is not valid UTF-8 data", "UNSUPPORTED_OPERATION", {
817 operation: "bodyText", info: { response: this }
818 });
819 }
820 }
821
822 /**
823 * The response body, decoded as JSON.

Callers

nothing calls this directly

Calls 2

toUtf8StringFunction · 0.90
assertFunction · 0.90

Tested by

no test coverage detected