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

Method setupBodyStream

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

Source from the content-addressed store, hash-verified

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

Callers 1

mockFlushMethod · 0.80

Calls 3

forEachMethod · 0.45
nextMethod · 0.45
completeMethod · 0.45

Tested by

no test coverage detected