MCPcopy Index your code
hub / github.com/ChinaSiro/claude-code-sourcemap / g$K

Function g$K

package/cli.js:3023–3023  ·  view source on GitHub ↗
({file_path:q,edits:K})

Source from the content-addressed store, hash-verified

3021
3022... [${A} lines truncated] ...`}function B$K(q){return q.map((K)=>{let _=[],z=[],Y=[];for(let $ of K.lines)if($.startsWith(" "))_.push($.slice(1)),z.push($.slice(1)),Y.push($.slice(1));else if($.startsWith("-"))z.push($.slice(1));else if($.startsWith("+"))Y.push($.slice(1));return{old_string:z.join(`
3023`),new_string:Y.join(`
3024`),replace_all:!1}})}function maz(q){let K=q,_=[];for(let[z,Y]of Object.entries(uaz)){let $=K;if(K=K.replaceAll(z,Y),$!==K)_.push({from:z,to:Y})}return{result:K,appliedReplacements:_}}function g$K({file_path:q,edits:K}){if(K.length===0)return{file_path:q,edits:K};let _=/\.(md|mdx)$/i.test(q);try{let z=lq(q),Y=v41(z);return{file_path:q,edits:K.map(({old_string:$,new_string:A,replace_all:O})=>{let w=_?A:Ls1(A);if(Y.includes($))return{old_string:$,new_string:w,replace_all:O};let{result:j,appliedReplacements:H}=maz($);if(Y.includes(j)){let J=w;for(let{from:M,to:X}of H)J=J.replaceAll(M,X);return{old_string:j,new_string:J,replace_all:O}}return{old_string:$,new_string:w,replace_all:O}})}}catch(z){if(!_7(z))H6(z)}return{file_path:q,edits:K}}function paz(q,K,_){if(q.length===K.length&&q.every((O,w)=>{let j=K[w];return j!==void 0&&O.old_string===j.old_string&&O.new_string===j.new_string&&O.replace_all===j.replace_all}))return!0;let z=null,Y=null,$=null,A=null;try{z=K88({filePath:"temp",fileContents:_,edits:q})}catch(O){Y=d6(O)}try{$=K88({filePath:"temp",fileContents:_,edits:K})}catch(O){A=d6(O)}if(Y!==null&&A!==null)return Y===A;if(Y!==null||A!==null)return!1;return z.updatedFile===$.updatedFile}function F$K(q,K){if(q.file_path!==K.file_path)return!1;if(q.edits.length===K.edits.length&&q.edits.every((z,Y)=>{let $=K.edits[Y];return $!==void 0&&z.old_string===$.old_string&&z.new_string===$.new_string&&z.replace_all===$.replace_all}))return!0;let _="";try{_=v41(q.file_path)}catch(z){if(!_7(z))throw z}return paz(q.edits,K.edits,_)}var Ns1="‘",Gu8="’",ys1="“",Es1="”",Vs1=8192,uaz;var Uj6=y(()=>{RO6();E8();dz();BQ();y8();bK();uaz={"<fnr>":"<function_results>","<n>":"<name>","</n>":"</name>","<o>":"<output>","</o>":"</output>","<e>":"<error>","</e>":"</error>","<s>":"<system>","</s>":"</system>","<r>":"<result>","</r>":"</result>","< META_START >":"<META_START>","< META_END >":"<META_END>","< EOT >":"<EOT>","< META >":"<META>","< SOS >":"<SOS>","\n\nH:":`
3025
3026Human:`,"\n\nA:":`

Callers 1

zZKFunction · 0.85

Calls 8

lqFunction · 0.85
v41Function · 0.85
Ls1Function · 0.85
mazFunction · 0.85
_7Function · 0.85
H6Function · 0.85
includesMethod · 0.80
testMethod · 0.45

Tested by

no test coverage detected