MCPcopy Index your code
hub / github.com/angular/angular / getBody

Method getBody

packages/service-worker/worker/testing/fetch.ts:47–56  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

45 }
46
47 private getBody(): string {
48 if (this.bodyUsed === true) {
49 throw new Error('Cannot reuse body without cloning.');
50 }
51 this.bodyUsed = true;
52
53 // According to the spec, a `null` body results in an empty `ReadableStream` (which for our
54 // needs is equivalent to `''`). See https://fetch.spec.whatwg.org/#concept-body-consume-body.
55 return this._body || '';
56 }
57}
58
59export class MockHeaders implements Headers {

Callers 3

arrayBufferMethod · 0.95
jsonMethod · 0.95
textMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected