MCPcopy Create free account
hub / github.com/angular/angular / setupBodyStream

Method setupBodyStream

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

Source from the content-addressed store, hash-verified

906 }
907
908 public setupBodyStream(body?: string) {
909 if (body && this.progress.length) {
910 this.headers['content-length'] = `${body.length}`;
911 let shift = 0;
912 this.progress.forEach((loaded) => {
913 this.sub$.next(body.substring(shift, loaded));
914 shift = loaded;
915 });
916 this.sub$.next(body.substring(shift, body.length));
917 } else {
918 this.sub$.next(body);
919 }
920
921 this.sub$.complete();
922 }
923}

Callers 1

mockFlushMethod · 0.80

Calls 3

forEachMethod · 0.45
nextMethod · 0.45
completeMethod · 0.45

Tested by

no test coverage detected