monocart-coverage-reports 3.1.0 → 3.2.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +59 -6
- package/README.zh-Hans.md +59 -6
- package/lib/cli.js +25 -60
- package/lib/converter/ast-visitor.js +27 -1
- package/lib/converter/ast.js +20 -1
- package/lib/converter/converter.js +20 -24
- package/lib/default/options.js +5 -0
- package/lib/generate.js +3 -2
- package/lib/index.d.ts +67 -0
- package/lib/packages/monocart-coverage-assets.js +1 -1
- package/lib/packages/monocart-coverage-converter.js +9 -9
- package/lib/packages/monocart-coverage-vendor.js +2 -1
- package/lib/packages/monocart-coverage-vendor.js.LICENSE +69 -9
- package/lib/test/test-reporter.js +191 -0
- package/lib/test/test-results.js +104 -0
- package/lib/test/test-runner.js +115 -0
- package/migrate-to-3.md +4 -0
- package/package.json +161 -161
- package/skills/monocart-coverage-reports/references/cli.md +5 -0
- package/skills/monocart-coverage-reports/references/reports-and-ci.md +2 -0
|
@@ -1,2 +1,3 @@
|
|
|
1
1
|
import { createRequire } from 'node:module'; const require = createRequire(import.meta.url);
|
|
2
|
-
var j=(i,t,e)=>{let s=i instanceof RegExp?Y(i,e):i,n=t instanceof RegExp?Y(t,e):t,r=s!==null&&n!=null&>(s,n,e);return r&&{start:r[0],end:r[1],pre:e.slice(0,r[0]),body:e.slice(r[0]+s.length,r[1]),post:e.slice(r[1]+n.length)}},Y=(i,t)=>{let e=t.match(i);return e?e[0]:null},gt=(i,t,e)=>{let s,n,r,o,c,l=e.indexOf(i),a=e.indexOf(t,l+1),h=l;if(l>=0&&a>0){if(i===t)return[l,a];for(s=[],r=e.length;h>=0&&!c;){if(h===l)s.push(h),l=e.indexOf(i,h+1);else if(s.length===1){let f=s.pop();f!==void 0&&(c=[f,a])}else n=s.pop(),n!==void 0&&n<r&&(r=n,o=a),a=e.indexOf(t,h+1);h=l<a&&l>=0?l:a}s.length&&o!==void 0&&(c=[r,o])}return c};var V="\0SLASH"+Math.random()+"\0",H="\0OPEN"+Math.random()+"\0",W="\0CLOSE"+Math.random()+"\0",X="\0COMMA"+Math.random()+"\0",Z="\0PERIOD"+Math.random()+"\0",mt=new RegExp(V,"g"),yt=new RegExp(H,"g"),wt=new RegExp(W,"g"),St=new RegExp(X,"g"),Et=new RegExp(Z,"g"),xt=/\\\\/g,bt=/\\{/g,Tt=/\\}/g,Ot=/\\,/g,Rt=/\\\./g,Mt=1e5,Nt=4e6;function D(i){return isNaN(i)?i.charCodeAt(0):parseInt(i,10)}function At(i){return i.replace(xt,V).replace(bt,H).replace(Tt,W).replace(Ot,X).replace(Rt,Z)}function vt(i){return i.replace(mt,"\\").replace(yt,"{").replace(wt,"}").replace(St,",").replace(Et,".")}function J(i){if(!i)return[""];let t=[],e=j("{","}",i);if(!e)return i.split(",");let{pre:s,body:n,post:r}=e,o=s.split(",");o[o.length-1]+="{"+n+"}";let c=J(r);return r.length&&(o[o.length-1]+=c.shift(),o.push.apply(o,c)),t.push.apply(t,o),t}function Q(i,t={}){if(!i)return[];let{max:e=Mt,maxLength:s=Nt}=t;return i.slice(0,2)==="{}"&&(i="\\{\\}"+i.slice(2)),F(At(i),e,s,!0).map(vt)}function Ct(i){return"{"+i+"}"}function Pt(i){return/^-?0\d/.test(i)}function _t(i,t){return i<=t}function $t(i,t){return i>=t}function C(i,t,e,s,n,r){let o=[],c=0;for(let l=0;l<i.length;l++)for(let a=0;a<e.length;a++){if(o.length>=s)return o;let h=i[l]+t+e[a];if(!(r&&!h)){if(c+h.length>n)return o;o.push(h),c+=h.length}}return o}function It(i,t,e,s){let n=i.split(/\.\./),r=[];if(n[0]===void 0||n[1]===void 0)return r;let o=D(n[0]),c=D(n[1]),l=Math.max(n[0].length,n[1].length),a=n.length===3&&n[2]!==void 0?Math.max(Math.abs(D(n[2])),1):1,h=_t;c<o&&(a*=-1,h=$t);let p=n.some(Pt),g=0;for(let d=o;h(d,c)&&r.length<e;d+=a){let u;if(t)u=String.fromCharCode(d),u==="\\"&&(u="");else if(u=String(d),p){let w=l-u.length;if(w>0){let m=new Array(w+1).join("0");d<0?u="-"+m+u.slice(1):u=m+u}}if(g+u.length>s)break;r.push(u),g+=u.length}return r}function F(i,t,e,s){let n=[""],r=!1,o=!0;for(;;){let c=j("{","}",i);if(!c)return C(n,i,[""],t,e,r);let l=c.pre;if(/\$$/.test(l)){if(n=C(n,l+"{"+c.body+"}",[""],t,e,r&&!c.post.length),o=!1,!c.post.length)break;i=c.post;continue}let a=/^-?\d+\.\.-?\d+(?:\.\.-?\d+)?$/.test(c.body),h=/^[a-zA-Z]\.\.[a-zA-Z](?:\.\.-?\d+)?$/.test(c.body),f=a||h,p=c.body.indexOf(",")>=0;if(!f&&!p){if(c.post.match(/,(?!,).*\}/)){i=c.pre+"{"+c.body+W+c.post,s=!0;continue}return C(n,l+"{"+c.body+"}"+c.post,[""],t,e,r)}o&&(r=s&&!f,o=!1);let g;if(f)g=It(c.body,h,t,e);else{let d=J(c.body);if(d.length===1&&d[0]!==void 0&&(d=F(d[0],t,e,!1).map(Ct),d.length===1)){if(n=C(n,l+d[0],[""],t,e,r&&!c.post.length),!c.post.length)break;i=c.post;continue}let u=r&&!c.post.length&&!l;for(let m=0;u&&m<n.length;m++)n[m]&&(u=!1);g=[];let w=0;t:for(let m=0;m<d.length;m++){let S=F(d[m],t,e,!1);for(let T=0;T<S.length;T++){let M=S[T];if(!(u&&!M)){if(g.length>=t||w+M.length>e)break t;g.push(M),w+=M.length}}}}if(n=C(n,l,g,t,e,r&&!c.post.length),!c.post.length)break;i=c.post}return n}var P=i=>{if(typeof i!="string")throw new TypeError("invalid pattern");if(i.length>65536)throw new TypeError("pattern is too long")};var Lt={"[:alnum:]":["\\p{L}\\p{Nl}\\p{Nd}",!0],"[:alpha:]":["\\p{L}\\p{Nl}",!0],"[:ascii:]":["\\x00-\\x7f",!1],"[:blank:]":["\\p{Zs}\\t",!0],"[:cntrl:]":["\\p{Cc}",!0],"[:digit:]":["\\p{Nd}",!0],"[:graph:]":["\\p{Z}\\p{C}",!0,!0],"[:lower:]":["\\p{Ll}",!0],"[:print:]":["\\p{C}",!0],"[:punct:]":["\\p{P}",!0],"[:space:]":["\\p{Z}\\t\\r\\n\\v\\f",!0],"[:upper:]":["\\p{Lu}",!0],"[:word:]":["\\p{L}\\p{Nl}\\p{Nd}\\p{Pc}",!0],"[:xdigit:]":["A-Fa-f0-9",!1]},_=i=>i.replace(/[[\]\\-]/g,"\\$&"),jt=i=>i.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&"),K=i=>i.join(""),tt=(i,t)=>{let e=t;if(i.charAt(e)!=="[")throw new Error("not in a brace expression");let s=[],n=[],r=e+1,o=!1,c=!1,l=!1,a=!1,h=e,f="";t:for(;r<i.length;){let u=i.charAt(r);if((u==="!"||u==="^")&&r===e+1){a=!0,r++;continue}if(u==="]"&&o&&!l){h=r+1;break}if(o=!0,u==="\\"&&!l){l=!0,r++;continue}if(u==="["&&!l){for(let[w,[m,S,T]]of Object.entries(Lt))if(i.startsWith(w,r)){if(f)return["$.",!1,i.length-e,!0];r+=w.length,T?n.push(m):s.push(m),c=c||S;continue t}}if(l=!1,f){u>f?s.push(_(f)+"-"+_(u)):u===f&&s.push(_(u)),f="",r++;continue}if(i.startsWith("-]",r+1)){s.push(_(u+"-")),r+=2;continue}if(i.startsWith("-",r+1)){f=u,r+=2;continue}s.push(_(u)),r++}if(h<r)return["",!1,0,!1];if(!s.length&&!n.length)return["$.",!1,i.length-e,!0];if(n.length===0&&s.length===1&&/^\\?.$/.test(s[0])&&!a){let u=s[0].length===2?s[0].slice(-1):s[0];return[jt(u),!1,h-e,!1]}let p="["+(a?"^":"")+K(s)+"]",g="["+(a?"":"^")+K(n)+"]";return[s.length&&n.length?"("+p+"|"+g+")":s.length?p:g,c,h-e,!0]};var N=(i,{windowsPathsNoEscape:t=!1,magicalBraces:e=!0}={})=>e?t?i.replace(/\[([^/\\])\]/g,"$1"):i.replace(/((?!\\).|^)\[([^/\\])\]/g,"$1$2").replace(/\\([^/])/g,"$1"):t?i.replace(/\[([^/\\{}])\]/g,"$1"):i.replace(/((?!\\).|^)\[([^/\\{}])\]/g,"$1$2").replace(/\\([^/{}])/g,"$1");var b,Dt=new Set(["!","?","+","*","@"]),k=i=>Dt.has(i),et=i=>k(i.type),Ft=new Map([["!",["@"]],["?",["?","@"]],["@",["@"]],["*",["*","+","?","@"]],["+",["+","@"]]]),Wt=new Map([["!",["?"]],["@",["?"]],["+",["?","*"]]]),kt=new Map([["!",["?","@"]],["?",["?","@"]],["@",["?","@"]],["*",["*","+","?","@"]],["+",["+","@","?","*"]]]),st=new Map([["!",new Map([["!","@"]])],["?",new Map([["*","*"],["+","*"]])],["@",new Map([["!","!"],["?","?"],["@","@"],["*","*"],["+","+"]])],["+",new Map([["?","*"],["*","*"]])]]),Gt="(?!(?:^|/)\\.\\.?(?:$|/))",I="(?!\\.)",zt=new Set(["[","."]),Ut=new Set(["..","."]),Bt=new Set("().*{}+?[]^$\\!"),qt=i=>i.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&"),G="[^/]",nt=G+"*?",it=G+"+?",Yt=0,A=class{type;#s;#n;#i=!1;#t=[];#e;#c;#l;#a=!1;#r;#o;#h=!1;id=++Yt;get depth(){return(this.#e?.depth??-1)+1}[Symbol.for("nodejs.util.inspect.custom")](){return{"@@type":"AST",id:this.id,type:this.type,root:this.#s.id,parent:this.#e?.id,depth:this.depth,partsLength:this.#t.length,parts:this.#t}}constructor(t,e,s={}){this.type=t,t&&(this.#n=!0),this.#e=e,this.#s=this.#e?this.#e.#s:this,this.#r=this.#s===this?s:this.#s.#r,this.#l=this.#s===this?[]:this.#s.#l,t==="!"&&!this.#s.#a&&this.#l.push(this),this.#c=this.#e?this.#e.#t.length:0}get hasMagic(){if(this.#n!==void 0)return this.#n;for(let t of this.#t)if(typeof t!="string"&&(t.type||t.hasMagic))return this.#n=!0;return this.#n}toString(){return this.#o!==void 0?this.#o:this.type?this.#o=this.type+"("+this.#t.map(t=>String(t)).join("|")+")":this.#o=this.#t.map(t=>String(t)).join("")}#y(){if(this!==this.#s)throw new Error("should only call on root");if(this.#a)return this;this.toString(),this.#a=!0;let t;for(;t=this.#l.pop();){if(t.type!=="!")continue;let e=t,s=e.#e;for(;s;){for(let n=e.#c+1;!s.type&&n<s.#t.length;n++)for(let r of t.#t){if(typeof r=="string")throw new Error("string part in extglob AST??");r.copyIn(s.#t[n])}e=s,s=e.#e}}return this}push(...t){for(let e of t)if(e!==""){if(typeof e!="string"&&!(e instanceof b&&e.#e===this))throw new Error("invalid part: "+e);this.#t.push(e)}}toJSON(){let t=this.type===null?this.#t.slice().map(e=>typeof e=="string"?e:e.toJSON()):[this.type,...this.#t.map(e=>e.toJSON())];return this.isStart()&&!this.type&&t.unshift([]),this.isEnd()&&(this===this.#s||this.#s.#a&&this.#e?.type==="!")&&t.push({}),t}isStart(){if(this.#s===this)return!0;if(!this.#e?.isStart())return!1;if(this.#c===0)return!0;let t=this.#e;for(let e=0;e<this.#c;e++){let s=t.#t[e];if(!(s instanceof b&&s.type==="!"))return!1}return!0}isEnd(){if(this.#s===this||this.#e?.type==="!")return!0;if(!this.#e?.isEnd())return!1;if(!this.type)return this.#e?.isEnd();let t=this.#e?this.#e.#t.length:0;return this.#c===t-1}copyIn(t){typeof t=="string"?this.push(t):this.push(t.clone(this))}clone(t){let e=new b(this.type,t);for(let s of this.#t)e.copyIn(s);return e}static#f(t,e,s,n,r){let o=n.maxExtglobRecursion??2,c=!1,l=!1,a=-1,h=!1;if(e.type===null){let u=s,w="";for(;u<t.length;){let m=t.charAt(u++);if(c||m==="\\"){c=!c,w+=m;continue}if(l){u===a+1?(m==="^"||m==="!")&&(h=!0):m==="]"&&!(u===a+2&&h)&&(l=!1),w+=m;continue}else if(m==="["){l=!0,a=u,h=!1,w+=m;continue}if(!n.noext&&k(m)&&t.charAt(u)==="("&&r<=o){e.push(w),w="";let T=new b(m,e);u=b.#f(t,T,u,n,r+1),e.push(T);continue}w+=m}return e.push(w),u}let f=s+1,p=new b(null,e),g=[],d="";for(;f<t.length;){let u=t.charAt(f++);if(c||u==="\\"){c=!c,d+=u;continue}if(l){f===a+1?(u==="^"||u==="!")&&(h=!0):u==="]"&&!(f===a+2&&h)&&(l=!1),d+=u;continue}else if(u==="["){l=!0,a=f,h=!1,d+=u;continue}if(!n.noext&&k(u)&&t.charAt(f)==="("&&(r<=o||e&&e.#u(u))){let m=e&&e.#u(u)?0:1;p.push(d),d="";let S=new b(u,p);p.push(S),f=b.#f(t,S,f,n,r+m);continue}if(u==="|"){p.push(d),d="",g.push(p),p=new b(null,e);continue}if(u===")")return d===""&&e.#t.length===0&&(e.#h=!0),p.push(d),d="",e.push(...g,p),f;d+=u}return e.type=null,e.#n=void 0,e.#t=[t.substring(s-1)],f}#w(t){return this.#d(t,Wt)}#d(t,e=Ft){if(!t||typeof t!="object"||t.type!==null||t.#t.length!==1||this.type===null)return!1;let s=t.#t[0];return!s||typeof s!="object"||s.type===null?!1:this.#u(s.type,e)}#u(t,e=kt){return!!e.get(this.type)?.includes(t)}#S(t,e){let s=t.#t[0],n=new b(null,s,this.options);n.#t.push(""),s.push(n),this.#g(t,e)}#g(t,e){let s=t.#t[0];this.#t.splice(e,1,...s.#t);for(let n of s.#t)typeof n=="object"&&(n.#e=this);this.#o=void 0}#E(t){return!!st.get(this.type)?.has(t)}#x(t){if(!t||typeof t!="object"||t.type!==null||t.#t.length!==1||this.type===null||this.#t.length!==1)return!1;let e=t.#t[0];return!e||typeof e!="object"||e.type===null?!1:this.#E(e.type)}#b(t){let e=st.get(this.type),s=t.#t[0],n=e?.get(s.type);if(!n)return!1;this.#t=s.#t;for(let r of this.#t)typeof r=="object"&&(r.#e=this);this.type=n,this.#o=void 0,this.#h=!1}static fromGlob(t,e={}){let s=new b(null,void 0,e);return b.#f(t,s,0,e,0),s}toMMPattern(){if(this!==this.#s)return this.#s.toMMPattern();let t=this.toString(),[e,s,n,r]=this.toRegExpSource();if(!(n||this.#n||this.#r.nocase&&!this.#r.nocaseMagicOnly&&t.toUpperCase()!==t.toLowerCase()))return s;let c=(this.#r.nocase?"i":"")+(r?"u":"");return Object.assign(new RegExp(`^${e}$`,c),{_src:e,_glob:t})}get options(){return this.#r}toRegExpSource(t){let e=t??!!this.#r.dot;if(this.#s===this&&(this.#p(),this.#y()),!et(this)){let l=this.isStart()&&this.isEnd()&&!this.#t.some(g=>typeof g!="string"),a=this.#t.map(g=>{let[d,u,w,m]=typeof g=="string"?b.#T(g,this.#n,l):g.toRegExpSource(t);return this.#n=this.#n||w,this.#i=this.#i||m,d}).join(""),h="";if(this.isStart()&&typeof this.#t[0]=="string"&&!(this.#t.length===1&&Ut.has(this.#t[0]))){let d=zt,u=e&&d.has(a.charAt(0))||a.startsWith("\\.")&&d.has(a.charAt(2))||a.startsWith("\\.\\.")&&d.has(a.charAt(4)),w=!e&&!t&&d.has(a.charAt(0));h=u?Gt:w?I:""}let f="";return this.isEnd()&&this.#s.#a&&this.#e?.type==="!"&&(f="(?:$|\\/)"),[h+a+f,N(a),this.#n=!!this.#n,this.#i]}let s=this.type==="*"||this.type==="+",n=this.type==="!"?"(?:(?!(?:":"(?:",r=this.#m(e);if(this.isStart()&&this.isEnd()&&!r&&this.type!=="!"){let l=this.toString(),a=this;return a.#t=[l],a.type=null,a.#n=void 0,[l,N(this.toString()),!1,!1]}let o=!s||t||e||!I?"":this.#m(!0);o===r&&(o=""),o&&(r=`(?:${r})(?:${o})*?`);let c="";if(this.type==="!"&&this.#h)c=(this.isStart()&&!e?I:"")+it;else{let l=this.type==="!"?"))"+(this.isStart()&&!e&&!t?I:"")+nt+")":this.type==="@"?")":this.type==="?"?")?":this.type==="+"&&o?")":this.type==="*"&&o?")?":`)${this.type}`;c=n+r+l}return[c,N(r),this.#n=!!this.#n,this.#i]}#p(){if(et(this)){let t=0,e=!1;do{e=!0;for(let s=0;s<this.#t.length;s++){let n=this.#t[s];typeof n=="object"&&(n.#p(),this.#d(n)?(e=!1,this.#g(n,s)):this.#w(n)?(e=!1,this.#S(n,s)):this.#x(n)&&(e=!1,this.#b(n)))}}while(!e&&++t<10)}else for(let t of this.#t)typeof t=="object"&&t.#p();this.#o=void 0}#m(t){return this.#t.map(e=>{if(typeof e=="string")throw new Error("string type in extglob ast??");let[s,n,r,o]=e.toRegExpSource(t);return this.#i=this.#i||o,s}).filter(e=>!(this.isStart()&&this.isEnd())||!!e).join("|")}static#T(t,e,s=!1){let n=!1,r="",o=!1,c=!1;for(let l=0;l<t.length;l++){let a=t.charAt(l);if(n){n=!1,r+=(Bt.has(a)?"\\":"")+a;continue}if(a==="*"){if(c)continue;c=!0,r+=s&&/^[*]+$/.test(t)?it:nt,e=!0;continue}else c=!1;if(a==="\\"){l===t.length-1?r+="\\\\":n=!0;continue}if(a==="["){let[h,f,p,g]=tt(t,l);if(p){r+=h,o=o||f,l+=p-1,e=e||g;continue}}if(a==="?"){r+=G,e=!0;continue}r+=qt(a)}return[r,N(t),!!e,o]}};b=A;var z=(i,{windowsPathsNoEscape:t=!1,magicalBraces:e=!1}={})=>e?t?i.replace(/[?*()[\]{}]/g,"[$&]"):i.replace(/[?*()[\]\\{}]/g,"\\$&"):t?i.replace(/[?*()[\]]/g,"[$&]"):i.replace(/[?*()[\]\\]/g,"\\$&");var x=(i,t,e={})=>(P(t),!e.nocomment&&t.charAt(0)==="#"?!1:new v(t,e).match(i)),Vt=/^\*+([^+@!?*[(]*)$/,Ht=i=>t=>!t.startsWith(".")&&t.endsWith(i),Xt=i=>t=>t.endsWith(i),Zt=i=>(i=i.toLowerCase(),t=>!t.startsWith(".")&&t.toLowerCase().endsWith(i)),Jt=i=>(i=i.toLowerCase(),t=>t.toLowerCase().endsWith(i)),Qt=/^\*+\.\*+$/,Kt=i=>!i.startsWith(".")&&i.includes("."),te=i=>i!=="."&&i!==".."&&i.includes("."),ee=/^\.\*+$/,se=i=>i!=="."&&i!==".."&&i.startsWith("."),ne=/^\*+$/,ie=i=>i.length!==0&&!i.startsWith("."),re=i=>i.length!==0&&i!=="."&&i!=="..",oe=/^\?+([^+@!?*[(]*)?$/,ce=([i,t=""])=>{let e=ct([i]);return t?(t=t.toLowerCase(),s=>e(s)&&s.toLowerCase().endsWith(t)):e},ae=([i,t=""])=>{let e=at([i]);return t?(t=t.toLowerCase(),s=>e(s)&&s.toLowerCase().endsWith(t)):e},le=([i,t=""])=>{let e=at([i]);return t?s=>e(s)&&s.endsWith(t):e},he=([i,t=""])=>{let e=ct([i]);return t?s=>e(s)&&s.endsWith(t):e},ct=([i])=>{let t=i.length;return e=>e.length===t&&!e.startsWith(".")},at=([i])=>{let t=i.length;return e=>e.length===t&&e!=="."&&e!==".."},lt=typeof process=="object"&&process?typeof process.env=="object"&&process.env&&process.env.__MINIMATCH_TESTING_PLATFORM__||process.platform:"posix",rt={win32:{sep:"\\"},posix:{sep:"/"}},fe=lt==="win32"?rt.win32.sep:rt.posix.sep;x.sep=fe;var E=Symbol("globstar **");x.GLOBSTAR=E;var ue="[^/]",pe=ue+"*?",de="(?:(?!(?:\\/|^)(?:\\.{1,2})($|\\/)).)*?",ge="(?:(?!(?:\\/|^)\\.).)*?",me=(i,t={})=>e=>x(e,i,t);x.filter=me;var O=(i,t={})=>Object.assign({},i,t),ye=i=>{if(!i||typeof i!="object"||!Object.keys(i).length)return x;let t=x;return Object.assign((s,n,r={})=>t(s,n,O(i,r)),{Minimatch:class extends t.Minimatch{constructor(n,r={}){super(n,O(i,r))}static defaults(n){return t.defaults(O(i,n)).Minimatch}},AST:class extends t.AST{constructor(n,r,o={}){super(n,r,O(i,o))}static fromGlob(n,r={}){return t.AST.fromGlob(n,O(i,r))}},unescape:(s,n={})=>t.unescape(s,O(i,n)),escape:(s,n={})=>t.escape(s,O(i,n)),filter:(s,n={})=>t.filter(s,O(i,n)),defaults:s=>t.defaults(O(i,s)),makeRe:(s,n={})=>t.makeRe(s,O(i,n)),braceExpand:(s,n={})=>t.braceExpand(s,O(i,n)),match:(s,n,r={})=>t.match(s,n,O(i,r)),sep:t.sep,GLOBSTAR:E})};x.defaults=ye;var ht=(i,t={})=>(P(i),t.nobrace||!/\{(?:(?!\{).)*\}/.test(i)?[i]:Q(i,{max:t.braceExpandMax}));x.braceExpand=ht;var we=(i,t={})=>new v(i,t).makeRe();x.makeRe=we;var Se=(i,t,e={})=>{let s=new v(t,e);return i=i.filter(n=>s.match(n)),s.options.nonull&&!i.length&&i.push(t),i};x.match=Se;var ot=/[?*]|[+@!]\(.*?\)|\[|\]/,Ee=i=>i.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&"),v=class{options;set;pattern;windowsPathsNoEscape;nonegate;negate;comment;empty;preserveMultipleSlashes;partial;globSet;globParts;nocase;isWindows;platform;windowsNoMagicRoot;maxGlobstarRecursion;regexp;constructor(t,e={}){P(t),e=e||{},this.options=e,this.maxGlobstarRecursion=e.maxGlobstarRecursion??200,this.pattern=t,this.platform=e.platform||lt,this.isWindows=this.platform==="win32";let s="allowWindowsEscape";this.windowsPathsNoEscape=!!e.windowsPathsNoEscape||e[s]===!1,this.windowsPathsNoEscape&&(this.pattern=this.pattern.replace(/\\/g,"/")),this.preserveMultipleSlashes=!!e.preserveMultipleSlashes,this.regexp=null,this.negate=!1,this.nonegate=!!e.nonegate,this.comment=!1,this.empty=!1,this.partial=!!e.partial,this.nocase=!!this.options.nocase,this.windowsNoMagicRoot=e.windowsNoMagicRoot!==void 0?e.windowsNoMagicRoot:!!(this.isWindows&&this.nocase),this.globSet=[],this.globParts=[],this.set=[],this.make()}hasMagic(){if(this.options.magicalBraces&&this.set.length>1)return!0;for(let t of this.set)for(let e of t)if(typeof e!="string")return!0;return!1}debug(...t){}make(){let t=this.pattern,e=this.options;if(!e.nocomment&&t.charAt(0)==="#"){this.comment=!0;return}if(!t){this.empty=!0;return}this.parseNegate(),this.globSet=[...new Set(this.braceExpand())],e.debug&&(this.debug=(...r)=>console.error(...r)),this.debug(this.pattern,this.globSet);let s=this.globSet.map(r=>this.slashSplit(r));this.globParts=this.preprocess(s),this.debug(this.pattern,this.globParts);let n=this.globParts.map((r,o,c)=>{if(this.isWindows&&this.windowsNoMagicRoot){let l=r[0]===""&&r[1]===""&&(r[2]==="?"||!ot.test(r[2]))&&!ot.test(r[3]),a=/^[a-z]:/i.test(r[0]);if(l)return[...r.slice(0,4),...r.slice(4).map(h=>this.parse(h))];if(a)return[r[0],...r.slice(1).map(h=>this.parse(h))]}return r.map(l=>this.parse(l))});if(this.debug(this.pattern,n),this.set=n.filter(r=>r.indexOf(!1)===-1),this.isWindows)for(let r=0;r<this.set.length;r++){let o=this.set[r];o[0]===""&&o[1]===""&&this.globParts[r][2]==="?"&&typeof o[3]=="string"&&/^[a-z]:$/i.test(o[3])&&(o[2]="?")}this.debug(this.pattern,this.set)}preprocess(t){if(this.options.noglobstar)for(let s of t)for(let n=0;n<s.length;n++)s[n]==="**"&&(s[n]="*");let{optimizationLevel:e=1}=this.options;return e>=2?(t=this.firstPhasePreProcess(t),t=this.secondPhasePreProcess(t)):e>=1?t=this.levelOneOptimize(t):t=this.adjascentGlobstarOptimize(t),t}adjascentGlobstarOptimize(t){return t.map(e=>{let s=-1;for(;(s=e.indexOf("**",s+1))!==-1;){let n=s;for(;e[n+1]==="**";)n++;n!==s&&e.splice(s,n-s)}return e})}levelOneOptimize(t){return t.map(e=>(e=e.reduce((s,n)=>{let r=s[s.length-1];return n==="**"&&r==="**"?s:n===".."&&r&&r!==".."&&r!=="."&&r!=="**"?(s.pop(),s):(s.push(n),s)},[]),e.length===0?[""]:e))}levelTwoFileOptimize(t){Array.isArray(t)||(t=this.slashSplit(t));let e=!1;do{if(e=!1,!this.preserveMultipleSlashes){for(let n=1;n<t.length-1;n++){let r=t[n];n===1&&r===""&&t[0]===""||(r==="."||r==="")&&(e=!0,t.splice(n,1),n--)}t[0]==="."&&t.length===2&&(t[1]==="."||t[1]==="")&&(e=!0,t.pop())}let s=0;for(;(s=t.indexOf("..",s+1))!==-1;){let n=t[s-1];n&&n!=="."&&n!==".."&&n!=="**"&&!(this.isWindows&&/^[a-z]:$/i.test(n))&&(e=!0,t.splice(s-1,2),s-=2)}}while(e);return t.length===0?[""]:t}firstPhasePreProcess(t){let e=!1;do{e=!1;for(let s of t){let n=-1;for(;(n=s.indexOf("**",n+1))!==-1;){let o=n;for(;s[o+1]==="**";)o++;o>n&&s.splice(n+1,o-n);let c=s[n+1],l=s[n+2],a=s[n+3];if(c!==".."||!l||l==="."||l===".."||!a||a==="."||a==="..")continue;e=!0,s.splice(n,1);let h=s.slice(0);h[n]="**",t.push(h),n--}if(!this.preserveMultipleSlashes){for(let o=1;o<s.length-1;o++){let c=s[o];o===1&&c===""&&s[0]===""||(c==="."||c==="")&&(e=!0,s.splice(o,1),o--)}s[0]==="."&&s.length===2&&(s[1]==="."||s[1]==="")&&(e=!0,s.pop())}let r=0;for(;(r=s.indexOf("..",r+1))!==-1;){let o=s[r-1];if(o&&o!=="."&&o!==".."&&o!=="**"){e=!0;let l=r===1&&s[r+1]==="**"?["."]:[];s.splice(r-1,2,...l),s.length===0&&s.push(""),r-=2}}}}while(e);return t}secondPhasePreProcess(t){for(let e=0;e<t.length-1;e++)for(let s=e+1;s<t.length;s++){let n=this.partsMatch(t[e],t[s],!this.preserveMultipleSlashes);if(n){t[e]=[],t[s]=n;break}}return t.filter(e=>e.length)}partsMatch(t,e,s=!1){let n=0,r=0,o=[],c="";for(;n<t.length&&r<e.length;)if(t[n]===e[r])o.push(c==="b"?e[r]:t[n]),n++,r++;else if(s&&t[n]==="**"&&e[r]===t[n+1])o.push(t[n]),n++;else if(s&&e[r]==="**"&&t[n]===e[r+1])o.push(e[r]),r++;else if(t[n]==="*"&&e[r]&&(this.options.dot||!e[r].startsWith("."))&&e[r]!=="**"){if(c==="b")return!1;c="a",o.push(t[n]),n++,r++}else if(e[r]==="*"&&t[n]&&(this.options.dot||!t[n].startsWith("."))&&t[n]!=="**"){if(c==="a")return!1;c="b",o.push(e[r]),n++,r++}else return!1;return t.length===e.length&&o}parseNegate(){if(this.nonegate)return;let t=this.pattern,e=!1,s=0;for(let n=0;n<t.length&&t.charAt(n)==="!";n++)e=!e,s++;s&&(this.pattern=t.slice(s)),this.negate=e}matchOne(t,e,s=!1){let n=0,r=0;if(this.isWindows){let c=typeof t[0]=="string"&&/^[a-z]:$/i.test(t[0]),l=!c&&t[0]===""&&t[1]===""&&t[2]==="?"&&/^[a-z]:$/i.test(t[3]),a=typeof e[0]=="string"&&/^[a-z]:$/i.test(e[0]),h=!a&&e[0]===""&&e[1]===""&&e[2]==="?"&&typeof e[3]=="string"&&/^[a-z]:$/i.test(e[3]),f=l?3:c?0:void 0,p=h?3:a?0:void 0;if(typeof f=="number"&&typeof p=="number"){let[g,d]=[t[f],e[p]];g.toLowerCase()===d.toLowerCase()&&(e[p]=g,r=p,n=f)}}let{optimizationLevel:o=1}=this.options;return o>=2&&(t=this.levelTwoFileOptimize(t)),e.includes(E)?this.#s(t,e,s,n,r):this.#i(t,e,s,n,r)}#s(t,e,s,n,r){let o=e.indexOf(E,r),c=e.lastIndexOf(E),[l,a,h]=s?[e.slice(r,o),e.slice(o+1),[]]:[e.slice(r,o),e.slice(o+1,c),e.slice(c+1)];if(l.length){let S=t.slice(n,n+l.length);if(!this.#i(S,l,s,0,0))return!1;n+=l.length,r+=l.length}let f=0;if(h.length){if(h.length+n>t.length)return!1;let S=t.length-h.length;if(this.#i(t,h,s,S,0))f=h.length;else{if(t[t.length-1]!==""||n+h.length===t.length||(S--,!this.#i(t,h,s,S,0)))return!1;f=h.length+1}}if(!a.length){let S=!!f;for(let T=n;T<t.length-f;T++){let M=String(t[T]);if(S=!0,M==="."||M===".."||!this.options.dot&&M.startsWith("."))return!1}return s||S}let p=[[[],0]],g=p[0],d=0,u=[0];for(let S of a)S===E?(u.push(d),g=[[],0],p.push(g)):(g[0].push(S),d++);let w=p.length-1,m=t.length-f;for(let S of p)S[1]=m-(u[w--]+S[0].length);return!!this.#n(t,p,n,0,s,0,!!f)}#n(t,e,s,n,r,o,c){let l=e[n];if(!l){for(let f=s;f<t.length;f++){c=!0;let p=t[f];if(p==="."||p===".."||!this.options.dot&&p.startsWith("."))return!1}return c}let[a,h]=l;for(;s<=h;){if(this.#i(t.slice(0,s+a.length),a,r,s,0)&&o<this.maxGlobstarRecursion){let g=this.#n(t,e,s+a.length,n+1,r,o+1,c);if(g!==!1)return g}let p=t[s];if(p==="."||p===".."||!this.options.dot&&p.startsWith("."))return!1;s++}return r||null}#i(t,e,s,n,r){let o,c,l,a;for(o=n,c=r,a=t.length,l=e.length;o<a&&c<l;o++,c++){this.debug("matchOne loop");let h=e[c],f=t[o];if(this.debug(e,h,f),h===!1||h===E)return!1;let p;if(typeof h=="string"?(p=f===h,this.debug("string match",h,f,p)):(p=h.test(f),this.debug("pattern match",h,f,p)),!p)return!1}if(o===a&&c===l)return!0;if(o===a)return s;if(c===l)return o===a-1&&t[o]==="";throw new Error("wtf?")}braceExpand(){return ht(this.pattern,this.options)}parse(t){P(t);let e=this.options;if(t==="**")return E;if(t==="")return"";let s,n=null;(s=t.match(ne))?n=e.dot?re:ie:(s=t.match(Vt))?n=(e.nocase?e.dot?Jt:Zt:e.dot?Xt:Ht)(s[1]):(s=t.match(oe))?n=(e.nocase?e.dot?ae:ce:e.dot?le:he)(s):(s=t.match(Qt))?n=e.dot?te:Kt:(s=t.match(ee))&&(n=se);let r=A.fromGlob(t,this.options).toMMPattern();return n&&typeof r=="object"&&Reflect.defineProperty(r,"test",{value:n}),r}makeRe(){if(this.regexp||this.regexp===!1)return this.regexp;let t=this.set;if(!t.length)return this.regexp=!1,this.regexp;let e=this.options,s=e.noglobstar?pe:e.dot?de:ge,n=new Set(e.nocase?["i"]:[]),r=t.map(l=>{let a=l.map(f=>{if(f instanceof RegExp)for(let p of f.flags.split(""))n.add(p);return typeof f=="string"?Ee(f):f===E?E:f._src});a.forEach((f,p)=>{let g=a[p+1],d=a[p-1];f!==E||d===E||(d===void 0?g!==void 0&&g!==E?a[p+1]="(?:\\/|"+s+"\\/)?"+g:a[p]=s:g===void 0?a[p-1]=d+"(?:\\/|\\/"+s+")?":g!==E&&(a[p-1]=d+"(?:\\/|\\/"+s+"\\/)"+g,a[p+1]=E))});let h=a.filter(f=>f!==E);if(this.partial&&h.length>=1){let f=[];for(let p=1;p<=h.length;p++)f.push(h.slice(0,p).join("/"));return"(?:"+f.join("|")+")"}return h.join("/")}).join("|"),[o,c]=t.length>1?["(?:",")"]:["",""];r="^"+o+r+c+"$",this.partial&&(r="^(?:\\/|"+o+r.slice(1,-1)+c+")$"),this.negate&&(r="^(?!"+r+").+$");try{this.regexp=new RegExp(r,[...n].join(""))}catch{this.regexp=!1}return this.regexp}slashSplit(t){return this.preserveMultipleSlashes?t.split("/"):this.isWindows&&/^\/\/[^/]+/.test(t)?["",...t.split(/\/+/)]:t.split(/\/+/)}match(t,e=this.partial){if(this.debug("match",t,this.pattern),this.comment)return!1;if(this.empty)return t==="";if(t==="/"&&e)return!0;let s=this.options;this.isWindows&&(t=t.split("\\").join("/"));let n=this.slashSplit(t);this.debug(this.pattern,"split",n);let r=this.set;this.debug(this.pattern,"set",r);let o=n[n.length-1];if(!o)for(let c=n.length-2;!o&&c>=0;c--)o=n[c];for(let c of r){let l=n;if(s.matchBase&&c.length===1&&(l=[o]),this.matchOne(l,c,e))return s.flipNegate?!0:!this.negate}return s.flipNegate?!1:this.negate}static defaults(t){return x.defaults(t).Minimatch}};x.AST=A;x.Minimatch=v;x.escape=z;x.unescape=N;import $ from"node:path";import xe from"node:process";import be from"node:path";import ft,{promises as ds}from"node:fs";import{fileURLToPath as Te}from"node:url";var ut={directory:"isDirectory",file:"isFile"};function Oe(i){if(!(i==="both"||Object.hasOwn(ut,i)))throw new Error(`Invalid type specified: ${i}`)}var Re=(i,t)=>i==="both"?t.isFile()||t.isDirectory():t[ut[i]](),Me=i=>i instanceof URL?Te(i):i;function U(i,{cwd:t=xe.cwd(),type:e="file",allowSymlinks:s=!0}={}){Oe(e),t=Me(t);let n=s?ft.statSync:ft.lstatSync;for(let r of i)try{let o=n(be.resolve(t,r),{throwIfNoEntry:!1});if(!o)continue;if(Re(e,o))return r}catch{}}import{promisify as Ne}from"node:util";import{execFile as Ae,execFileSync as Es}from"node:child_process";import{fileURLToPath as ve}from"node:url";var bs=Ne(Ae);function B(i){return i instanceof URL?ve(i):i}var Ts=10*1024*1024;var Ce=Symbol("findUpStop");function Pe(i,t={}){let e=$.resolve(B(t.cwd)??""),{root:s}=$.parse(e),n=$.resolve(e,B(t.stopAt)??s),r=t.limit??Number.POSITIVE_INFINITY,o=[i].flat(),c=a=>{if(typeof i!="function")return U(o,a);let h=i(a.cwd);return typeof h=="string"?U([h],a):h},l=[];for(;;){let a=c({...t,cwd:e});if(a===Ce||(a&&l.push($.resolve(e,a)),e===n||l.length>=r))break;e=$.dirname(e)}return l}function _e(i,t={}){return Pe(i,{...t,limit:1})[0]}import q from"node:process";import $e from"node:os";import pt from"node:tty";function R(i,t=globalThis.Deno?globalThis.Deno.args:q.argv){let e=i.startsWith("-")?"":i.length===1?"-":"--",s=t.indexOf(e+i),n=t.indexOf("--");return s!==-1&&(n===-1||s<n)}var{env:y}=q,L;R("no-color")||R("no-colors")||R("color=false")||R("color=never")?L=0:(R("color")||R("colors")||R("color=true")||R("color=always"))&&(L=1);function Ie(){if(!("FORCE_COLOR"in y))return;if(y.FORCE_COLOR==="true")return 1;if(y.FORCE_COLOR==="false")return 0;if(y.FORCE_COLOR.length===0)return 1;if(!/^\d+$/v.test(y.FORCE_COLOR))return;let i=Math.min(Number(y.FORCE_COLOR),3);if([0,1,2,3].includes(i))return i}function Le(i){return i===0?!1:{level:i,hasBasic:!0,has256:i>=2,has16m:i>=3}}function je(i,{streamIsTTY:t,sniffFlags:e=!0}={}){let s=Ie();s!==void 0&&(L=s);let n=e?L:s;if(n===0)return 0;if(e){if(R("color=16m")||R("color=full")||R("color=truecolor"))return 3;if(R("color=256"))return 2}if(n!==void 0&&/^\d+$/v.test(y.FORCE_COLOR))return n;if("TF_BUILD"in y&&"AGENT_NAME"in y)return 1;if(i&&!t&&n===void 0)return 0;let r=n||0;if(y.TERM==="dumb")return r;if(q.platform==="win32"){let o=$e.release().split(".");return Number(o[0])>=10&&Number(o[2])>=10586?Number(o[2])>=14931?3:2:1}if("CI"in y)return["GITHUB_ACTIONS","GITEA_ACTIONS","CIRCLECI"].some(o=>Object.hasOwn(y,o))?3:["TRAVIS","APPVEYOR","GITLAB_CI","BUILDKITE","DRONE"].some(o=>Object.hasOwn(y,o))||y.CI_NAME==="codeship"?1:r;if("TEAMCITY_VERSION"in y)return/^(?:9\.0*[1-9]\d*\.|\d{2,}\.)/v.test(y.TEAMCITY_VERSION)?1:0;if(y.COLORTERM==="truecolor"||y.TERM==="xterm-kitty"||y.TERM==="xterm-ghostty"||y.TERM==="wezterm")return 3;if("TERM_PROGRAM"in y){let o=Number((y.TERM_PROGRAM_VERSION||"").split(".",1)[0]);switch(y.TERM_PROGRAM){case"iTerm.app":return o>=3?3:2;case"Apple_Terminal":return 2}}return/-256(?:color)?$/iv.test(y.TERM)?2:/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/iv.test(y.TERM)||"COLORTERM"in y?1:r}function dt(i,t={}){let e=je(i,{streamIsTTY:i&&i.isTTY,...t});return Le(e)}var De={stdout:dt({isTTY:pt.isatty(1)}),stderr:dt({isTTY:pt.isatty(2)})},Fe=De;export{v as Minimatch,_e as findUpSync,x as minimatch,Fe as supportsColor};
|
|
2
|
+
var V=(n,t,e)=>{let s=n instanceof RegExp?yt(n,e):n,i=t instanceof RegExp?yt(t,e):t,r=s!==null&&i!=null&&Xt(s,i,e);return r&&{start:r[0],end:r[1],pre:e.slice(0,r[0]),body:e.slice(r[0]+s.length,r[1]),post:e.slice(r[1]+i.length)}},yt=(n,t)=>{let e=t.match(n);return e?e[0]:null},Xt=(n,t,e)=>{let s,i,r,o,c,a=e.indexOf(n),l=e.indexOf(t,a+1),h=a;if(a>=0&&l>0){if(n===t)return[a,l];for(s=[],r=e.length;h>=0&&!c;){if(h===a)s.push(h),a=e.indexOf(n,h+1);else if(s.length===1){let f=s.pop();f!==void 0&&(c=[f,l])}else i=s.pop(),i!==void 0&&i<r&&(r=i,o=l),l=e.indexOf(t,h+1);h=a<l&&a>=0?a:l}s.length&&o!==void 0&&(c=[r,o])}return c};var xt="\0SLASH"+Math.random()+"\0",bt="\0OPEN"+Math.random()+"\0",J="\0CLOSE"+Math.random()+"\0",St="\0COMMA"+Math.random()+"\0",Mt="\0PERIOD"+Math.random()+"\0",Ht=new RegExp(xt,"g"),Zt=new RegExp(bt,"g"),Jt=new RegExp(J,"g"),Kt=new RegExp(St,"g"),Qt=new RegExp(Mt,"g"),te=/\\\\/g,ee=/\\{/g,se=/\\}/g,ne=/\\,/g,re=/\\\./g,ie=1e5,oe=4e6,ce=1e3,ae=1e3;function X(n){return isNaN(n)?n.charCodeAt(0):parseInt(n,10)}function le(n){return n.replace(te,xt).replace(ee,bt).replace(se,J).replace(ne,St).replace(re,Mt)}function he(n){return n.replace(Ht,"\\").replace(Zt,"{").replace(Jt,"}").replace(Kt,",").replace(Qt,".")}function H(n,t){for(let e=0;e<t.length;e++)n.push(t[e])}function fe(n){let t=[],e="";for(;;){let s=V("{","}",n);if(!s){let a=n.split(",");return a[0]=e+a[0],H(t,a),t}let{pre:i,body:r,post:o}=s,c=i.split(",");if(c[0]=e+c[0],c[c.length-1]+="{"+r+"}",!o.length)return H(t,c),t;e=c.pop(),H(t,c),n=o}}function Et(n,t={}){if(!n)return[];let{max:e=ie,maxLength:s=oe,maxDepth:i=ce,maxRewrites:r=ae}=t;return n.slice(0,2)==="{}"&&(n="\\{\\}"+n.slice(2)),Z(le(n),e,s,i,0,r,!0).map(he)}function ue(n){return"{"+n+"}"}function de(n){return/^-?0\d/.test(n)}function pe(n,t){return n<=t}function ge(n,t){return n>=t}function T(n,t,e,s,i,r){let o=[],c=0;for(let a=0;a<n.length;a++)for(let l=0;l<e.length;l++){if(o.length>=s)return o;let h=n[a]+t+e[l];if(!(r&&!h)){if(c+h.length>i)return o;o.push(h),c+=h.length}}return o}function me(n,t,e,s){let i=n.split(/\.\./),r=[];if(i[0]===void 0||i[1]===void 0)return r;let o=X(i[0]),c=X(i[1]),a=Math.max(i[0].length,i[1].length),l=i.length===3&&i[2]!==void 0?Math.max(Math.abs(X(i[2])),1):1,h=pe;c<o&&(l*=-1,h=ge);let u=i.some(de),p=0;for(let d=o;h(d,c)&&r.length<e;d+=l){let g;if(t)g=String.fromCharCode(d),g==="\\"&&(g="");else if(g=String(d),u){let b=a-g.length;if(b>0){let m=new Array(b+1).join("0");d<0?g="-"+m+g.slice(1):g=m+g}}if(p+g.length>s)break;r.push(g),p+=g.length}return r}function Z(n,t,e,s,i,r,o){if(i>s)return[n];let c=[""],a=0,l=!1,h=!0;for(;;){let f=V("{","}",n);if(!f)return T(c,n,[""],t,e,l);let u=f.pre;if(/\$$/.test(u)){if(c=T(c,u+"{"+f.body+"}",[""],t,e,l&&!f.post.length),h=!1,!f.post.length)break;n=f.post;continue}let p=/^-?\d+\.\.-?\d+(?:\.\.-?\d+)?$/.test(f.body),d=/^[a-zA-Z]\.\.[a-zA-Z](?:\.\.-?\d+)?$/.test(f.body),g=p||d,b=f.body.indexOf(",")>=0;if(!g&&!b){if(a<r&&f.post.match(/,(?!,).*\}/)){a++,n=f.pre+"{"+f.body+J+f.post,o=!0;continue}return T(c,u+"{"+f.body+"}"+f.post,[""],t,e,l)}h&&(l=o&&!g,h=!1);let m;if(g)m=me(f.body,d,t,e);else{let y=fe(f.body);if(y.length===1&&y[0]!==void 0&&(y=Z(y[0],t,e,s,i+1,r,!1).map(ue),y.length===1)){if(c=T(c,u+y[0],[""],t,e,l&&!f.post.length),!f.post.length)break;n=f.post;continue}let P=l&&!f.post.length&&!u;for(let E=0;P&&E<c.length;E++)c[E]&&(P=!1);m=[];let v=0;t:for(let E=0;E<y.length;E++){let wt=Z(y[E],t,e,s,i+1,r,!1);for(let q=0;q<wt.length;q++){let j=wt[q];if(!(P&&!j)){if(m.length>=t||v+j.length>e)break t;m.push(j),v+=j.length}}}}if(c=T(c,u,m,t,e,l&&!f.post.length),!f.post.length)break;n=f.post}return c}var Q=(n,t)=>n===t?{t:"lit",ch:String(n)}:{t:"class",re:new RegExp(`^[${n}-${t}]$`)},K=(n,t)=>t.map(e=>[Q(n,n),...e]),_=(n,t)=>{if(!n)return[[]];let e=+n[0],s=+t[0],i=n.slice(1),r=t.slice(1);if(e===s)return K(e,_(i,r));let o="0".repeat(i.length),c="9".repeat(i.length),a=[];i!==o&&a.push(...K(e++,_(i,c)));let l=r===c?[]:K(s--,_(o,r));return e<=s&&a.push([Q(e,s),...Array.from(i,()=>Q(0,9))]),a.push(...l),a},Ot=(n,t,e)=>{if(e)return _(String(n).padStart(e,"0"),String(t).padStart(e,"0"));let s=[];for(let i=String(n).length;i<=String(t).length;i++){let r=Math.max(n,i===1?0:10**(i-1)),o=Math.min(t,10**i-1);s.push(..._(String(r),String(o)))}return s},Ct=(n,t)=>{let e=Number(n),s=Number(t);if(!Number.isSafeInteger(e)||!Number.isSafeInteger(s))return;e>s&&([e,s]=[s,e]);let r=/^-?0\d/.test(n)||/^-?0\d/.test(t)?Math.max(n.length,t.length):0,o=[];if(e<0){let c=Ot(Math.max(-s,1),-e,r&&r-1);o.push(...c.map(a=>[{t:"lit",ch:"-"},...a]))}return s>=0&&o.push(...Ot(Math.max(e,0),s,r)),o};var we={"[:alnum:]":["\\p{L}\\p{Nl}\\p{Nd}"],"[:alpha:]":["\\p{L}\\p{Nl}"],"[:ascii:]":["\\x00-\\x7f"],"[:blank:]":["\\p{Zs}\\t"],"[:cntrl:]":["\\p{Cc}"],"[:digit:]":["\\p{Nd}"],"[:graph:]":["\\p{Z}\\p{C}",!0],"[:lower:]":["\\p{Ll}"],"[:print:]":["\\p{C}",!0],"[:punct:]":["\\p{P}\\p{S}"],"[:space:]":["\\p{Z}\\t\\r\\n\\v\\f"],"[:upper:]":["\\p{Lu}"],"[:word:]":["\\p{L}\\p{Nl}\\p{Nd}\\p{Pc}"],"[:xdigit:]":["A-Fa-f0-9"]},$=n=>n.replace(/[[\]\\-]/g,"\\$&"),tt=/$./,Nt=(n,t,e=!1,s)=>{let i=m=>{let y=s?m.normalize(s):m;return[...y].length===1?y:m},r=t;if(n.charAt(r)!=="[")throw new Error("not in a brace expression");let o=[],c=[],a=r+1,l=!1,h=!1,f=!1,u=r,p="";t:for(;a<n.length;){let m=String.fromCodePoint(n.codePointAt(a));if((m==="!"||m==="^")&&a===r+1){f=!0,a++;continue}if(m==="]"&&l&&!h){u=a+1;break}if(l=!0,m==="\\"&&!h){h=!0,a++;continue}if(m==="["&&!h){for(let[P,[v,E]]of Object.entries(we))if(n.startsWith(P,a)){if(p)return[tt,n.length-r];a+=P.length,E?c.push(v):o.push(v);continue t}}h=!1;let y=i(m);if(p){y.codePointAt(0)>p.codePointAt(0)?o.push($(p)+"-"+$(y)):y===p&&o.push($(y)),p="",a+=m.length;continue}if(n.startsWith("-]",a+m.length)){o.push($(y+"-")),a+=m.length+1;continue}if(n.startsWith("-",a+m.length)){p=y,a+=m.length+1;continue}o.push($(y)),a+=m.length}if(u<a)return[tt,0];if(!o.length&&!c.length)return[tt,n.length-r];let d="["+(f?"^":"")+o.join("")+"]",g="["+(f?"":"^")+c.join("")+"]",b="^"+(o.length&&c.length?"("+d+"|"+g+")":o.length?d:g);return[new RegExp(b,e?"iu":"u"),u-r]};var et={t:"match",id:0},ye="!?+*@",N=n=>({t:"lit",ch:n}),xe=n=>n.replace(/[\\^$.*+?()[\]{}|/]/g,"\\$&"),vt=n=>new RegExp(`^${xe(n)}$`,"iu"),D=new Map,Tt=n=>{let t=D.get(n);return t||(t=vt(n),D.size>=1e3&&D.clear(),D.set(n,t)),t},rt=(n,t)=>{if(t===n.ch)return!0;if(!n.re)return!1;let e=t.charCodeAt(0);if(e>=128)return n.re.test(t);let s=n.ascii??=new Uint8Array(128);return s[e]||=n.re.test(t)?1:2,s[e]===1},be=(n,t,e,s,i)=>{let r=[];for(let o=0;o<n.length;){let c=String.fromCodePoint(n.codePointAt(o));if(i){let a=c==="\\"&&n.startsWith(i,o+1)?1:0;if(a||c===i){let l=o+a+i.length,h=n.indexOf(i,l),f=/^(-?\d+)\.\.(-?\d+)$/.exec(n.slice(l,h)),u=h!==-1&&f&&Ct(f[1],f[2]);if(u){r.push({t:"ext",type:"@",alts:u}),o=h+i.length;continue}}}if(c==="\\"){let a=n.codePointAt(o+1),l=a===void 0?c:String.fromCodePoint(a);r.push(N(l)),o+=1+l.length;continue}if(c==="["){let[a,l]=Nt(n,o,t,s);if(l){r.push({t:"class",re:a}),o+=l;continue}}if(!e&&ye.includes(c)&&n[o+1]==="("){r.push({t:"open",type:c}),o+=2;continue}r.push(!e&&c==="|"?{t:"bar"}:!e&&c===")"?{t:"close"}:c==="*"?{t:"star"}:c==="?"?{t:"any"}:N(c)),o+=c.length}return r},Se=n=>{let t=new Map,e=[];return n.forEach((s,i)=>{s.t==="open"?e.push(i):s.t==="close"&&e.length&&t.set(e.pop(),i)}),t},_t=(n,t,e,s,i)=>{let r=[],o=[r];for(let c=e;c<s;c++){let a=n[c],l=t.get(c);if(a.t==="open"&&l!==void 0){let h=_t(n,t,c+1,l,!1);r.push({t:"ext",type:a.type,alts:h}),c=l}else a.t==="bar"&&!i?o.push(r=[]):a.t==="open"?r.push(N(a.type),N("(")):a.t==="bar"?r.push(N("|")):a.t==="close"?r.push(N(")")):r.push(a)}return o},$t=(n,t)=>{let e=[],s="",i=()=>{for(let r of s.normalize(t))e.push(N(r));s=""};for(let r of n){if(r.t==="lit"){s+=r.ch;continue}i(),e.push(r.t==="ext"?{...r,alts:r.alts.map(o=>$t(o,t))}:r)}return i(),e},Me=(n,t)=>{let e=1,s=c=>({t:"split",id:e++,out:c}),i=(c,a)=>c.reduceRight((l,h)=>r(h,l),a),r=(c,a)=>{switch(c.t){case"lit":let u=t?Tt(c.ch):void 0;return{t:"lit",id:e++,ch:c.ch,re:u,next:a};case"any":case"star":return{t:c.t,id:e++,next:a};case"class":return{t:"class",id:e++,re:c.re,next:a}}let l=u=>c.alts.map(p=>i(p,u));switch(c.type){case"@":return s(l(a));case"?":return s([a,...l(a)]);case"!":return{t:"neg",id:e++,sub:s(l(et)),next:a}}let h=s([]),f=s(l(h));return h.out.push(a,f),c.type==="*"?h:f};return[i(n,et),e]},Ee=n=>{let t=[],e=new Set,s=r=>r.t==="match"?"match":String(r.id),i=(r,o)=>{if(r.t==="match"||e.has(r))return;e.add(r);let c=a=>t.push(`${o}${r.id}: ${a}`);switch(r.t){case"split":c(`split -> ${r.out.map(s).join(", ")}`);for(let a of r.out)i(a,o);return;case"neg":return c(`!(${s(r.sub)}) -> ${s(r.next)}`),i(r.sub,o+" "),i(r.next,o);case"lit":c(`${JSON.stringify(r.ch)} -> ${s(r.next)}`);break;case"class":c(`${r.re} -> ${s(r.next)}`);break;default:c(`${r.t==="any"?"?":"*"} -> ${s(r.next)}`)}i(r.next,o)};return i(n,""),[`start -> ${s(n)}`,...t].join(`
|
|
3
|
+
`)},st=class{gen;threads=[];match=!1;runs=[];ids=[];constructor(t){this.gen=t}get dead(){return!this.threads.length&&!this.match&&!this.runs.length}},kt=(n,t)=>n.ids.length!==t.ids.length||n.runs.length!==t.runs.length||n.ids.some((e,s)=>e!==t.ids[s])?!1:n.runs.every(e=>t.runs.some(s=>s.neg===e.neg&&kt(s.state,e.state))),Pt=n=>({has:new Float64Array(n),seen:new Float64Array(n),gen:0}),k=class{dots;dotStart;#t;constructor(t,e,s){this.dots=t,this.dotStart=e,this.#t=s}state(){return new st(++this.#t.gen)}done(t){return t.ids=t.threads.map(e=>e.id).sort((e,s)=>e-s),t.match&&t.ids.unshift(et.id),t}#s(t,e){let{seen:s}=this.#t;return s[e.id]===t.gen?!1:(s[e.id]=t.gen,!0)}#e(t,e){let{has:s}=this.#t;return s[e.id]===t.gen?!1:(s[e.id]=t.gen,t.threads.push(e),!0)}restricted(t,e){return e&&(this.dots||this.dotStart&&t===0)}add(t,e,s,i){switch(e.t){case"split":if(!this.#s(t,e))return;for(let o of e.out)this.add(t,o,s,i);return;case"neg":if(!this.#s(t,e))return;let r=this.state();return this.add(r,e.sub,s,!1),this.done(r),this.addRun(t,{t:"run",neg:e,state:r},s,i);case"star":if(this.restricted(s,i))return;this.#e(t,e)&&this.add(t,e.next,s,i);return;case"match":t.match=!0;return;default:this.#e(t,e)}}addRun(t,e,s,i){for(let r of t.runs)if(r.neg===e.neg&&kt(r.state,e.state))return;t.runs.push(e),e.state.match||this.add(t,e.neg.next,s,i)}step(t,e,s,i){let r=this.state();for(let o of t.threads)switch(o.t){case"lit":rt(o,e)&&this.add(r,o.next,s+1,i);break;case"any":this.restricted(s,i)||this.add(r,o.next,s+1,i);break;case"class":!this.restricted(s,i)&&o.re.test(e)&&this.add(r,o.next,s+1,i);break;case"star":this.restricted(s,i)||this.add(r,o,s+1,i)}if(!this.restricted(s,i))for(let o of t.runs){if(o.state.dead){this.addRun(r,o,s+1,i);continue}let c=this.step(o.state,e,s,!1);this.addRun(r,{t:"run",neg:o.neg,state:c},s+1,i)}return this.done(r)}},It=n=>{let t=n.ids.join();if(!n.runs.length)return t;let e=n.runs.map(s=>`${s.neg.id}(${It(s.state)})`);return`${t}|${e.sort().join("|")}`},Oe=1<<18,nt=class{#t;#s=new Map;#e=0;#r;#n;#o;#i;constructor(t,e){this.#t=t,this.#o=new k(!1,!1,e),this.#i=new k(!1,!0,e)}#a(t){return{state:t,match:t.match,dead:t.dead,next:new Map}}#l(t){let e=It(t),s=this.#s.get(e);if(s)return s;this.#e>Oe&&this.#u();let i=this.#a(t);return this.#s.set(e,i),this.#e+=e.length+1,i}#u(){this.#s.clear(),this.#e=0,this.#r=void 0,this.#n=void 0}start(t){if(t){if(this.#n)return this.#n;let s=this.#i.state();return this.#i.add(s,this.#t,0,!0),this.#n=this.#a(this.#i.done(s))}if(this.#r)return this.#r;let e=this.#o.state();return this.#o.add(e,this.#t,0,!0),this.#r=this.#l(this.#o.done(e))}next(t,e){let s=e.charCodeAt(0),i=s<128?void 0:t.next.get(e);if(i)return i;let r=t===this.#n?this.#l(this.#i.step(t.state,e,0,!0)):this.#l(this.#o.step(t.state,e,1,!0));return s<128?(t.ascii||(t.ascii=new Array(128),this.#e+=128),t.ascii[s]=r):t.next.set(e,r),this.#e++,r}},Ce=n=>{let t=[];for(let e=n;e.t!=="match";e=e.next){if(e.t==="split"||e.t==="neg")return;t.push(e)}return t},Ne=(n,t,e,s)=>{let i=0,r=e,o=-1,c=0;for(;r<s;){let a=n[i];if(a?.t==="star"){o=i++,c=r;continue}let l=t[r];if(a&&(a.t==="any"||a.t==="lit"&&rt(a,l)||a.t==="class"&&a.re.test(l))){i++,r++;continue}if(o===-1)return!1;i=o+1,r=++c}for(;n[i]?.t==="star";)i++;return i===n.length},Ft=n=>{let t=0,e=0;for(let s of n){let[i,r]=Pe(s);t+=i,e+=r}return[t,e]},Pe=n=>{if(n.t==="star")return[0,1/0];if(n.t!=="ext")return[1,1];if(n.type==="!")return[0,1/0];let t=n.alts.map(Ft),e=Math.min(...t.map(r=>r[0])),s=Math.max(...t.map(r=>r[1])),i=s===0?0:1/0;return n.type==="@"?[e,s]:n.type==="?"?[0,s]:n.type==="*"?[0,i]:[e,i]},Rt=(n,t,e)=>{for(let s=0;s<n.length;s++)if(!rt(n[s],t[e+s]))return!1;return!0},Re=/[/\ud800-\udfff]/,Ae=/[\ud800-\udfff]/,G=n=>Ae.test(n)?[...n]:n,At=n=>{if(n.includes("/"))throw new Error("can only match a single path portion, got: "+n)},I=class{pattern;options;#t;#s;#e;#r;#n;#o=!1;#i;#a;#l=!1;#u=0;#p=1/0;#h=[];#c=[];#g;#m;#y=!1;#x;#f;constructor(t,e={}){if(t.includes("/"))throw new Error("can only match a single path portion, got pattern: "+t);this.pattern=t,this.options=e;let{nocase:s=!1,noext:i=!1,normalize:r}=e;this.#f=r===!0?"NFC":r||void 0;let o=/^[?*+@]\(\)$/.test(t),c=be(t,s,i||o,this.#f,e.rangeMark),[a]=_t(c,Se(c),0,c.length,!0);this.#f&&(a=$t(a,this.#f));let[l,h]=Me(a,s);if(this.#t=l,this.#s=h,a.every(f=>f.t==="lit"))this.#n=a.map(f=>f.ch).join(""),this.#o=s;else{let f=d=>d.t!=="lit"?void 0:s?{ch:d.ch,re:Tt(d.ch)}:{ch:d.ch};for(let d of a){let g=f(d);if(!g)break;this.#h.push(g)}for(let d=a.length-1;d>=0;d--){let g=f(a[d]);if(!g)break;this.#c.unshift(g)}this.#y=!!(this.#h.length||this.#c.length),s||(this.#g=this.#h.map(d=>d.ch).join(""),this.#m=this.#c.map(d=>d.ch).join("")),this.#a=Ce(this.#t)?.slice(this.#h.length,-this.#c.length||void 0),this.#l=!!this.#a?.every(d=>d.t==="star"||d.t==="any");let[u,p]=Ft(a);this.#u=u,this.#p=p}}test(t){return this.#f?(At(t),this.#d(t.normalize(this.#f))):Re.test(t)?(At(t),this.#d(t,[...t])):this.#d(t,t)}testUnchecked(t){return this.#d(this.#f?t.normalize(this.#f):t)}#d(t,e){if(this.#n!==void 0)return this.#o?(this.#i??=vt(this.#n)).test(t):t===this.#n;let s=this.#u,i=this.#p;if(e===void 0){let h=t.length,f=h+1>>1;if(h<s||f>i)return!1;(f<s||h>i)&&(e=G(t))}if(e!==void 0&&(e.length<s||e.length>i))return!1;let r=this.#h.length;if(this.#y)if(this.#g!==void 0&&this.#m!==void 0){if(!t.startsWith(this.#g)||!t.endsWith(this.#m))return!1}else{e??=G(t);let h=e.length-this.#c.length;if(!Rt(this.#h,e,0)||!Rt(this.#c,e,h))return!1}let o=!this.options.dot&&t.startsWith(".");if(this.#a){if(t==="."||t===".."||o&&!r)return!1;if(this.#l)return!0;e??=G(t);let h=e.length-this.#c.length;return Ne(this.#a,e,r,h)}if(e??=G(t),t==="."||t===".."){this.#e??=Pt(this.#s);let h=this.#r??=new k(!0,!1,this.#e),f=h.state();h.add(f,this.#t,0,!0);let u=h.done(f);for(let p=0;p<e.length;p++)u=h.step(u,e[p],p,!0);return u.match}this.#e??=Pt(this.#s);let c=this.#x??=new nt(this.#t,this.#e),a=c.start(o),l=e===t;for(let h=0;h<e.length;h++){if(a.dead)return!1;let f=l?t.charCodeAt(h):e[h].charCodeAt(0);a=a.ascii?.[f]??c.next(a,e[h])}return a.match}toString(){return Ee(this.#t)}};var F=n=>{if(typeof n!="string")throw new TypeError("invalid pattern");if(n.length>65536)throw new TypeError("pattern is too long")};var it=(n,{windowsPathsNoEscape:t=!1,magicalBraces:e=!1}={})=>e?t?n.replace(/[?*()[\]{}]/g,"[$&]"):n.replace(/[?*()[\]\\{}]/g,"\\$&"):t?n.replace(/[?*()[\]]/g,"[$&]"):n.replace(/[?*()[\]\\]/g,"\\$&");var ot=(n,{windowsPathsNoEscape:t=!1,magicalBraces:e=!0}={})=>e?t?n.replace(/\[([^/\\])\]/g,"$1"):n.replace(/((?!\\).|^)\[([^/\\])\]/g,"$1$2").replace(/\\([^/])/g,"$1"):t?n.replace(/\[([^/\\{}])\]/g,"$1"):n.replace(/((?!\\).|^)\[([^/\\{}])\]/g,"$1$2").replace(/\\([^/{}])/g,"$1");var S=(n,t,e={})=>(F(t),!e.nocomment&&t.charAt(0)==="#"?!1:Te(t,e).match(n)),R=new Map,ve=256,Te=(n,t)=>{let e=n+"\0"+JSON.stringify(t),s=R.get(e);return s?R.delete(e):(s=new A(n,{...t}),R.size>=ve&&R.delete(R.keys().next().value)),R.set(e,s),s},Wt=typeof process=="object"&&process?process.env?.__MINIMATCH_TESTING_PLATFORM__||process.platform:"posix",zt={win32:{sep:"\\"},posix:{sep:"/"}},_e=Wt==="win32"?zt.win32.sep:zt.posix.sep;S.sep=_e;var x=Symbol("globstar **");S.GLOBSTAR=x;var $e=(n,t={})=>e=>S(e,n,t);S.filter=$e;var O=(n,t={})=>Object.assign({},n,t),ke=n=>{if(!n||typeof n!="object"||!Object.keys(n).length)return S;let t=S;return Object.assign((s,i,r={})=>t(s,i,O(n,r)),{Minimatch:class extends t.Minimatch{constructor(i,r={}){super(i,O(n,r))}static defaults(i){return t.defaults(O(n,i)).Minimatch}},unescape:(s,i={})=>t.unescape(s,O(n,i)),escape:(s,i={})=>t.escape(s,O(n,i)),filter:(s,i={})=>t.filter(s,O(n,i)),defaults:s=>t.defaults(O(n,s)),braceExpand:(s,i={})=>t.braceExpand(s,O(n,i)),match:(s,i,r={})=>t.match(s,i,O(n,r)),sep:t.sep,GLOBSTAR:x})};S.defaults=ke;var ft=(n,t={})=>(F(n),t.nobrace||!/\{(?:(?!\{).)*\}/.test(n)?[n]:Et(n,{max:t.braceExpandMax}));S.braceExpand=ft;var Ie=100,Fe=/(?<![\\$])\{(-?\d+)\.\.(-?\d+)\}/g,ze=(n,t,e={})=>{let s=new A(t,e);return n=n.filter(i=>s.match(i)),s.options.nonull&&!n.length&&n.push(t),n};S.match=ze;var Lt=/[?*]|[+@!]\(.*?\)|\[|\]/,Ut=(n,t)=>{let e=t+1;(n.charAt(e)==="!"||n.charAt(e)==="^")&&e++;let s=!1;for(;e<n.length;e++){let i=n.charAt(e);if(i==="]"&&s)return e;s=!0,i==="\\"&&e++}return-1},Le=(n,t)=>{if(!t&&(n==="+()"||n==="@()"))return n;let e="";for(let s=0;s<n.length;s++){let i=n.charAt(s);if(i==="\\")e+=n.charAt(++s)||i;else{if(i==="*"||i==="?")return;if(i==="["){let r=Ut(n,s);if(r===-1){e+=i;continue}let o=n.slice(s+1,r);if(o.startsWith("\\")&&(o=o.slice(1)),[...o].length!==1||"!^".includes(n.charAt(s+1)))return;e+=o,s=r}else{if(!t&&"+@!".includes(i)&&n.charAt(s+1)==="("&&n.includes(")",s+2))return;e+=i}}}return e},je=n=>{if(/^[?*+@]\(\)$/.test(n)||n.includes("[:"))return!1;let t=0;for(let e=0;e<n.length;e++){let s=n.charAt(e);if(s==="\\"){if(++e===n.length)return!1}else if(s==="["){let i=Ut(n,e);i!==-1&&(e=i)}else if("+@!?*".includes(s)&&n.charAt(e+1)==="(")t++,e++;else if(s===")"){if(!t--)return!1}else if(s==="|"&&!t)return!1}return!t},ct,jt,C=(n,t)=>typeof n=="string"?t===n:t!==""&&n.testUnchecked(t),Dt=(n,t,e,s,i)=>C(n,t)?e:s!==void 0&&C(n,s)?i:-1,ut=n=>n==="."||n==="..",at=n=>typeof n=="string"&&/^[a-z]:$/i.test(n),U=n=>typeof n=="string"&&/^unc$/i.test(n),lt=n=>{if(n[0]!==""||n[1]!=="")return-1;let t=n[2]!=="?"?2:U(n[3])?4:-1,e=n[t],s=n[t+1];return t!==-1&&e!==void 0&&e!==""&&e!==x&&s!==void 0&&s!==""&&s!==x?t:-1},W=(n,t)=>!ut(n)&&(t||!n.startsWith(".")),z=(n,t,e,s,i)=>{for(let r=t;r<e;){if(n.charCodeAt(r)===46){if(!s)return!0;let c=n.charCodeAt(r+1)===46?r+2:r+1;if(c>=e||B(n.charCodeAt(c),i))return!0}let o=dt(n,r,i);if(o===-1)return!1;for(r=o+1;r<e&&B(n.charCodeAt(r),i);)r++}return!1},B=(n,t)=>t==="/"?n===47:t==="\\"?n===92:n===47||n===92,dt=(n,t,e)=>{if(e!=="both")return n.indexOf(e,t);let s=n.indexOf("/",t),i=n.indexOf("\\",t);return s===-1?i:i===-1?s:Math.min(s,i)},Gt=(n,t,e)=>e!=="both"?n.lastIndexOf(e,t):Math.max(n.lastIndexOf("/",t),n.lastIndexOf("\\",t)),ht={},A=class{options;set;pattern;windowsPathsNoEscape;nonegate;negate;comment;empty;preserveMultipleSlashes;partial;globSet;globParts;nocase;isWindows;platform;windowsNoMagicRoot;maxGlobstarRecursion;#t;#s;#e;#r;#n=[];#o=[];#i=[];#a=new Map;#l=!1;#u;#p=new WeakMap;constructor(t,e={}){F(t),e=e||{},this.options=e,this.maxGlobstarRecursion=e.maxGlobstarRecursion??200,this.pattern=t,this.platform=e.platform||Wt,this.isWindows=this.platform==="win32";let s="allowWindowsEscape";this.windowsPathsNoEscape=!!e.windowsPathsNoEscape||e[s]===!1,this.windowsPathsNoEscape&&(this.pattern=this.pattern.replace(/\\/g,"/")),this.preserveMultipleSlashes=!!e.preserveMultipleSlashes,this.negate=!1,this.nonegate=!!e.nonegate,this.comment=!1,this.empty=!1,this.partial=!!e.partial,this.nocase=!!this.options.nocase,this.windowsNoMagicRoot=e.windowsNoMagicRoot!==void 0?e.windowsNoMagicRoot:!!(this.isWindows&&this.nocase),this.globSet=[],this.globParts=[],this.set=[],this.#t=!this.preserveMultipleSlashes,this.#e=(e.optimizationLevel??1)>=2;let i=e.normalize;this.#r=i===!0?"NFC":i||void 0,this.make();let r=this.set.map(o=>this.#c(o));this.#i=this.set.map((o,c)=>this.#t&&o.length-1>r[c]),this.#n=this.set.map((o,c)=>{let a=this.#i[c]?o.length-1:o.length,l=o.slice(r[c]+1,a).filter(h=>typeof h=="string"&&!!h);return[...new Set(l)]}),this.#s=this.#n.some(o=>o.length),this.#o=this.set.map((o,c)=>{let[a,l,h]=o;if(this.#i[c]&&o.length===2&&a===x&&l!==x)return"tail";if(this.#i[c]&&e.matchBase&&o.length===1&&a!==x&&a!=="")return"base";if(!(!this.#t||r[c]!==-1)){if(o.length===3&&a===x&&h===x&&l!==x&&l!==""&&this.maxGlobstarRecursion>0)return"mid";if(o.length===2&&l===x&&a!==x&&a!=="")return"head"}})}#h(t){return this.#r?t.normalize(this.#r):t}#c(t){if(!this.isWindows)return-1;if(at(t[0]))return 0;if(t[0]===""&&t[1]===""&&t[2]==="?"&&at(t[3]))return 3;let s=lt(t);return s===-1?-1:s+1}hasMagic(){if(this.options.magicalBraces&&this.set.length>1)return!0;for(let t of this.set)for(let e of t)if(typeof e!="string")return!0;return!1}make(){let t=this.pattern,e=this.options;if(!e.nocomment&&t.charAt(0)==="#"){this.comment=!0;return}if(!t){this.empty=!0;return}this.parseNegate(),this.globSet=[...new Set(this.#C())];let s=this.globSet.map(r=>this.#M(r));this.globParts=this.preprocess(s),this.#l=!0;let i=this.globParts.map((r,o,c)=>{if(this.isWindows&&this.windowsNoMagicRoot){let a=r[2]==="?"&&U(r[3])?6:4,l=r[0]===""&&r[1]===""&&(r[2]==="?"||!Lt.test(r[2]))&&r.slice(3,a).every(f=>!Lt.test(f)),h=/^[a-z]:/i.test(r[0]);if(l)return[...r.slice(0,a).map(f=>this.#h(f)),...r.slice(a).map(f=>this.parse(f))];if(h)return[this.#h(r[0]),...r.slice(1).map(f=>this.parse(f))]}return r.map(a=>this.parse(a))});if(this.set=i.filter(r=>r.indexOf(!1)===-1),this.isWindows)for(let r=0;r<this.set.length;r++){let o=this.set[r];o[0]===""&&o[1]===""&&this.globParts[r][2]==="?"&&(at(o[3])||U(this.globParts[r][3]))&&(U(this.globParts[r][3])&&(o[3]="UNC"),o[2]="?")}e.noext||this.mergeRows(),this.#l=!1,this.set.forEach((r,o)=>{for(let c=0;c<r.length;c++)r[c]===ht&&(r[c]=this.parse(this.globParts[o][c]))})}mergeRows(){let t=!0;for(;t;){t=!1;let e=Math.max(0,...this.set.map(s=>s.length));for(let s=0;s<e;s++){let i=new Map;this.set.forEach((o,c)=>{if(!(o[s]instanceof I||o[s]===ht)||!je(this.globParts[c][s]))return;let a=[...this.globParts[c]];a[s]="";let l=`${o.length}/${a.join("/")}`,h=i.get(l);h?h.push(c):i.set(l,[c])});let r=new Set;for(let o of i.values()){if(o.length<2)continue;let[c,...a]=o,h=`@(${o.map(f=>this.globParts[f][s]).join("|")})`;this.globParts[c][s]=h,this.set[c][s]=this.parse(h);for(let f of a)r.add(f)}r.size&&(t=!0,this.set=this.set.filter((o,c)=>!r.has(c)),this.globParts=this.globParts.filter((o,c)=>!r.has(c)))}}}preprocess(t){if(this.options.noglobstar)for(let s of t)for(let i=0;i<s.length;i++)s[i]==="**"&&(s[i]="*");let{optimizationLevel:e=1}=this.options;return e>=2?(t=this.firstPhasePreProcess(t),t=this.secondPhasePreProcess(t)):e>=1?t=this.levelOneOptimize(t):t=this.adjascentGlobstarOptimize(t),t}adjascentGlobstarOptimize(t){return t.map(e=>{let s=-1;for(;(s=e.indexOf("**",s+1))!==-1;){let i=s;for(;e[i+1]==="**";)i++;i!==s&&e.splice(s,i-s)}return e})}levelOneOptimize(t){return t.map(e=>{let s=this.#c(e)+1;return e=e.reduce((i,r)=>{let o=i[i.length-1];return r==="**"&&o==="**"?i:r===".."&&i.length>s&&o&&o!==".."&&o!=="."&&o!=="**"?(i.pop(),i):(i.push(r),i)},[]),e.length===0?[""]:e})}#g(t){let e=!this.isWindows||!t.includes("\\")?"/":t.includes("/")?"both":"\\",s=this.#t?0:-1,i="",r=0,o,c=0,a=!!this.options.dot;t:for(let l=0;l<this.set.length;l++){let h=this.set[l],f=h[h.length-1],u=s!==-1&&this.#i[l]&&f!==x;if(u&&s===0){let g=Gt(t,t.length,e);if(r=g+1,i=t.slice(r),i===""&&g>=0){let m=g;for(;m>0&&B(t.charCodeAt(m-1),e);)m--;c=m===0?0:Gt(t,m-1,e)+1,o=t.slice(c,m)}let b=this.#e&&(ut(i)||i===""&&o!==void 0&&ut(o));s=b?-1:1,u=!b}let p=-1;if(u&&typeof f=="string"&&(p=Dt(f,i,r,o,c),p===-1))continue;if(this.#s){for(let g of this.#n[l])if(!t.includes(g))continue t}if(u&&typeof f=="object"&&(p=Dt(f,i,r,o,c),p===-1))continue;let d=this.#o[l];if(d==="base"&&u)return"yes";if(d==="tail"&&u){if(this.#e&&z(t,0,p,!0,e))return"maybe";if(!z(t,0,p,a,e))return"yes";continue}if(d==="mid"||d==="head"){let g=this.#y(t,h,d==="head",a,e);if(g!=="no")return g;continue}return"maybe"}return"no"}#m(t,e,s){let i=!!this.options.dot,r=t.length;if(s==="head"){if(r<2||!C(e[0],t[0]))return!1;for(let c=1;c<r;c++)if(!W(t[c],i))return!1;return!0}let o=e[1];if(s==="tail"){let c=r-1;if(!C(o,t[c])&&(t[c]!==""||r===1||!C(o,t[--c])))return!1;for(let a=0;a<c;a++)if(!W(t[a],i))return!1;return!0}for(let c=0;c<r;c++){if(C(o,t[c])&&c+1<r){let a=c+1;for(;a<r&&W(t[a],i);)a++;if(a===r)return!0}if(!W(t[c],i))return!1}return!1}#y(t,e,s,i,r){if(this.#e&&z(t,0,t.length,!0,r))return"maybe";let o=e[s?0:1],c=0;for(let a=dt(t,c,r);a!==-1;a=dt(t,c,r)){let l=a+1;for(;l<t.length&&B(t.charCodeAt(l),r);)l++;if((typeof o=="string"?a-c===o.length&&t.startsWith(o,c):a>c&&o.testUnchecked(t.slice(c,a)))&&!z(t,l,t.length,i,r))return"yes";if(s||z(t,c,l,i,r))return"no";c=l}return"no"}#x(t){let e=ct;return e?.f===t&&e.isWindows===this.isWindows&&e.preserveMultipleSlashes===this.preserveMultipleSlashes&&e.normalize===this.#r?e:void 0}#f(t){let{isWindows:e,preserveMultipleSlashes:s}=this,i=this.#M(e?t.split("\\").join("/"):t),r=this.#r;return r&&(i=i.map(o=>o.normalize(r))),ct={f:t,isWindows:e,preserveMultipleSlashes:s,normalize:r,parts:i},ct}#d(t){let e=[...t],s=!1;do{if(s=!1,!this.preserveMultipleSlashes){for(let o=1;o<e.length-1;o++){let c=e[o];o===1&&c===""&&e[0]===""||(c==="."||c==="")&&(s=!0,e.splice(o,1),o--)}e[0]==="."&&e.length===2&&(e[1]==="."||e[1]==="")&&(s=!0,e.pop())}let i=this.#c(e)+1,r=i;for(;(r=e.indexOf("..",r+1))!==-1;){let o=e[r-1];o&&o!=="."&&o!==".."&&o!=="**"&&(s=!0,e.splice(r-1,2),r=Math.max(r-2,i))}}while(s);return e.length===0?[""]:e}firstPhasePreProcess(t){let{braceExpandMax:e=1e5}=this.options,s=0,i=1e6,r=!1;do{r=!1;for(let o of t){let c=-1;for(;(c=o.indexOf("**",c+1))!==-1;){let h=c;for(;o[h+1]==="**";)h++;h>c&&o.splice(c+1,h-c);let f=o[c+1],u=o[c+2],p=o[c+3];if(f!==".."||!u||u==="."||u===".."||!p||p==="."||p==="..")continue;let d=o.length-1;if(t.length>=e||s+d>i)throw new RangeError("optimizationLevel 2: too many patterns from '**/..'");r=!0,o.splice(c,1);let g=o.slice(0);g[c]="**",s+=d,t.push(g),c--}if(!this.preserveMultipleSlashes){for(let h=1;h<o.length-1;h++){let f=o[h];h===1&&f===""&&o[0]===""||(f==="."||f==="")&&(r=!0,o.splice(h,1),h--)}o[0]==="."&&o.length===2&&(o[1]==="."||o[1]==="")&&(r=!0,o.pop())}let a=this.#c(o)+1,l=a;for(;(l=o.indexOf("..",l+1))!==-1;){let h=o[l-1];if(h&&h!=="."&&h!==".."&&h!=="**"){r=!0;let u=l===1&&o[l+1]==="**"?["."]:[];o.splice(l-1,2,...u),o.length===0&&o.push(""),l=Math.max(l-2,a)}}}}while(r);return t}secondPhasePreProcess(t){let e=new Set,s=t.filter(o=>{let c=o.join("/");return e.has(c)?!1:(e.add(c),!0)}),i=new Map;for(let o of s){let c=[];for(let a=0;a<o.length;a++)o[a]==="*"&&c.push(a);c.length&&i.set(c.join(","),c)}if(!i.size||s.length*i.size>1e5)return s;let{dot:r}=this.options;return s.filter(o=>{for(let c of i.values()){if(c[c.length-1]>=o.length)continue;let a=[...o],l=!0,h=!1;for(let f of c){let u=o[f];if(u!=="*"){if(!u||u==="**"||!r&&u.startsWith(".")){l=!1;break}a[f]="*",h=!0}}if(l&&h&&e.has(a.join("/")))return!1}return!0})}parseNegate(){if(this.nonegate)return;let t=this.pattern,e=!1,s=0;for(let i=0;i<t.length&&t.charAt(i)==="!";i++)e=!e,s++;s&&(this.pattern=t.slice(s)),this.negate=e}#b(t,e,s,i){let r=0,o=0,c=this.isWindows?lt(e):-1,a=c===-1?-1:lt(s);if(a!==-1){let l=s[a],h=s[a+1];typeof l!="string"||typeof h!="string"?(r=c,o=a):e[c].toLowerCase()===l.toLowerCase()&&e[c+1].toLowerCase()===h.toLowerCase()&&(r=c+2,o=a+2)}else if(this.isWindows){let l=typeof t[0]=="string"&&/^[a-z]:$/i.test(t[0]),h=!l&&t[0]===""&&t[1]===""&&t[2]==="?"&&/^[a-z]:$/i.test(t[3]),f=typeof s[0]=="string"&&/^[a-z]:$/i.test(s[0]),u=!f&&s[0]===""&&s[1]===""&&s[2]==="?"&&typeof s[3]=="string"&&/^[a-z]:$/i.test(s[3]),p=h?3:l?0:void 0,d=u?3:f?0:void 0;if(typeof p=="number"&&typeof d=="number"){let[g,b]=[t[p],s[d]];g.toLowerCase()===b.toLowerCase()&&(o=d+1,r=p+1)}}return t=e,s.includes(x)?this.#E(t,s,i,r,o):this.#w(t,s,i,r,o)}#E(t,e,s,i,r){let{head:o,body:c,tail:a,segments:l}=this.#O(e,s,r);if(o.length){let f=i+o.length;if(!this.#w(t,o,s,i,0,f))return!1;i+=o.length,r+=o.length}let h=0;if(a.length){if(a.length+i>t.length)return!1;let f=t.length-a.length;if(this.#w(t,a,s,f,0))h=a.length;else{if(t[t.length-1]!==""||i+a.length===t.length||(f--,!this.#w(t,a,s,f,0)))return!1;h=a.length+1}}if(!c.length){let f=!!h;for(let u=i;u<t.length-h;u++){let p=String(t[u]);if(f=!0,p==="."||p===".."||!this.options.dot&&p.startsWith("."))return!1}return s||f}return!!this.#S(t,l,t.length-h,i,0,s,0,!!h,new Set)}#O(t,e,s){let i=this.#p.get(t);i||(i=[],this.#p.set(t,i));let r=s*2+(e?1:0),o=i[r];if(o)return o;let c=t.indexOf(x,s),a=t.lastIndexOf(x),l=t.slice(s,c),h=t.slice(c+1,e?void 0:a),f=e?[]:t.slice(a+1),u=[[[],0]],p=u[0],d=0,g=[0];for(let m of h)m===x?(g.push(d),p=[[],0],u.push(p)):(p[0].push(m),d++);u.forEach((m,y)=>{m[1]=d-g[y]});let b={head:l,body:h,tail:f,segments:u};return i[r]=b,b}#S(t,e,s,i,r,o,c,a,l){let h=e[r];if(!h){if(o)return i>=s||i===s-1&&t[i]==="";for(let d=i;d<s;d++){a=!0;let g=t[d];if(g==="."||g===".."||!this.options.dot&&g.startsWith("."))return!1}return a}let[f,u]=h,p=o?s:s-u;for(;i<=p;){let d=r*(t.length+1)+i;if(l.has(d))return!1;if(l.add(d),this.#w(t,f,o,i,0,i+f.length)&&c<this.maxGlobstarRecursion){let m=this.#S(t,e,s,i+f.length,r+1,o,c+1,a,l);if(m!==!1)return m}if(i===p)break;let b=t[i];if(b==="."||b===".."||!this.options.dot&&b.startsWith("."))return!1;i++}return o||null}#w(t,e,s,i,r,o=t.length){let c,a,l,h;for(c=i,a=r,h=Math.min(o,t.length),l=e.length;c<h&&a<l;c++,a++){let f=e[a],u=t[c];if(f===!1||f===x||!C(f,u))return!1}if(c===h&&a===l)return!0;if(c===h)return s;if(a===l)return c===h-1&&t[c]==="";throw new Error("wtf?")}braceExpand(){return ft(this.pattern,this.options)}#C(){let{pattern:t}=this;if(this.options.nobrace)return this.braceExpand();let e=57344;for(;t.includes(String.fromCharCode(e));)if(++e>63743)return this.braceExpand();let s=String.fromCharCode(e),i=!1,r=t.replace(Fe,(c,a,l)=>{let h=Number(a),f=Number(l);return!Number.isSafeInteger(h)||!Number.isSafeInteger(f)||Math.abs(h-f)+1<Ie?c:(i=!0,`${s}${a}..${l}${s}`)});if(!i)return this.braceExpand();let o=ft(r,this.options);for(let c of o)for(let a of c.split("/")){let l=a.indexOf("[");if(l!==-1&&l<a.lastIndexOf(s))return this.braceExpand()}return this.#u=s,o}parse(t){F(t);let e=this.options;if(t==="**")return x;if(t==="")return"";let{nocase:s,nocaseMagicOnly:i,noext:r=!1,dot:o,normalize:c}=e,a=this.#u,l=a&&t.includes(a)?void 0:Le(t,r);if(l!==void 0&&!(s&&!i&&t.toUpperCase()!==t.toLowerCase()))return this.#h(l);if(this.#l)return ht;let h=this.#a.get(t);return h||(h=new I(t,{nocase:s,noext:r,dot:o,normalize:c,...a&&{rangeMark:a}}),this.#a.set(t,h)),h}#M(t){return this.preserveMultipleSlashes?t.split("/"):this.isWindows&&/^\/\/[^/]+/.test(t)?["",...t.split(/\/+/)]:t.split(/\/+/)}match(t,e=this.partial){if(this.comment)return!1;if(this.empty)return t==="";if(t==="/"&&e)return!0;let s=this.options,i=this.#x(t);if(!i){if(!e&&!this.#r&&(this.#t||this.#s)&&jt!==t){jt=t;let l=this.#g(t);if(l==="no")return s.flipNegate?!1:this.negate;if(l==="yes")return s.flipNegate?!0:!this.negate}i=this.#f(t)}let r=i.parts,o=this.#e?i.resolved??=this.#d(r):r,c=this.set,a=r[r.length-1];if(!a)for(let l=r.length-2;!a&&l>=0;l--)a=r[l];for(let l=0;l<c.length;l++){let h=c[l],f=e?void 0:this.#o[l];if(f==="base"?C(h[0],a):f?this.#m(o,h,f):s.matchBase&&h.length===1?this.#b([a],[a],h,e):this.#b(r,o,h,e))return s.flipNegate?!0:!this.negate}return s.flipNegate?!1:this.negate}static defaults(t){return S.defaults(t).Minimatch}};S.Minimatch=A;S.escape=it;S.unescape=ot;import L from"node:path";import De from"node:process";import Ge from"node:path";import Bt,{promises as _s}from"node:fs";import{fileURLToPath as We}from"node:url";var Yt={directory:"isDirectory",file:"isFile"};function Ue(n){if(!(n==="both"||Object.hasOwn(Yt,n)))throw new Error(`Invalid type specified: ${n}`)}var Be=(n,t)=>n==="both"?t.isFile()||t.isDirectory():t[Yt[n]](),Ye=n=>n instanceof URL?We(n):n;function pt(n,{cwd:t=De.cwd(),type:e="file",allowSymlinks:s=!0}={}){Ue(e),t=Ye(t);let i=s?Bt.statSync:Bt.lstatSync;for(let r of n)try{let o=i(Ge.resolve(t,r),{throwIfNoEntry:!1});if(!o)continue;if(Be(e,o))return r}catch{}}import{promisify as qe}from"node:util";import{execFile as Ve,execFileSync as Ls}from"node:child_process";import{fileURLToPath as Xe}from"node:url";var Ds=qe(Ve);function gt(n){return n instanceof URL?Xe(n):n}var Gs=10*1024*1024;var He=Symbol("findUpStop");function Ze(n,t={}){let e=L.resolve(gt(t.cwd)??""),{root:s}=L.parse(e),i=L.resolve(e,gt(t.stopAt)??s),r=t.limit??Number.POSITIVE_INFINITY,o=[n].flat(),c=l=>{if(typeof n!="function")return pt(o,l);let h=n(l.cwd);return typeof h=="string"?pt([h],l):h},a=[];for(;;){let l=c({...t,cwd:e});if(l===He||(l&&a.push(L.resolve(e,l)),e===i||a.length>=r))break;e=L.dirname(e)}return a}function Je(n,t={}){return Ze(n,{...t,limit:1})[0]}import mt from"node:process";import Ke from"node:os";import qt from"node:tty";function M(n,t=globalThis.Deno?globalThis.Deno.args:mt.argv){let e=n.startsWith("-")?"":n.length===1?"-":"--",s=t.indexOf(e+n),i=t.indexOf("--");return s!==-1&&(i===-1||s<i)}var{env:w}=mt,Y;M("no-color")||M("no-colors")||M("color=false")||M("color=never")?Y=0:(M("color")||M("colors")||M("color=true")||M("color=always"))&&(Y=1);function Qe(){if(!("FORCE_COLOR"in w))return;if(w.FORCE_COLOR==="true")return 1;if(w.FORCE_COLOR==="false")return 0;if(w.FORCE_COLOR.length===0)return 1;if(!/^\d+$/v.test(w.FORCE_COLOR))return;let n=Math.min(Number(w.FORCE_COLOR),3);if([0,1,2,3].includes(n))return n}function ts(n){return n===0?!1:{level:n,hasBasic:!0,has256:n>=2,has16m:n>=3}}function es(n,{streamIsTTY:t,sniffFlags:e=!0}={}){let s=Qe();s!==void 0&&(Y=s);let i=e?Y:s;if(i===0)return 0;if(e){if(M("color=16m")||M("color=full")||M("color=truecolor"))return 3;if(M("color=256"))return 2}if(i!==void 0&&/^\d+$/v.test(w.FORCE_COLOR))return i;if("TF_BUILD"in w&&"AGENT_NAME"in w)return 1;if(n&&!t&&i===void 0)return 0;let r=i||0;if(w.TERM==="dumb")return r;if(mt.platform==="win32"){let o=Ke.release().split(".");return Number(o[0])>=10&&Number(o[2])>=10586?Number(o[2])>=14931?3:2:1}if("CI"in w)return["GITHUB_ACTIONS","GITEA_ACTIONS","CIRCLECI"].some(o=>Object.hasOwn(w,o))?3:["TRAVIS","APPVEYOR","GITLAB_CI","BUILDKITE","DRONE"].some(o=>Object.hasOwn(w,o))||w.CI_NAME==="codeship"?1:r;if("TEAMCITY_VERSION"in w)return/^(?:9\.0*[1-9]\d*\.|\d{2,}\.)/v.test(w.TEAMCITY_VERSION)?1:0;if(w.COLORTERM==="truecolor"||w.TERM==="xterm-kitty"||w.TERM==="xterm-ghostty"||w.TERM==="wezterm")return 3;if("TERM_PROGRAM"in w){let o=Number((w.TERM_PROGRAM_VERSION||"").split(".",1)[0]);switch(w.TERM_PROGRAM){case"iTerm.app":return o>=3?3:2;case"Apple_Terminal":return 2}}return/-256(?:color)?$/iv.test(w.TERM)?2:/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/iv.test(w.TERM)||"COLORTERM"in w?1:r}function Vt(n,t={}){let e=es(n,{streamIsTTY:n&&n.isTTY,...t});return ts(e)}var ss={stdout:Vt({isTTY:qt.isatty(1)}),stderr:Vt({isTTY:qt.isatty(2)})},ns=ss;export{A as Minimatch,Je as findUpSync,S as minimatch,ns as supportsColor};
|
|
@@ -4,19 +4,79 @@ THIRD-PARTY SOFTWARE NOTICES AND INFORMATION
|
|
|
4
4
|
|
|
5
5
|
The following inlined npm packages have license or notice files included below.
|
|
6
6
|
|
|
7
|
+
- @isaacs/nonrecursive-glob-match@1.1.0
|
|
7
8
|
- balanced-match@4.0.4 (https://github.com/juliangruber/balanced-match)
|
|
8
|
-
- brace-expansion@5.0.
|
|
9
|
+
- brace-expansion@5.0.12 (https://github.com/juliangruber/brace-expansion)
|
|
9
10
|
- diff-sequences@29.6.3 (https://github.com/jestjs/jest)
|
|
10
11
|
- find-up@8.0.0 (https://github.com/sindresorhus/find-up)
|
|
11
12
|
- locate-path@8.0.0 (https://github.com/sindresorhus/locate-path)
|
|
12
|
-
- minimatch@
|
|
13
|
+
- minimatch@11.0.5 (https://github.com/isaacs/minimatch)
|
|
13
14
|
- nanoid@3.3.20 (https://github.com/ai/nanoid)
|
|
14
15
|
- picocolors@1.1.1 (https://github.com/alexeyraspopov/picocolors)
|
|
15
|
-
- postcss@8.5.
|
|
16
|
+
- postcss@8.5.32 (https://github.com/postcss/postcss)
|
|
16
17
|
- source-map-js@1.2.2 (https://github.com/7rulnik/source-map-js)
|
|
17
18
|
- supports-color@11.0.0 (https://github.com/chalk/supports-color)
|
|
18
19
|
- unicorn-magic@0.3.0 (https://github.com/sindresorhus/unicorn-magic)
|
|
19
20
|
|
|
21
|
+
%% @isaacs/nonrecursive-glob-match@1.1.0 NOTICES AND INFORMATION BEGIN HERE
|
|
22
|
+
=========================================
|
|
23
|
+
# Blue Oak Model License
|
|
24
|
+
|
|
25
|
+
Version 1.0.0
|
|
26
|
+
|
|
27
|
+
## Purpose
|
|
28
|
+
|
|
29
|
+
This license gives everyone as much permission to work with
|
|
30
|
+
this software as possible, while protecting contributors
|
|
31
|
+
from liability.
|
|
32
|
+
|
|
33
|
+
## Acceptance
|
|
34
|
+
|
|
35
|
+
In order to receive this license, you must agree to its
|
|
36
|
+
rules. The rules of this license are both obligations
|
|
37
|
+
under that agreement and conditions to your license.
|
|
38
|
+
You must not do anything with this software that triggers
|
|
39
|
+
a rule that you cannot or will not follow.
|
|
40
|
+
|
|
41
|
+
## Copyright
|
|
42
|
+
|
|
43
|
+
Each contributor licenses you to do everything with this
|
|
44
|
+
software that would otherwise infringe that contributor's
|
|
45
|
+
copyright in it.
|
|
46
|
+
|
|
47
|
+
## Notices
|
|
48
|
+
|
|
49
|
+
You must ensure that everyone who gets a copy of
|
|
50
|
+
any part of this software from you, with or without
|
|
51
|
+
changes, also gets the text of this license or a link to
|
|
52
|
+
<https://blueoakcouncil.org/license/1.0.0>.
|
|
53
|
+
|
|
54
|
+
## Excuse
|
|
55
|
+
|
|
56
|
+
If anyone notifies you in writing that you have not
|
|
57
|
+
complied with [Notices](#notices), you can keep your
|
|
58
|
+
license by taking all practical steps to comply within 30
|
|
59
|
+
days after the notice. If you do not do so, your license
|
|
60
|
+
ends immediately.
|
|
61
|
+
|
|
62
|
+
## Patent
|
|
63
|
+
|
|
64
|
+
Each contributor licenses you to do everything with this
|
|
65
|
+
software that would otherwise infringe any patent claims
|
|
66
|
+
they can license or become able to license.
|
|
67
|
+
|
|
68
|
+
## Reliability
|
|
69
|
+
|
|
70
|
+
No contributor can revoke this license.
|
|
71
|
+
|
|
72
|
+
## No Liability
|
|
73
|
+
|
|
74
|
+
***As far as the law allows, this software comes as is,
|
|
75
|
+
without any warranty or condition, and no contributor
|
|
76
|
+
will be liable to anyone for any damages related to this
|
|
77
|
+
software or this license, under any kind of legal claim.***
|
|
78
|
+
=========================================
|
|
79
|
+
END OF @isaacs/nonrecursive-glob-match@1.1.0 NOTICES AND INFORMATION
|
|
20
80
|
%% balanced-match@4.0.4 NOTICES AND INFORMATION BEGIN HERE
|
|
21
81
|
=========================================
|
|
22
82
|
(MIT)
|
|
@@ -44,7 +104,7 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
|
44
104
|
SOFTWARE.
|
|
45
105
|
=========================================
|
|
46
106
|
END OF balanced-match@4.0.4 NOTICES AND INFORMATION
|
|
47
|
-
%% brace-expansion@5.0.
|
|
107
|
+
%% brace-expansion@5.0.12 NOTICES AND INFORMATION BEGIN HERE
|
|
48
108
|
=========================================
|
|
49
109
|
MIT License
|
|
50
110
|
|
|
@@ -70,7 +130,7 @@ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
|
70
130
|
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
71
131
|
SOFTWARE.
|
|
72
132
|
=========================================
|
|
73
|
-
END OF brace-expansion@5.0.
|
|
133
|
+
END OF brace-expansion@5.0.12 NOTICES AND INFORMATION
|
|
74
134
|
%% diff-sequences@29.6.3 NOTICES AND INFORMATION BEGIN HERE
|
|
75
135
|
=========================================
|
|
76
136
|
MIT License
|
|
@@ -122,7 +182,7 @@ The above copyright notice and this permission notice shall be included in all c
|
|
|
122
182
|
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|
123
183
|
=========================================
|
|
124
184
|
END OF locate-path@8.0.0 NOTICES AND INFORMATION
|
|
125
|
-
%% minimatch@
|
|
185
|
+
%% minimatch@11.0.5 NOTICES AND INFORMATION BEGIN HERE
|
|
126
186
|
=========================================
|
|
127
187
|
# Blue Oak Model License
|
|
128
188
|
|
|
@@ -180,7 +240,7 @@ without any warranty or condition, and no contributor
|
|
|
180
240
|
will be liable to anyone for any damages related to this
|
|
181
241
|
software or this license, under any kind of legal claim._**
|
|
182
242
|
=========================================
|
|
183
|
-
END OF minimatch@
|
|
243
|
+
END OF minimatch@11.0.5 NOTICES AND INFORMATION
|
|
184
244
|
%% nanoid@3.3.20 NOTICES AND INFORMATION BEGIN HERE
|
|
185
245
|
=========================================
|
|
186
246
|
The MIT License (MIT)
|
|
@@ -224,7 +284,7 @@ ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
|
|
|
224
284
|
OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
|
225
285
|
=========================================
|
|
226
286
|
END OF picocolors@1.1.1 NOTICES AND INFORMATION
|
|
227
|
-
%% postcss@8.5.
|
|
287
|
+
%% postcss@8.5.32 NOTICES AND INFORMATION BEGIN HERE
|
|
228
288
|
=========================================
|
|
229
289
|
The MIT License (MIT)
|
|
230
290
|
|
|
@@ -247,7 +307,7 @@ COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
|
|
|
247
307
|
IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
|
|
248
308
|
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|
249
309
|
=========================================
|
|
250
|
-
END OF postcss@8.5.
|
|
310
|
+
END OF postcss@8.5.32 NOTICES AND INFORMATION
|
|
251
311
|
%% source-map-js@1.2.2 NOTICES AND INFORMATION BEGIN HERE
|
|
252
312
|
=========================================
|
|
253
313
|
Copyright (c) 2009-2011, Mozilla Foundation and contributors
|
|
@@ -0,0 +1,191 @@
|
|
|
1
|
+
import fs from 'node:fs';
|
|
2
|
+
import { Transform } from 'node:stream';
|
|
3
|
+
|
|
4
|
+
const reporterOptions = new URL(import.meta.url).searchParams;
|
|
5
|
+
|
|
6
|
+
const getStatus = (type, data) => {
|
|
7
|
+
// Node also accepts an empty string as a skip/todo reason.
|
|
8
|
+
if (data.skip === true || typeof data.skip === 'string') {
|
|
9
|
+
return 'skipped';
|
|
10
|
+
}
|
|
11
|
+
if (data.todo === true || typeof data.todo === 'string') {
|
|
12
|
+
return 'todo';
|
|
13
|
+
}
|
|
14
|
+
const failureType = data.details.error?.failureType;
|
|
15
|
+
if (['cancelledByParent', 'testTimeoutFailure', 'testAborted'].includes(failureType)) {
|
|
16
|
+
return 'cancelled';
|
|
17
|
+
}
|
|
18
|
+
return type === 'test:pass' ? 'passed' : 'failed';
|
|
19
|
+
};
|
|
20
|
+
|
|
21
|
+
const reservedErrorKeys = new Set(['name', 'message', '__proto__', 'constructor', 'prototype']);
|
|
22
|
+
|
|
23
|
+
const getErrorString = (error, key, fallback) => {
|
|
24
|
+
// Standard Error names are usually inherited. Resolve only these fixed
|
|
25
|
+
// fields through descriptors, without invoking accessors or coercion hooks.
|
|
26
|
+
for (let current = error; current; current = Object.getPrototypeOf(current)) {
|
|
27
|
+
const descriptor = Object.getOwnPropertyDescriptor(current, key);
|
|
28
|
+
if (descriptor) {
|
|
29
|
+
return typeof descriptor.value === 'string' ? descriptor.value : fallback;
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
return fallback;
|
|
33
|
+
};
|
|
34
|
+
|
|
35
|
+
const getErrorPrimitive = (value) => {
|
|
36
|
+
if (value === null) {
|
|
37
|
+
return null;
|
|
38
|
+
}
|
|
39
|
+
switch (typeof value) {
|
|
40
|
+
case 'string':
|
|
41
|
+
case 'boolean':
|
|
42
|
+
return value;
|
|
43
|
+
case 'number':
|
|
44
|
+
if (Number.isFinite(value)) {
|
|
45
|
+
return value;
|
|
46
|
+
}
|
|
47
|
+
return;
|
|
48
|
+
case 'bigint':
|
|
49
|
+
return String(value);
|
|
50
|
+
default:
|
|
51
|
+
break;
|
|
52
|
+
}
|
|
53
|
+
};
|
|
54
|
+
|
|
55
|
+
const getError = (error) => {
|
|
56
|
+
if (!error) {
|
|
57
|
+
return;
|
|
58
|
+
}
|
|
59
|
+
const result = {
|
|
60
|
+
name: getErrorString(error, 'name', 'Error'),
|
|
61
|
+
message: getErrorString(error, 'message', '')
|
|
62
|
+
};
|
|
63
|
+
// Copy only own enumerable data properties, never getters or object graphs.
|
|
64
|
+
// Primitive fields may still contain secrets or large strings; redact them
|
|
65
|
+
// in onTestEnd before raw/debug export when appropriate.
|
|
66
|
+
for (const key of Object.keys(error)) {
|
|
67
|
+
if (reservedErrorKeys.has(key)) {
|
|
68
|
+
continue;
|
|
69
|
+
}
|
|
70
|
+
const descriptor = Object.getOwnPropertyDescriptor(error, key);
|
|
71
|
+
if (!descriptor?.enumerable || !Object.hasOwn(descriptor, 'value')) {
|
|
72
|
+
continue;
|
|
73
|
+
}
|
|
74
|
+
const value = getErrorPrimitive(descriptor.value);
|
|
75
|
+
if (typeof value !== 'undefined') {
|
|
76
|
+
result[key] = value;
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
return result;
|
|
80
|
+
};
|
|
81
|
+
|
|
82
|
+
const getTestResult = (type, data) => ({
|
|
83
|
+
name: data.name,
|
|
84
|
+
type: data.details.type || 'test',
|
|
85
|
+
nesting: data.nesting,
|
|
86
|
+
testNumber: data.testNumber,
|
|
87
|
+
file: data.file,
|
|
88
|
+
line: data.line,
|
|
89
|
+
column: data.column,
|
|
90
|
+
duration: data.details.duration_ms,
|
|
91
|
+
status: getStatus(type, data),
|
|
92
|
+
skip: data.skip,
|
|
93
|
+
todo: data.todo,
|
|
94
|
+
error: getError(data.details.error)
|
|
95
|
+
});
|
|
96
|
+
|
|
97
|
+
const getSummary = (data) => ({
|
|
98
|
+
tests: data.counts.tests,
|
|
99
|
+
suites: data.counts.suites,
|
|
100
|
+
passed: data.counts.passed,
|
|
101
|
+
failed: data.counts.failed,
|
|
102
|
+
cancelled: data.counts.cancelled,
|
|
103
|
+
skipped: data.counts.skipped,
|
|
104
|
+
todo: data.counts.todo,
|
|
105
|
+
duration: data.duration_ms,
|
|
106
|
+
success: data.success
|
|
107
|
+
});
|
|
108
|
+
|
|
109
|
+
// Node instantiates this stream without arguments. Per-collector options are
|
|
110
|
+
// passed through its module URL, not process.env, so collectors stay isolated.
|
|
111
|
+
export default class TestReporter extends Transform {
|
|
112
|
+
constructor(id = reporterOptions.get('id'), metadataPath = reporterOptions.get('meta')) {
|
|
113
|
+
super({
|
|
114
|
+
writableObjectMode: true
|
|
115
|
+
});
|
|
116
|
+
this.id = id;
|
|
117
|
+
this.metadataPath = metadataPath;
|
|
118
|
+
this.complete = false;
|
|
119
|
+
this.summary = null;
|
|
120
|
+
this.recordCount = 0;
|
|
121
|
+
this.pending = [];
|
|
122
|
+
this.pendingBytes = 0;
|
|
123
|
+
const header = `${JSON.stringify({
|
|
124
|
+
id, framework: 'node:test'
|
|
125
|
+
}).slice(0, -1)},"tests":[`;
|
|
126
|
+
this.byteLength = Buffer.byteLength(header);
|
|
127
|
+
this.push(header);
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
_transform(event, _encoding, callback) {
|
|
131
|
+
let chunk;
|
|
132
|
+
try {
|
|
133
|
+
const { type, data } = event;
|
|
134
|
+
if (type === 'test:summary' && !data.file) {
|
|
135
|
+
this.complete = true;
|
|
136
|
+
this.summary = getSummary(data);
|
|
137
|
+
} else if (type === 'test:pass' || type === 'test:fail') {
|
|
138
|
+
chunk = this.addRecord(getTestResult(type, data));
|
|
139
|
+
}
|
|
140
|
+
} catch (error) {
|
|
141
|
+
callback(error);
|
|
142
|
+
return;
|
|
143
|
+
}
|
|
144
|
+
callback(null, chunk);
|
|
145
|
+
}
|
|
146
|
+
|
|
147
|
+
addRecord(data) {
|
|
148
|
+
const record = `${this.recordCount ? ',' : ''}${JSON.stringify(data)}`;
|
|
149
|
+
const byteLength = Buffer.byteLength(record);
|
|
150
|
+
this.recordCount += 1;
|
|
151
|
+
this.byteLength += byteLength;
|
|
152
|
+
this.pending.push(record);
|
|
153
|
+
this.pendingBytes += byteLength;
|
|
154
|
+
// Bound memory while avoiding a separate filesystem write for every
|
|
155
|
+
// small record. Emit the first record without delay.
|
|
156
|
+
if (this.recordCount === 1 || this.pendingBytes >= 64 * 1024) {
|
|
157
|
+
return this.takePending();
|
|
158
|
+
}
|
|
159
|
+
}
|
|
160
|
+
|
|
161
|
+
takePending() {
|
|
162
|
+
const chunk = this.pending.join('');
|
|
163
|
+
this.pending = [];
|
|
164
|
+
this.pendingBytes = 0;
|
|
165
|
+
return chunk;
|
|
166
|
+
}
|
|
167
|
+
|
|
168
|
+
_flush(callback) {
|
|
169
|
+
let chunk;
|
|
170
|
+
try {
|
|
171
|
+
const { complete, summary } = this;
|
|
172
|
+
chunk = `],${JSON.stringify({
|
|
173
|
+
complete, summary
|
|
174
|
+
}).slice(1)}`;
|
|
175
|
+
this.byteLength += Buffer.byteLength(chunk);
|
|
176
|
+
chunk = this.takePending() + chunk;
|
|
177
|
+
if (this.metadataPath) {
|
|
178
|
+
// The parent checks this small completion record and the final
|
|
179
|
+
// byte count after child exit; no full JSON read is needed
|
|
180
|
+
// unless onTestEnd requests the complete result object.
|
|
181
|
+
fs.writeFileSync(this.metadataPath, JSON.stringify({
|
|
182
|
+
id: this.id, complete, byteLength: this.byteLength
|
|
183
|
+
}));
|
|
184
|
+
}
|
|
185
|
+
} catch (error) {
|
|
186
|
+
callback(error);
|
|
187
|
+
return;
|
|
188
|
+
}
|
|
189
|
+
callback(null, chunk);
|
|
190
|
+
}
|
|
191
|
+
}
|
|
@@ -0,0 +1,104 @@
|
|
|
1
|
+
import fs from 'node:fs';
|
|
2
|
+
import { Util } from '../utils/util.js';
|
|
3
|
+
|
|
4
|
+
// Only tokenize NODE_OPTIONS to count option names, keeping quoted values
|
|
5
|
+
// together. The original options and values are passed to Node untouched.
|
|
6
|
+
const splitNodeOptions = (value) => {
|
|
7
|
+
const tokens = value.match(/(?:[^\s"]|"(?:\\.|[^"\\])*")+/g) || [];
|
|
8
|
+
return tokens.map((token) => token.replaceAll('"', ''));
|
|
9
|
+
};
|
|
10
|
+
|
|
11
|
+
const getRunnerOptions = (args) => {
|
|
12
|
+
const index = args.indexOf('--');
|
|
13
|
+
return index === -1 ? args : args.slice(0, index);
|
|
14
|
+
};
|
|
15
|
+
|
|
16
|
+
// Node treats underscores and hyphens as equivalent in option names. Inspect
|
|
17
|
+
// only names here; the original arguments and their values remain untouched.
|
|
18
|
+
const countOption = (args, name) => args.filter((arg) => arg.split('=', 1)[0].replaceAll('_', '-') === name).length;
|
|
19
|
+
|
|
20
|
+
const getReporterArgs = (args) => {
|
|
21
|
+
const reporters = countOption(args, '--test-reporter');
|
|
22
|
+
const destinations = countOption(args, '--test-reporter-destination');
|
|
23
|
+
// Preserve Node's validation instead of accidentally fixing an invalid pair.
|
|
24
|
+
if ((reporters > 1 || destinations > 0) && reporters !== destinations) {
|
|
25
|
+
throw new Error('The number of --test-reporter options must match --test-reporter-destination options');
|
|
26
|
+
}
|
|
27
|
+
const extraArgs = [];
|
|
28
|
+
if (!reporters) {
|
|
29
|
+
// Node 22 defaults to TAP when stdout is not a TTY; Node 23+ uses spec.
|
|
30
|
+
const reporter = Number(process.versions.node.split('.')[0]) < 23 && !process.stdout.isTTY ? 'tap' : 'spec';
|
|
31
|
+
extraArgs.push(`--test-reporter=${reporter}`);
|
|
32
|
+
}
|
|
33
|
+
if (!destinations) {
|
|
34
|
+
extraArgs.push('--test-reporter-destination=stdout');
|
|
35
|
+
}
|
|
36
|
+
return extraArgs;
|
|
37
|
+
};
|
|
38
|
+
|
|
39
|
+
const readMetadata = (metadataPath, resultsPath, id) => {
|
|
40
|
+
// This is an internal completion record, not an external report input.
|
|
41
|
+
// Keep the no-hook path bounded even if an interrupted file is malformed.
|
|
42
|
+
if (fs.statSync(metadataPath).size > 1024) {
|
|
43
|
+
throw new Error('Invalid Node test report metadata');
|
|
44
|
+
}
|
|
45
|
+
const metadata = JSON.parse(fs.readFileSync(metadataPath, 'utf8'));
|
|
46
|
+
if (metadata?.id !== id || typeof metadata.complete !== 'boolean' || !Number.isSafeInteger(metadata.byteLength) || metadata.byteLength <= 0) {
|
|
47
|
+
throw new Error('Invalid Node test report metadata');
|
|
48
|
+
}
|
|
49
|
+
if (metadata.byteLength !== fs.statSync(resultsPath).size) {
|
|
50
|
+
throw new Error('Incomplete Node test report output');
|
|
51
|
+
}
|
|
52
|
+
return metadata;
|
|
53
|
+
};
|
|
54
|
+
|
|
55
|
+
const validateResults = (results, id) => {
|
|
56
|
+
if (results?.id !== id || results.framework !== 'node:test' || typeof results.complete !== 'boolean' || !Array.isArray(results.tests)) {
|
|
57
|
+
throw new Error('Invalid Node test report');
|
|
58
|
+
}
|
|
59
|
+
};
|
|
60
|
+
|
|
61
|
+
const createTestResultsCollector = (runnerArgs, cacheDir) => {
|
|
62
|
+
const args = [... splitNodeOptions(process.env.NODE_OPTIONS || ''), ... getRunnerOptions(runnerArgs)];
|
|
63
|
+
const extraArgs = getReporterArgs(args);
|
|
64
|
+
fs.mkdirSync(cacheDir, {
|
|
65
|
+
recursive: true
|
|
66
|
+
});
|
|
67
|
+
const id = Util.uid();
|
|
68
|
+
const { cachePath } = Util.getCacheFileInfo('test-results', id, cacheDir);
|
|
69
|
+
const resultsPath = `${cachePath}.tmp`;
|
|
70
|
+
const metadataPath = `${cachePath}.meta.tmp`;
|
|
71
|
+
const reporterURL = new URL('./test-reporter.js', import.meta.url);
|
|
72
|
+
reporterURL.searchParams.set('id', id);
|
|
73
|
+
reporterURL.searchParams.set('meta', metadataPath);
|
|
74
|
+
extraArgs.push(`--test-reporter=${reporterURL.href}`, `--test-reporter-destination=${resultsPath}`);
|
|
75
|
+
return {
|
|
76
|
+
args: extraArgs,
|
|
77
|
+
readMetadata: () => readMetadata(metadataPath, resultsPath, id),
|
|
78
|
+
read: () => {
|
|
79
|
+
const results = JSON.parse(fs.readFileSync(resultsPath, 'utf8'));
|
|
80
|
+
validateResults(results, id);
|
|
81
|
+
return results;
|
|
82
|
+
},
|
|
83
|
+
publish: (results) => {
|
|
84
|
+
readMetadata(metadataPath, resultsPath, id);
|
|
85
|
+
if (results) {
|
|
86
|
+
validateResults(results, id);
|
|
87
|
+
// onTestEnd can redact messages/names before raw/debug export.
|
|
88
|
+
// Only configured hooks require a full read and rewrite.
|
|
89
|
+
fs.writeFileSync(resultsPath, JSON.stringify(results));
|
|
90
|
+
}
|
|
91
|
+
fs.renameSync(resultsPath, cachePath);
|
|
92
|
+
},
|
|
93
|
+
dispose: () => {
|
|
94
|
+
fs.rmSync(resultsPath, {
|
|
95
|
+
force: true
|
|
96
|
+
});
|
|
97
|
+
fs.rmSync(metadataPath, {
|
|
98
|
+
force: true
|
|
99
|
+
});
|
|
100
|
+
}
|
|
101
|
+
};
|
|
102
|
+
};
|
|
103
|
+
|
|
104
|
+
export { createTestResultsCollector, getRunnerOptions };
|