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

Method setupBodyStream

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

Source from the content-addressed store, hash-verified

1103 }
1104
1105 public setupBodyStream(body?: string) {
1106 if (body && this.progress.length) {
1107 this.headers['content-length'] = `${body.length}`;
1108 let shift = 0;
1109 this.progress.forEach((loaded) => {
1110 this.sub$.next(body.substring(shift, loaded));
1111 shift = loaded;
1112 });
1113 this.sub$.next(body.substring(shift, body.length));
1114 } else {
1115 this.sub$.next(body);
1116 }
1117
1118 this.sub$.complete();
1119 }
1120}

Callers 1

mockFlushMethod · 0.80

Calls 3

forEachMethod · 0.45
nextMethod · 0.45
completeMethod · 0.45

Tested by

no test coverage detected