MCPcopy Index your code
hub / github.com/tensorflow/tfjs / pump

Method pump

tfjs-data/src/iterators/byte_chunk_iterator.ts:108–125  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

106 }
107
108 async pump(): Promise<boolean> {
109 const chunkResult = await this.upstream.next();
110 let chunk;
111 if (chunkResult.done) {
112 return false;
113 } else {
114 chunk = chunkResult.value;
115 }
116
117 let text: string;
118 if (env().get('IS_BROWSER')) {
119 text = this.decoder.decode(chunk, {stream: true});
120 } else {
121 text = this.decoder.write(Buffer.from(chunk.buffer));
122 }
123 this.outputQueue.push(text);
124 return true;
125 }
126}

Callers

nothing calls this directly

Calls 6

envFunction · 0.90
decodeMethod · 0.65
writeMethod · 0.65
nextMethod · 0.45
getMethod · 0.45
pushMethod · 0.45

Tested by

no test coverage detected