MCPcopy Index your code
hub / github.com/google/adk-python / jrA

Function jrA

src/google/adk/cli/browser/main-3CUQG2IN.js:137–140  ·  view source on GitHub ↗
({comment:i,items:e},A,{blockItemPrefix:t,flowChars:n,itemIndent:o,onChompKeep:a,onComment:r})

Source from the content-addressed store, hash-verified

135`),j=z!==-1,X=A.inFlow??e.flow??e.items.length===0;if(j||!X){let eA=!1;if(j&&(F==="&"||F==="!")){let Z=M.indexOf(" ");F==="&"&&Z!==-1&&Z<z&&M[Z+1]==="!"&&(Z=M.indexOf(" ",Z+1)),(Z===-1||z<Z)&&(eA=!0)}eA||(x=`
136${A.indent}`)}}else(M===""||M[0]===`
137`)&&(x="");return f+=x+M,A.inFlow?k&&t&&t():S&&!k?f+=i0(f,A.indent,l(S)):E&&n&&n(),f}function Tm(i,e){(i==="debug"||i==="warn")&&console.warn(e)}var Om="<<",Zg={identify:i=>i===Om||typeof i=="symbol"&&i.description===Om,default:"key",tag:"tag:yaml.org,2002:merge",test:/^<<$/,resolve:()=>Object.assign(new $t(Symbol(Om)),{addToJSMap:k7}),stringify:()=>Om},xT=(i,e)=>(Zg.identify(e)||sn(e)&&(!e.type||e.type===$t.PLAIN)&&Zg.identify(e.value))&&i?.doc.schema.tags.some(A=>A.tag===Zg.tag&&A.default);function k7(i,e,A){if(A=i&&rg(A)?A.resolve(i.doc):A,Wg(A))for(let t of A.items)S7(i,e,t);else if(Array.isArray(A))for(let t of A)S7(i,e,t);else S7(i,e,A)}function S7(i,e,A){let t=i&&rg(A)?A.resolve(i.doc):A;if(!qg(t))throw new Error("Merge sources must be maps or map aliases");let n=t.toJSON(null,i,Map);for(let[o,a]of n)e instanceof Map?e.has(o)||e.set(o,a):e instanceof Set?e.add(o):Object.prototype.hasOwnProperty.call(e,o)||Object.defineProperty(e,o,{value:a,writable:!0,enumerable:!0,configurable:!0});return e}function Jm(i,e,{key:A,value:t}){if(Pn(A)&&A.addToJSMap)A.addToJSMap(i,e,t);else if(xT(i,A))k7(i,e,t);else{let n=pr(A,"",i);if(e instanceof Map)e.set(n,pr(t,n,i));else if(e instanceof Set)e.add(n);else{let o=PrA(A,n,i),a=pr(t,o,i);o in e?Object.defineProperty(e,o,{value:a,writable:!0,enumerable:!0,configurable:!0}):e[o]=a}}return e}function PrA(i,e,A){if(e===null)return"";if(typeof e!="object")return String(e);if(Pn(i)&&A?.doc){let t=Um(A.doc,{});t.anchors=new Set;for(let o of A.anchors.keys())t.anchors.add(o.anchor);t.inFlow=!0,t.inStringifyKey=!0;let n=i.toString(t);if(!A.mapKeyWarned){let o=JSON.stringify(n);o.length>40&&(o=o.substring(0,36)+'..."'),Tm(A.doc.options.logLevel,`Keys with collection values will be stringified due to JS Object restrictions: ${o}. Set mapAsMap: true to use object keys.`),A.mapKeyWarned=!0}return n}return JSON.stringify(e)}function kB(i,e,A){let t=$0(i,void 0,A),n=$0(e,void 0,A);return new za(t,n)}var za=class i{constructor(e,A=null){Object.defineProperty(this,Ks,{value:w7}),this.key=e,this.value=A}clone(e){let{key:A,value:t}=this;return Pn(A)&&(A=A.clone(e)),Pn(t)&&(t=t.clone(e)),new i(A,t)}toJSON(e,A){let t=A?.mapAsMap?new Map:{};return Jm(A,t,this)}toString(e,A,t){return e?.doc?_T(this,e,A,t):JSON.stringify(this)}};function Hm(i,e,A){return(e.inFlow??i.flow?VrA:jrA)(i,e,A)}function jrA({comment:i,items:e},A,{blockItemPrefix:t,flowChars:n,itemIndent:o,onChompKeep:a,onComment:r}){let{indent:s,options:{commentString:l}}=A,g=Object.assign({},A,{indent:o,type:null}),C=!1,d=[];for(let u=0;u<e.length;++u){let E=e[u],f=null;if(Pn(E))!C&&E.spaceBefore&&d.push(""),Ym(A,d,E.commentBefore,C),E.comment&&(f=E.comment);else if(Tn(E)){let v=Pn(E.key)?E.key:null;v&&(!C&&v.spaceBefore&&d.push(""),Ym(A,d,v.commentBefore,C))}C=!1;let m=AC(E,g,()=>f=null,()=>C=!0);f&&(m+=i0(m,o,l(f))),C&&f&&(C=!1),d.push(t+m)}let B;if(d.length===0)B=n.start+n.end;else{B=d[0];for(let u=1;u<d.length;++u){let E=d[u];B+=E?`
138${s}${E}`:`
139`}}return i?(B+=`
140`+sg(l(i),s),r&&r()):C&&a&&a(),B}function VrA({items:i},e,{flowChars:A,itemIndent:t}){let{indent:n,indentStep:o,flowCollectionPadding:a,options:{commentString:r}}=e;t+=o;let s=Object.assign({},e,{indent:t,inFlow:!0,type:null}),l=!1,g=0,C=[];for(let u=0;u<i.length;++u){let E=i[u],f=null;if(Pn(E))E.spaceBefore&&C.push(""),Ym(e,C,E.commentBefore,!1),E.comment&&(f=E.comment);else if(Tn(E)){let v=Pn(E.key)?E.key:null;v&&(v.spaceBefore&&C.push(""),Ym(e,C,v.commentBefore,!1),v.comment&&(l=!0));let S=Pn(E.value)?E.value:null;S?(S.comment&&(f=S.comment),S.commentBefore&&(l=!0)):E.value==null&&v?.comment&&(f=v.comment)}f&&(l=!0);let m=AC(E,s,()=>f=null);u<i.length-1&&(m+=","),f&&(m+=i0(m,t,r(f))),!l&&(C.length>g||m.includes(`
141`))&&(l=!0),C.push(m),g=C.length}let{start:d,end:B}=A;if(C.length===0)return d+B;if(!l){let u=C.reduce((E,f)=>E+f.length+2,2);l=e.options.lineWidth>0&&u>e.options.lineWidth}if(l){let u=d;for(let E of C)u+=E?`
142${o}${n}${E}`:`
143`;return`${u}

Callers

nothing calls this directly

Calls 11

lFunction · 0.90
rFunction · 0.90
aFunction · 0.90
i0Function · 0.85
assignMethod · 0.80
PnFunction · 0.70
YmFunction · 0.70
TnFunction · 0.70
ACFunction · 0.70
sgFunction · 0.70
pushMethod · 0.45

Tested by

no test coverage detected