MCPcopy Create free account
hub / github.com/ChinaSiro/claude-code-sourcemap / aL_

Function aL_

package/cli.js:713–717  ·  view source on GitHub ↗
(q,K)

Source from the content-addressed store, hash-verified

711${_}`:_;else if(z||q.directives.docStart||!Y)q.commentBefore=_;else if(E44.isCollection(Y)&&!Y.flow&&Y.items.length>0){let $=Y.items[0];if(E44.isPair($))$=$.key;let A=$.commentBefore;$.commentBefore=A?`${_}
712${A}`:_}else{let $=Y.commentBefore;Y.commentBefore=$?`${_}
713${$}`:_}}if(K)Array.prototype.push.apply(q.errors,this.errors),Array.prototype.push.apply(q.warnings,this.warnings);else q.errors=this.errors,q.warnings=this.warnings;this.prelude=[],this.errors=[],this.warnings=[]}streamInfo(){return{comment:L44(this.prelude).comment,directives:this.directives,errors:this.errors,warnings:this.warnings}}*compose(q,K=!1,_=-1){for(let z of q)yield*this.next(z);yield*this.end(K,_)}*next(q){if(gL_.env.LOG_STREAM)console.dir(q,{depth:null});switch(q.type){case"directive":this.directives.add(q.source,(K,_,z)=>{let Y=Xn6(q);Y[0]+=K,this.onError(Y,"BAD_DIRECTIVE",_,z)}),this.prelude.push(q.source),this.atDirectives=!0;break;case"document":{let K=QL_.composeDoc(this.options,this.directives,q,this.onError);if(this.atDirectives&&!K.directives.docStart)this.onError(q,"MISSING_CHAR","Missing directives-end/doc-start indicator line");if(this.decorate(K,!1),this.doc)yield this.doc;this.doc=K,this.atDirectives=!1;break}case"byte-order-mark":case"space":break;case"comment":case"newline":this.prelude.push(q.source);break;case"error":{let K=q.source?`${q.message}: ${JSON.stringify(q.source)}`:q.message,_=new Mn6.YAMLParseError(Xn6(q),"UNEXPECTED_TOKEN",K);if(this.atDirectives||!this.doc)this.errors.push(_);else this.doc.errors.push(_);break}case"doc-end":{if(!this.doc){this.errors.push(new Mn6.YAMLParseError(Xn6(q),"UNEXPECTED_TOKEN","Unexpected doc-end without preceding document"));break}this.doc.directives.docEnd=!0;let K=dL_.resolveEnd(q.end,q.offset+q.source.length,this.doc.options.strict,this.onError);if(this.decorate(this.doc,!0),K.comment){let _=this.doc.comment;this.doc.comment=_?`${_}
714${K.comment}`:K.comment}this.doc.range[2]=K.offset;break}default:this.errors.push(new Mn6.YAMLParseError(Xn6(q),"UNEXPECTED_TOKEN",`Unsupported token ${q.type}`))}}*end(q=!1,K=-1){if(this.doc)this.decorate(this.doc,!0),yield this.doc,this.doc=null;else if(q){let _=Object.assign({_directives:this.directives},this.options),z=new UL_.Document(void 0,_);if(this.atDirectives)this.onError(K,"MISSING_CHAR","Missing directives-end indicator line");z.range=[0,K,K],this.decorate(z,!1),yield z}}}cL_.Composer=R44});var C44=m((eL_)=>{var nL_=zh1(),iL_=$h1(),rL_=Hn6(),h44=tl6();function oL_(q,K=!0,_){if(q){let z=(Y,$,A)=>{let O=typeof Y==="number"?Y:Array.isArray(Y)?Y[0]:Y.offset;if(_)_(O,$,A);else throw new rL_.YAMLParseError([O,O+1],$,A)};switch(q.type){case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":return iL_.resolveFlowScalar(q,K,z);case"block-scalar":return nL_.resolveBlockScalar({options:{strict:K}},q,z)}}return null}function aL_(q,K){let{implicitKey:_=!1,indent:z,inFlow:Y=!1,offset:$=-1,type:A="PLAIN"}=K,O=h44.stringifyString({type:A,value:q},{implicitKey:_,indent:z>0?" ".repeat(z):"",inFlow:Y,options:{blockQuote:!0,lineWidth:-1}}),w=K.end??[{type:"newline",offset:-1,indent:z,source:`
715`}];switch(O[0]){case"|":case">":{let j=O.indexOf(`
716`),H=O.substring(0,j),J=O.substring(j+1)+`
717`,M=[{type:"block-scalar-header",offset:$,indent:z,source:H}];if(!S44(M,w))M.push({type:"newline",offset:-1,indent:z,source:`
718`});return{type:"block-scalar",offset:$,indent:z,props:M,source:J}}case'"':return{type:"double-quoted-scalar",offset:$,indent:z,source:O,end:w};case"'":return{type:"single-quoted-scalar",offset:$,indent:z,source:O,end:w};default:return{type:"scalar",offset:$,indent:z,source:O,end:w}}}function sL_(q,K,_={}){let{afterKey:z=!1,implicitKey:Y=!1,inFlow:$=!1,type:A}=_,O="indent"in q?q.indent:null;if(z&&typeof O==="number")O+=2;if(!A)switch(q.type){case"single-quoted-scalar":A="QUOTE_SINGLE";break;case"double-quoted-scalar":A="QUOTE_DOUBLE";break;case"block-scalar":{let j=q.props[0];if(j.type!=="block-scalar-header")throw Error("Invalid block scalar header");A=j.source[0]===">"?"BLOCK_FOLDED":"BLOCK_LITERAL";break}default:A="PLAIN"}let w=h44.stringifyString({type:A,value:K},{implicitKey:Y||O===null,indent:O!==null&&O>0?" ".repeat(O):"",inFlow:$,options:{blockQuote:!0,lineWidth:-1}});switch(w[0]){case"|":case">":tL_(q,w);break;case'"':wh1(q,w,"double-quoted-scalar");break;case"'":wh1(q,w,"single-quoted-scalar");break;default:wh1(q,w,"scalar")}}function tL_(q,K){let _=K.indexOf(`
719`),z=K.substring(0,_),Y=K.substring(_+1)+`
720`;if(q.type==="block-scalar"){let $=q.props[0];if($.type!=="block-scalar-header")throw Error("Invalid block scalar header");$.source=z,q.source=Y}else{let{offset:$}=q,A="indent"in q?q.indent:-1,O=[{type:"block-scalar-header",offset:$,indent:A,source:z}];if(!S44(O,"end"in q?q.end:void 0))O.push({type:"newline",offset:-1,indent:A,source:`

Callers

nothing calls this directly

Calls 2

S44Function · 0.85
pushMethod · 0.45

Tested by

no test coverage detected