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

Method bodyText

lib.esm/utils/fetch.js:703–712  ·  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

701 * An error is thrown if the body is invalid UTF-8 data.
702 */
703 get bodyText() {
704 try {
705 return (this.#body == null) ? "" : toUtf8String(this.#body);
706 }
707 catch (error) {
708 assert(false, "response body is not valid UTF-8 data", "UNSUPPORTED_OPERATION", {
709 operation: "bodyText", info: { response: this }
710 });
711 }
712 }
713 /**
714 * The response body, decoded as JSON.
715 *

Callers

nothing calls this directly

Calls 2

toUtf8StringFunction · 0.90
assertFunction · 0.90

Tested by

no test coverage detected