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

Method setupBodyStream

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

Source from the content-addressed store, hash-verified

936 }
937
938 public setupBodyStream(body?: string) {
939 if (body && this.progress.length) {
940 this.headers['content-length'] = `${body.length}`;
941 let shift = 0;
942 this.progress.forEach((loaded) => {
943 this.sub$.next(body.substring(shift, loaded));
944 shift = loaded;
945 });
946 this.sub$.next(body.substring(shift, body.length));
947 } else {
948 this.sub$.next(body);
949 }
950
951 this.sub$.complete();
952 }
953}

Callers 1

mockFlushMethod · 0.80

Calls 3

forEachMethod · 0.45
nextMethod · 0.45
completeMethod · 0.45

Tested by

no test coverage detected