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

Method setupBodyStream

packages/common/http/test/fetch_spec.ts:846–860  ·  view source on GitHub ↗
(body?: string)

Source from the content-addressed store, hash-verified

844 }
845
846 public setupBodyStream(body?: string) {
847 if (body && this.progress.length) {
848 this.headers['content-length'] = `${body.length}`;
849 let shift = 0;
850 this.progress.forEach((loaded) => {
851 this.sub$.next(body.substring(shift, loaded));
852 shift = loaded;
853 });
854 this.sub$.next(body.substring(shift, body.length));
855 } else {
856 this.sub$.next(body);
857 }
858
859 this.sub$.complete();
860 }
861}

Callers 1

mockFlushMethod · 0.80

Calls 3

forEachMethod · 0.45
nextMethod · 0.45
completeMethod · 0.45

Tested by

no test coverage detected