MCPcopy Index your code
hub / github.com/ChinaSiro/claude-code-sourcemap / oI5

Function oI5

package/cli.js:223–225  ·  view source on GitHub ↗
(q,K,_,z,Y,$,A,O)

Source from the content-addressed store, hash-verified

221`,"latin1");else if(K9.isBuffer(K)){if(z3($===K.byteLength,"buffer body must have content length"),Y.cork(),Y.write(`${A}content-length: ${$}\r
222\r
223`,"latin1"),Y.write(K),Y.uncork(),z.onBodySent(K),!O&&z.reset!==!1)Y[ek]=!0}z.onRequestSent(),_[ie]()}catch(w){q(w)}}async function oI5(q,K,_,z,Y,$,A,O){z3($===K.size,"blob body must have content length");try{if($!=null&&$!==K.size)throw new S_6;let w=Buffer.from(await K.arrayBuffer());if(Y.cork(),Y.write(`${A}content-length: ${$}\r
224\r
225`,"latin1"),Y.write(w),Y.uncork(),z.onBodySent(w),z.onRequestSent(),!O&&z.reset!==!1)Y[ek]=!0;_[ie]()}catch(w){q(w)}}async function PI7(q,K,_,z,Y,$,A,O){z3($!==0||_[gZ]===0,"iterator body cannot be pipelined");let w=null;function j(){if(w){let M=w;w=null,M()}}let H=()=>new Promise((M,X)=>{if(z3(w===null),Y[yh])X(Y[yh]);else w=M});Y.on("close",j).on("drain",j);let J=new V51({abort:q,socket:Y,request:z,contentLength:$,client:_,expectsPayload:O,header:A});try{for await(let M of K){if(Y[yh])throw Y[yh];if(!J.write(M))await H()}J.end()}catch(M){J.destroy(M)}finally{Y.off("close",j).off("drain",j)}}class V51{constructor({abort:q,socket:K,request:_,contentLength:z,client:Y,expectsPayload:$,header:A}){this.socket=K,this.request=_,this.contentLength=z,this.client=Y,this.bytesWritten=0,this.expectsPayload=$,this.header=A,this.abort=q,K[re]=!0}write(q){let{socket:K,request:_,contentLength:z,client:Y,bytesWritten:$,expectsPayload:A,header:O}=this;if(K[yh])throw K[yh];if(K.destroyed)return!1;let w=Buffer.byteLength(q);if(!w)return!0;if(z!==null&&$+w>z){if(Y[T51])throw new S_6;process.emitWarning(new S_6)}if(K.cork(),$===0){if(!A&&_.reset!==!1)K[ek]=!0;if(z===null)K.write(`${O}transfer-encoding: chunked\r
226`,"latin1");else K.write(`${O}content-length: ${z}\r
227\r
228`,"latin1")}if(z===null)K.write(`\r

Callers 1

iI5Function · 0.85

Calls 6

qFunction · 0.70
fromMethod · 0.45
arrayBufferMethod · 0.45
writeMethod · 0.45
onBodySentMethod · 0.45
onRequestSentMethod · 0.45

Tested by

no test coverage detected