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

Method setupBodyStream

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

Source from the content-addressed store, hash-verified

916 }
917
918 public setupBodyStream(body?: string) {
919 if (body && this.progress.length) {
920 this.headers['content-length'] = `${body.length}`;
921 let shift = 0;
922 this.progress.forEach((loaded) => {
923 this.sub$.next(body.substring(shift, loaded));
924 shift = loaded;
925 });
926 this.sub$.next(body.substring(shift, body.length));
927 } else {
928 this.sub$.next(body);
929 }
930
931 this.sub$.complete();
932 }
933}

Callers 1

mockFlushMethod · 0.80

Calls 3

forEachMethod · 0.45
nextMethod · 0.45
completeMethod · 0.45

Tested by

no test coverage detected