@socketsecurity/lib 3.2.6 → 3.2.8
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/CHANGELOG.md +24 -1
- package/dist/constants/node.js +1 -1
- package/dist/constants/packages.js +4 -4
- package/dist/external/@inquirer/confirm.js +3199 -18
- package/dist/external/@inquirer/input.js +3223 -18
- package/dist/external/@inquirer/password.js +3331 -18
- package/dist/external/@inquirer/search.js +3328 -21
- package/dist/external/@inquirer/select.js +3445 -21
- package/dist/external/@npmcli/package-json/lib/read-package.js +149 -2
- package/dist/external/@npmcli/package-json/lib/sort.js +96 -1
- package/dist/external/@npmcli/package-json.js +16758 -13
- package/dist/external/@npmcli/promise-spawn.js +480 -1
- package/dist/external/@socketregistry/is-unicode-supported.js +42 -1
- package/dist/external/@socketregistry/packageurl-js.js +6493 -2
- package/dist/external/@socketregistry/yocto-spinner.js +460 -4
- package/dist/external/@yarnpkg/extensions.js +1025 -1
- package/dist/external/cacache.js +13016 -12
- package/dist/external/debug.js +27 -1
- package/dist/external/del.js +7088 -2
- package/dist/external/fast-glob.js +5721 -2
- package/dist/external/fast-sort.js +140 -1
- package/dist/external/get-east-asian-width.js +90 -1
- package/dist/external/libnpmexec.js +33 -1
- package/dist/external/libnpmpack.js +67595 -129
- package/dist/external/make-fetch-happen.js +22595 -21
- package/dist/external/normalize-package-data.js +4474 -2
- package/dist/external/npm-package-arg.js +4511 -2
- package/dist/external/pacote.js +50270 -57
- package/dist/external/picomatch.js +1520 -1
- package/dist/external/semver.js +1930 -1
- package/dist/external/spdx-correct.js +1380 -1
- package/dist/external/spdx-expression-parse.js +1043 -1
- package/dist/external/streaming-iterables.js +1056 -1
- package/dist/external/validate-npm-package-name.js +100 -1
- package/dist/external/which.js +258 -1
- package/dist/external/yargs-parser.js +1075 -1
- package/dist/external/yoctocolors-cjs.js +88 -1
- package/dist/external/zod.js +15207 -13
- package/dist/lifecycle-script-names.js +3 -4
- package/dist/maintained-node-versions.js +3 -4
- package/dist/package-default-node-range.js +4 -5
- package/dist/package-default-socket-categories.js +3 -4
- package/dist/package-extensions.js +3 -4
- package/dist/utils/get-ipc.js +3 -5
- package/package.json +1 -1
|
@@ -3,4 +3,1523 @@
|
|
|
3
3
|
* Bundled from picomatch
|
|
4
4
|
* This is a zero-dependency bundle created by esbuild.
|
|
5
5
|
*/
|
|
6
|
-
"use strict";var Xt=Object.defineProperty;var _=(t,a)=>Xt(t,"name",{value:a,configurable:!0});var J=(t,a)=>()=>(a||t((a={exports:{}}).exports,a),a.exports);var et=J((de,Ht)=>{"use strict";var Ft=require("path"),Q="\\\\/",St=`[^${Q}]`,Z="\\.",Wt="\\+",Qt="\\?",at="\\/",Zt="(?=.)",$t="[^/]",ft=`(?:${at}|$)`,yt=`(?:^|${at})`,At=`${Z}{1,2}${ft}`,jt=`(?!${Z})`,Vt=`(?!${yt}${At})`,Yt=`(?!${Z}{0,1}${ft})`,zt=`(?!${At})`,Jt=`[^.${at}]`,te=`${$t}*?`,dt={DOT_LITERAL:Z,PLUS_LITERAL:Wt,QMARK_LITERAL:Qt,SLASH_LITERAL:at,ONE_CHAR:Zt,QMARK:$t,END_ANCHOR:ft,DOTS_SLASH:At,NO_DOT:jt,NO_DOTS:Vt,NO_DOT_SLASH:Yt,NO_DOTS_SLASH:zt,QMARK_NO_DOT:Jt,STAR:te,START_ANCHOR:yt},ee={...dt,SLASH_LITERAL:`[${Q}]`,QMARK:St,STAR:`${St}*?`,DOTS_SLASH:`${Z}{1,2}(?:[${Q}]|$)`,NO_DOT:`(?!${Z})`,NO_DOTS:`(?!(?:^|[${Q}])${Z}{1,2}(?:[${Q}]|$))`,NO_DOT_SLASH:`(?!${Z}{0,1}(?:[${Q}]|$))`,NO_DOTS_SLASH:`(?!${Z}{1,2}(?:[${Q}]|$))`,QMARK_NO_DOT:`[^.${Q}]`,START_ANCHOR:`(?:^|[${Q}])`,END_ANCHOR:`(?:[${Q}]|$)`},se={alnum:"a-zA-Z0-9",alpha:"a-zA-Z",ascii:"\\x00-\\x7F",blank:" \\t",cntrl:"\\x00-\\x1F\\x7F",digit:"0-9",graph:"\\x21-\\x7E",lower:"a-z",print:"\\x20-\\x7E ",punct:"\\-!\"#$%&'()\\*+,./:;<=>?@[\\]^_`{|}~",space:" \\t\\r\\n\\v\\f",upper:"A-Z",word:"A-Za-z0-9_",xdigit:"A-Fa-f0-9"};Ht.exports={MAX_LENGTH:1024*64,POSIX_REGEX_SOURCE:se,REGEX_BACKSLASH:/\\(?![*+?^${}(|)[\]])/g,REGEX_NON_SPECIAL_CHARS:/^[^@![\].,$*+?^{}()|\\/]+/,REGEX_SPECIAL_CHARS:/[-*+?.^${}(|)[\]]/,REGEX_SPECIAL_CHARS_BACKREF:/(\\?)((\W)(\3*))/g,REGEX_SPECIAL_CHARS_GLOBAL:/([-*+?.^${}(|)[\]])/g,REGEX_REMOVE_BACKSLASH:/(?:\[.*?[^\\]\]|\\(?=.))/g,REPLACEMENTS:{"***":"*","**/**":"**","**/**/**":"**"},CHAR_0:48,CHAR_9:57,CHAR_UPPERCASE_A:65,CHAR_LOWERCASE_A:97,CHAR_UPPERCASE_Z:90,CHAR_LOWERCASE_Z:122,CHAR_LEFT_PARENTHESES:40,CHAR_RIGHT_PARENTHESES:41,CHAR_ASTERISK:42,CHAR_AMPERSAND:38,CHAR_AT:64,CHAR_BACKWARD_SLASH:92,CHAR_CARRIAGE_RETURN:13,CHAR_CIRCUMFLEX_ACCENT:94,CHAR_COLON:58,CHAR_COMMA:44,CHAR_DOT:46,CHAR_DOUBLE_QUOTE:34,CHAR_EQUAL:61,CHAR_EXCLAMATION_MARK:33,CHAR_FORM_FEED:12,CHAR_FORWARD_SLASH:47,CHAR_GRAVE_ACCENT:96,CHAR_HASH:35,CHAR_HYPHEN_MINUS:45,CHAR_LEFT_ANGLE_BRACKET:60,CHAR_LEFT_CURLY_BRACE:123,CHAR_LEFT_SQUARE_BRACKET:91,CHAR_LINE_FEED:10,CHAR_NO_BREAK_SPACE:160,CHAR_PERCENT:37,CHAR_PLUS:43,CHAR_QUESTION_MARK:63,CHAR_RIGHT_ANGLE_BRACKET:62,CHAR_RIGHT_CURLY_BRACE:125,CHAR_RIGHT_SQUARE_BRACKET:93,CHAR_SEMICOLON:59,CHAR_SINGLE_QUOTE:39,CHAR_SPACE:32,CHAR_TAB:9,CHAR_UNDERSCORE:95,CHAR_VERTICAL_LINE:124,CHAR_ZERO_WIDTH_NOBREAK_SPACE:65279,SEP:Ft.sep,extglobChars(t){return{"!":{type:"negate",open:"(?:(?!(?:",close:`))${t.STAR})`},"?":{type:"qmark",open:"(?:",close:")?"},"+":{type:"plus",open:"(?:",close:")+"},"*":{type:"star",open:"(?:",close:")*"},"@":{type:"at",open:"(?:",close:")"}}},globChars(t){return t===!0?ee:dt}}});var ct=J(M=>{"use strict";var re=require("path"),ue=process.platform==="win32",{REGEX_BACKSLASH:ne,REGEX_REMOVE_BACKSLASH:oe,REGEX_SPECIAL_CHARS:ae,REGEX_SPECIAL_CHARS_GLOBAL:ce}=et();M.isObject=t=>t!==null&&typeof t=="object"&&!Array.isArray(t);M.hasRegexChars=t=>ae.test(t);M.isRegexChar=t=>t.length===1&&M.hasRegexChars(t);M.escapeRegex=t=>t.replace(ce,"\\$1");M.toPosixSlashes=t=>t.replace(ne,"/");M.removeBackslashes=t=>t.replace(oe,a=>a==="\\"?"":a);M.supportsLookbehinds=()=>{let t=process.version.slice(1).split(".").map(Number);return t.length===3&&t[0]>=9||t[0]===8&&t[1]>=10};M.isWindows=t=>t&&typeof t.windows=="boolean"?t.windows:ue===!0||re.sep==="\\";M.escapeLast=(t,a,e)=>{let E=t.lastIndexOf(a,e);return E===-1?t:t[E-1]==="\\"?M.escapeLast(t,a,E-1):`${t.slice(0,E)}\\${t.slice(E)}`};M.removePrefix=(t,a={})=>{let e=t;return e.startsWith("./")&&(e=e.slice(2),a.prefix="./"),e};M.wrapOutput=(t,a={},e={})=>{let E=e.contains?"":"^",i=e.contains?"":"$",g=`${E}(?:${t})${i}`;return a.negated===!0&&(g=`(?:^(?!${g}).*$)`),g}});var wt=J((Le,kt)=>{"use strict";var Lt=ct(),{CHAR_ASTERISK:Rt,CHAR_AT:ie,CHAR_BACKWARD_SLASH:st,CHAR_COMMA:le,CHAR_DOT:_t,CHAR_EXCLAMATION_MARK:ht,CHAR_FORWARD_SLASH:Nt,CHAR_LEFT_CURLY_BRACE:Et,CHAR_LEFT_PARENTHESES:xt,CHAR_LEFT_SQUARE_BRACKET:pe,CHAR_PLUS:fe,CHAR_QUESTION_MARK:Tt,CHAR_RIGHT_CURLY_BRACE:Ae,CHAR_RIGHT_PARENTHESES:Ot,CHAR_RIGHT_SQUARE_BRACKET:Re}=et(),vt=_(t=>t===Nt||t===st,"isPathSeparator"),mt=_(t=>{t.isPrefix!==!0&&(t.depth=t.isGlobstar?1/0:1)},"depth"),_e=_((t,a)=>{let e=a||{},E=t.length-1,i=e.parts===!0||e.scanToEnd===!0,g=[],l=[],x=[],A=t,m=-1,b=0,v=0,k=!1,I=!1,C=!1,H=!1,j=!1,q=!1,U=!1,L=!1,X=!1,w=!1,V=0,B,c,h={value:"",depth:0,isGlob:!1},N=_(()=>m>=E,"eos"),u=_(()=>A.charCodeAt(m+1),"peek"),y=_(()=>(B=c,A.charCodeAt(++m)),"advance");for(;m<E;){c=y();let G;if(c===st){U=h.backslashes=!0,c=y(),c===Et&&(q=!0);continue}if(q===!0||c===Et){for(V++;N()!==!0&&(c=y());){if(c===st){U=h.backslashes=!0,y();continue}if(c===Et){V++;continue}if(q!==!0&&c===_t&&(c=y())===_t){if(k=h.isBrace=!0,C=h.isGlob=!0,w=!0,i===!0)continue;break}if(q!==!0&&c===le){if(k=h.isBrace=!0,C=h.isGlob=!0,w=!0,i===!0)continue;break}if(c===Ae&&(V--,V===0)){q=!1,k=h.isBrace=!0,w=!0;break}}if(i===!0)continue;break}if(c===Nt){if(g.push(m),l.push(h),h={value:"",depth:0,isGlob:!1},w===!0)continue;if(B===_t&&m===b+1){b+=2;continue}v=m+1;continue}if(e.noext!==!0&&(c===fe||c===ie||c===Rt||c===Tt||c===ht)===!0&&u()===xt){if(C=h.isGlob=!0,H=h.isExtglob=!0,w=!0,c===ht&&m===b&&(X=!0),i===!0){for(;N()!==!0&&(c=y());){if(c===st){U=h.backslashes=!0,c=y();continue}if(c===Ot){C=h.isGlob=!0,w=!0;break}}continue}break}if(c===Rt){if(B===Rt&&(j=h.isGlobstar=!0),C=h.isGlob=!0,w=!0,i===!0)continue;break}if(c===Tt){if(C=h.isGlob=!0,w=!0,i===!0)continue;break}if(c===pe){for(;N()!==!0&&(G=y());){if(G===st){U=h.backslashes=!0,y();continue}if(G===Re){I=h.isBracket=!0,C=h.isGlob=!0,w=!0;break}}if(i===!0)continue;break}if(e.nonegate!==!0&&c===ht&&m===b){L=h.negated=!0,b++;continue}if(e.noparen!==!0&&c===xt){if(C=h.isGlob=!0,i===!0){for(;N()!==!0&&(c=y());){if(c===xt){U=h.backslashes=!0,c=y();continue}if(c===Ot){w=!0;break}}continue}break}if(C===!0){if(w=!0,i===!0)continue;break}}e.noext===!0&&(H=!1,C=!1);let S=A,Y="",s="";b>0&&(Y=A.slice(0,b),A=A.slice(b),v-=b),S&&C===!0&&v>0?(S=A.slice(0,v),s=A.slice(v)):C===!0?(S="",s=A):S=A,S&&S!==""&&S!=="/"&&S!==A&&vt(S.charCodeAt(S.length-1))&&(S=S.slice(0,-1)),e.unescape===!0&&(s&&(s=Lt.removeBackslashes(s)),S&&U===!0&&(S=Lt.removeBackslashes(S)));let r={prefix:Y,input:t,start:b,base:S,glob:s,isBrace:k,isBracket:I,isGlob:C,isExtglob:H,isGlobstar:j,negated:L,negatedExtglob:X};if(e.tokens===!0&&(r.maxDepth=0,vt(c)||l.push(h),r.tokens=l),e.parts===!0||e.tokens===!0){let G;for(let R=0;R<g.length;R++){let F=G?G+1:b,W=g[R],P=t.slice(F,W);e.tokens&&(R===0&&b!==0?(l[R].isPrefix=!0,l[R].value=Y):l[R].value=P,mt(l[R]),r.maxDepth+=l[R].depth),(R!==0||P!=="")&&x.push(P),G=W}if(G&&G+1<t.length){let R=t.slice(G+1);x.push(R),e.tokens&&(l[l.length-1].value=R,mt(l[l.length-1]),r.maxDepth+=l[l.length-1].depth)}r.slashes=g,r.parts=x}return r},"scan");kt.exports=_e});var Gt=J((Oe,Bt)=>{"use strict";var it=et(),K=ct(),{MAX_LENGTH:lt,POSIX_REGEX_SOURCE:he,REGEX_NON_SPECIAL_CHARS:Ee,REGEX_SPECIAL_CHARS_BACKREF:xe,REPLACEMENTS:It}=it,ge=_((t,a)=>{if(typeof a.expandRange=="function")return a.expandRange(...t,a);t.sort();let e=`[${t.join("-")}]`;try{new RegExp(e)}catch{return t.map(i=>K.escapeRegex(i)).join("..")}return e},"expandRange"),tt=_((t,a)=>`Missing ${t}: "${a}" - use "\\\\${a}" to match literal characters`,"syntaxError"),gt=_((t,a)=>{if(typeof t!="string")throw new TypeError("Expected a string");t=It[t]||t;let e={...a},E=typeof e.maxLength=="number"?Math.min(lt,e.maxLength):lt,i=t.length;if(i>E)throw new SyntaxError(`Input length: ${i}, exceeds maximum allowed length: ${E}`);let g={type:"bos",value:"",output:e.prepend||""},l=[g],x=e.capture?"":"?:",A=K.isWindows(a),m=it.globChars(A),b=it.extglobChars(m),{DOT_LITERAL:v,PLUS_LITERAL:k,SLASH_LITERAL:I,ONE_CHAR:C,DOTS_SLASH:H,NO_DOT:j,NO_DOT_SLASH:q,NO_DOTS_SLASH:U,QMARK:L,QMARK_NO_DOT:X,STAR:w,START_ANCHOR:V}=m,B=_(o=>`(${x}(?:(?!${V}${o.dot?H:v}).)*?)`,"globstar"),c=e.dot?"":j,h=e.dot?L:X,N=e.bash===!0?B(e):w;e.capture&&(N=`(${N})`),typeof e.noext=="boolean"&&(e.noextglob=e.noext);let u={input:t,index:-1,start:0,dot:e.dot===!0,consumed:"",output:"",prefix:"",backtrack:!1,negated:!1,brackets:0,braces:0,parens:0,quotes:0,globstar:!1,tokens:l};t=K.removePrefix(t,u),i=t.length;let y=[],S=[],Y=[],s=g,r,G=_(()=>u.index===i-1,"eos"),R=u.peek=(o=1)=>t[u.index+o],F=u.advance=()=>t[++u.index]||"",W=_(()=>t.slice(u.index+1),"remaining"),P=_((o="",$=0)=>{u.consumed+=o,u.index+=$},"consume"),rt=_(o=>{u.output+=o.output!=null?o.output:o.value,P(o.value)},"append"),Ut=_(()=>{let o=1;for(;R()==="!"&&(R(2)!=="("||R(3)==="?");)F(),u.start++,o++;return o%2===0?!1:(u.negated=!0,u.start++,!0)},"negate"),ut=_(o=>{u[o]++,Y.push(o)},"increment"),z=_(o=>{u[o]--,Y.pop()},"decrement"),f=_(o=>{if(s.type==="globstar"){let $=u.braces>0&&(o.type==="comma"||o.type==="brace"),n=o.extglob===!0||y.length&&(o.type==="pipe"||o.type==="paren");o.type!=="slash"&&o.type!=="paren"&&!$&&!n&&(u.output=u.output.slice(0,-s.output.length),s.type="star",s.value="*",s.output=N,u.output+=s.output)}if(y.length&&o.type!=="paren"&&(y[y.length-1].inner+=o.value),(o.value||o.output)&&rt(o),s&&s.type==="text"&&o.type==="text"){s.value+=o.value,s.output=(s.output||"")+o.value;return}o.prev=s,l.push(o),s=o},"push"),nt=_((o,$)=>{let n={...b[$],conditions:1,inner:""};n.prev=s,n.parens=u.parens,n.output=u.output;let p=(e.capture?"(":"")+n.open;ut("parens"),f({type:o,value:$,output:u.output?"":C}),f({type:"paren",extglob:!0,value:F(),output:p}),y.push(n)},"extglobOpen"),qt=_(o=>{let $=o.close+(e.capture?")":""),n;if(o.type==="negate"){let p=N;if(o.inner&&o.inner.length>1&&o.inner.includes("/")&&(p=B(e)),(p!==N||G()||/^\)+$/.test(W()))&&($=o.close=`)$))${p}`),o.inner.includes("*")&&(n=W())&&/^\.[^\\/.]+$/.test(n)){let d=gt(n,{...a,fastpaths:!1}).output;$=o.close=`)${d})${p})`}o.prev.type==="bos"&&(u.negatedExtglob=!0)}f({type:"paren",extglob:!0,value:r,output:$}),z("parens")},"extglobClose");if(e.fastpaths!==!1&&!/(^[*!]|[/()[\]{}"])/.test(t)){let o=!1,$=t.replace(xe,(n,p,d,D,O,pt)=>D==="\\"?(o=!0,n):D==="?"?p?p+D+(O?L.repeat(O.length):""):pt===0?h+(O?L.repeat(O.length):""):L.repeat(d.length):D==="."?v.repeat(d.length):D==="*"?p?p+D+(O?N:""):N:p?n:`\\${n}`);return o===!0&&(e.unescape===!0?$=$.replace(/\\/g,""):$=$.replace(/\\+/g,n=>n.length%2===0?"\\\\":n?"\\":"")),$===t&&e.contains===!0?(u.output=t,u):(u.output=K.wrapOutput($,u,a),u)}for(;!G();){if(r=F(),r==="\0")continue;if(r==="\\"){let n=R();if(n==="/"&&e.bash!==!0||n==="."||n===";")continue;if(!n){r+="\\",f({type:"text",value:r});continue}let p=/^\\+/.exec(W()),d=0;if(p&&p[0].length>2&&(d=p[0].length,u.index+=d,d%2!==0&&(r+="\\")),e.unescape===!0?r=F():r+=F(),u.brackets===0){f({type:"text",value:r});continue}}if(u.brackets>0&&(r!=="]"||s.value==="["||s.value==="[^")){if(e.posix!==!1&&r===":"){let n=s.value.slice(1);if(n.includes("[")&&(s.posix=!0,n.includes(":"))){let p=s.value.lastIndexOf("["),d=s.value.slice(0,p),D=s.value.slice(p+2),O=he[D];if(O){s.value=d+O,u.backtrack=!0,F(),!g.output&&l.indexOf(s)===1&&(g.output=C);continue}}}(r==="["&&R()!==":"||r==="-"&&R()==="]")&&(r=`\\${r}`),r==="]"&&(s.value==="["||s.value==="[^")&&(r=`\\${r}`),e.posix===!0&&r==="!"&&s.value==="["&&(r="^"),s.value+=r,rt({value:r});continue}if(u.quotes===1&&r!=='"'){r=K.escapeRegex(r),s.value+=r,rt({value:r});continue}if(r==='"'){u.quotes=u.quotes===1?0:1,e.keepQuotes===!0&&f({type:"text",value:r});continue}if(r==="("){ut("parens"),f({type:"paren",value:r});continue}if(r===")"){if(u.parens===0&&e.strictBrackets===!0)throw new SyntaxError(tt("opening","("));let n=y[y.length-1];if(n&&u.parens===n.parens+1){qt(y.pop());continue}f({type:"paren",value:r,output:u.parens?")":"\\)"}),z("parens");continue}if(r==="["){if(e.nobracket===!0||!W().includes("]")){if(e.nobracket!==!0&&e.strictBrackets===!0)throw new SyntaxError(tt("closing","]"));r=`\\${r}`}else ut("brackets");f({type:"bracket",value:r});continue}if(r==="]"){if(e.nobracket===!0||s&&s.type==="bracket"&&s.value.length===1){f({type:"text",value:r,output:`\\${r}`});continue}if(u.brackets===0){if(e.strictBrackets===!0)throw new SyntaxError(tt("opening","["));f({type:"text",value:r,output:`\\${r}`});continue}z("brackets");let n=s.value.slice(1);if(s.posix!==!0&&n[0]==="^"&&!n.includes("/")&&(r=`/${r}`),s.value+=r,rt({value:r}),e.literalBrackets===!1||K.hasRegexChars(n))continue;let p=K.escapeRegex(s.value);if(u.output=u.output.slice(0,-s.value.length),e.literalBrackets===!0){u.output+=p,s.value=p;continue}s.value=`(${x}${p}|${s.value})`,u.output+=s.value;continue}if(r==="{"&&e.nobrace!==!0){ut("braces");let n={type:"brace",value:r,output:"(",outputIndex:u.output.length,tokensIndex:u.tokens.length};S.push(n),f(n);continue}if(r==="}"){let n=S[S.length-1];if(e.nobrace===!0||!n){f({type:"text",value:r,output:r});continue}let p=")";if(n.dots===!0){let d=l.slice(),D=[];for(let O=d.length-1;O>=0&&(l.pop(),d[O].type!=="brace");O--)d[O].type!=="dots"&&D.unshift(d[O].value);p=ge(D,e),u.backtrack=!0}if(n.comma!==!0&&n.dots!==!0){let d=u.output.slice(0,n.outputIndex),D=u.tokens.slice(n.tokensIndex);n.value=n.output="\\{",r=p="\\}",u.output=d;for(let O of D)u.output+=O.output||O.value}f({type:"brace",value:r,output:p}),z("braces"),S.pop();continue}if(r==="|"){y.length>0&&y[y.length-1].conditions++,f({type:"text",value:r});continue}if(r===","){let n=r,p=S[S.length-1];p&&Y[Y.length-1]==="braces"&&(p.comma=!0,n="|"),f({type:"comma",value:r,output:n});continue}if(r==="/"){if(s.type==="dot"&&u.index===u.start+1){u.start=u.index+1,u.consumed="",u.output="",l.pop(),s=g;continue}f({type:"slash",value:r,output:I});continue}if(r==="."){if(u.braces>0&&s.type==="dot"){s.value==="."&&(s.output=v);let n=S[S.length-1];s.type="dots",s.output+=r,s.value+=r,n.dots=!0;continue}if(u.braces+u.parens===0&&s.type!=="bos"&&s.type!=="slash"){f({type:"text",value:r,output:v});continue}f({type:"dot",value:r,output:v});continue}if(r==="?"){if(!(s&&s.value==="(")&&e.noextglob!==!0&&R()==="("&&R(2)!=="?"){nt("qmark",r);continue}if(s&&s.type==="paren"){let p=R(),d=r;if(p==="<"&&!K.supportsLookbehinds())throw new Error("Node.js v10 or higher is required for regex lookbehinds");(s.value==="("&&!/[!=<:]/.test(p)||p==="<"&&!/<([!=]|\w+>)/.test(W()))&&(d=`\\${r}`),f({type:"text",value:r,output:d});continue}if(e.dot!==!0&&(s.type==="slash"||s.type==="bos")){f({type:"qmark",value:r,output:X});continue}f({type:"qmark",value:r,output:L});continue}if(r==="!"){if(e.noextglob!==!0&&R()==="("&&(R(2)!=="?"||!/[!=<:]/.test(R(3)))){nt("negate",r);continue}if(e.nonegate!==!0&&u.index===0){Ut();continue}}if(r==="+"){if(e.noextglob!==!0&&R()==="("&&R(2)!=="?"){nt("plus",r);continue}if(s&&s.value==="("||e.regex===!1){f({type:"plus",value:r,output:k});continue}if(s&&(s.type==="bracket"||s.type==="paren"||s.type==="brace")||u.parens>0){f({type:"plus",value:r});continue}f({type:"plus",value:k});continue}if(r==="@"){if(e.noextglob!==!0&&R()==="("&&R(2)!=="?"){f({type:"at",extglob:!0,value:r,output:""});continue}f({type:"text",value:r});continue}if(r!=="*"){(r==="$"||r==="^")&&(r=`\\${r}`);let n=Ee.exec(W());n&&(r+=n[0],u.index+=n[0].length),f({type:"text",value:r});continue}if(s&&(s.type==="globstar"||s.star===!0)){s.type="star",s.star=!0,s.value+=r,s.output=N,u.backtrack=!0,u.globstar=!0,P(r);continue}let o=W();if(e.noextglob!==!0&&/^\([^?]/.test(o)){nt("star",r);continue}if(s.type==="star"){if(e.noglobstar===!0){P(r);continue}let n=s.prev,p=n.prev,d=n.type==="slash"||n.type==="bos",D=p&&(p.type==="star"||p.type==="globstar");if(e.bash===!0&&(!d||o[0]&&o[0]!=="/")){f({type:"star",value:r,output:""});continue}let O=u.braces>0&&(n.type==="comma"||n.type==="brace"),pt=y.length&&(n.type==="pipe"||n.type==="paren");if(!d&&n.type!=="paren"&&!O&&!pt){f({type:"star",value:r,output:""});continue}for(;o.slice(0,3)==="/**";){let ot=t[u.index+4];if(ot&&ot!=="/")break;o=o.slice(3),P("/**",3)}if(n.type==="bos"&&G()){s.type="globstar",s.value+=r,s.output=B(e),u.output=s.output,u.globstar=!0,P(r);continue}if(n.type==="slash"&&n.prev.type!=="bos"&&!D&&G()){u.output=u.output.slice(0,-(n.output+s.output).length),n.output=`(?:${n.output}`,s.type="globstar",s.output=B(e)+(e.strictSlashes?")":"|$)"),s.value+=r,u.globstar=!0,u.output+=n.output+s.output,P(r);continue}if(n.type==="slash"&&n.prev.type!=="bos"&&o[0]==="/"){let ot=o[1]!==void 0?"|$":"";u.output=u.output.slice(0,-(n.output+s.output).length),n.output=`(?:${n.output}`,s.type="globstar",s.output=`${B(e)}${I}|${I}${ot})`,s.value+=r,u.output+=n.output+s.output,u.globstar=!0,P(r+F()),f({type:"slash",value:"/",output:""});continue}if(n.type==="bos"&&o[0]==="/"){s.type="globstar",s.value+=r,s.output=`(?:^|${I}|${B(e)}${I})`,u.output=s.output,u.globstar=!0,P(r+F()),f({type:"slash",value:"/",output:""});continue}u.output=u.output.slice(0,-s.output.length),s.type="globstar",s.output=B(e),s.value+=r,u.output+=s.output,u.globstar=!0,P(r);continue}let $={type:"star",value:r,output:N};if(e.bash===!0){$.output=".*?",(s.type==="bos"||s.type==="slash")&&($.output=c+$.output),f($);continue}if(s&&(s.type==="bracket"||s.type==="paren")&&e.regex===!0){$.output=r,f($);continue}(u.index===u.start||s.type==="slash"||s.type==="dot")&&(s.type==="dot"?(u.output+=q,s.output+=q):e.dot===!0?(u.output+=U,s.output+=U):(u.output+=c,s.output+=c),R()!=="*"&&(u.output+=C,s.output+=C)),f($)}for(;u.brackets>0;){if(e.strictBrackets===!0)throw new SyntaxError(tt("closing","]"));u.output=K.escapeLast(u.output,"["),z("brackets")}for(;u.parens>0;){if(e.strictBrackets===!0)throw new SyntaxError(tt("closing",")"));u.output=K.escapeLast(u.output,"("),z("parens")}for(;u.braces>0;){if(e.strictBrackets===!0)throw new SyntaxError(tt("closing","}"));u.output=K.escapeLast(u.output,"{"),z("braces")}if(e.strictSlashes!==!0&&(s.type==="star"||s.type==="bracket")&&f({type:"maybe_slash",value:"",output:`${I}?`}),u.backtrack===!0){u.output="";for(let o of u.tokens)u.output+=o.output!=null?o.output:o.value,o.suffix&&(u.output+=o.suffix)}return u},"parse");gt.fastpaths=(t,a)=>{let e={...a},E=typeof e.maxLength=="number"?Math.min(lt,e.maxLength):lt,i=t.length;if(i>E)throw new SyntaxError(`Input length: ${i}, exceeds maximum allowed length: ${E}`);t=It[t]||t;let g=K.isWindows(a),{DOT_LITERAL:l,SLASH_LITERAL:x,ONE_CHAR:A,DOTS_SLASH:m,NO_DOT:b,NO_DOTS:v,NO_DOTS_SLASH:k,STAR:I,START_ANCHOR:C}=it.globChars(g),H=e.dot?v:b,j=e.dot?k:b,q=e.capture?"":"?:",U={negated:!1,prefix:""},L=e.bash===!0?".*?":I;e.capture&&(L=`(${L})`);let X=_(c=>c.noglobstar===!0?L:`(${q}(?:(?!${C}${c.dot?m:l}).)*?)`,"globstar"),w=_(c=>{switch(c){case"*":return`${H}${A}${L}`;case".*":return`${l}${A}${L}`;case"*.*":return`${H}${L}${l}${A}${L}`;case"*/*":return`${H}${L}${x}${A}${j}${L}`;case"**":return H+X(e);case"**/*":return`(?:${H}${X(e)}${x})?${j}${A}${L}`;case"**/*.*":return`(?:${H}${X(e)}${x})?${j}${L}${l}${A}${L}`;case"**/.*":return`(?:${H}${X(e)}${x})?${l}${A}${L}`;default:{let h=/^(.*?)\.(\w+)$/.exec(c);if(!h)return;let N=w(h[1]);return N?N+l+h[2]:void 0}}},"create"),V=K.removePrefix(t,U),B=w(V);return B&&e.strictSlashes!==!0&&(B+=`${x}?`),B};Bt.exports=gt});var Mt=J((me,Dt)=>{"use strict";var be=require("path"),Ce=wt(),bt=Gt(),Ct=ct(),Se=et(),$e=_(t=>t&&typeof t=="object"&&!Array.isArray(t),"isObject"),T=_((t,a,e=!1)=>{if(Array.isArray(t)){let b=t.map(k=>T(k,a,e));return _(k=>{for(let I of b){let C=I(k);if(C)return C}return!1},"arrayMatcher")}let E=$e(t)&&t.tokens&&t.input;if(t===""||typeof t!="string"&&!E)throw new TypeError("Expected pattern to be a non-empty string");let i=a||{},g=Ct.isWindows(a),l=E?T.compileRe(t,a):T.makeRe(t,a,!1,!0),x=l.state;delete l.state;let A=_(()=>!1,"isIgnored");if(i.ignore){let b={...a,ignore:null,onMatch:null,onResult:null};A=T(i.ignore,b,e)}let m=_((b,v=!1)=>{let{isMatch:k,match:I,output:C}=T.test(b,l,a,{glob:t,posix:g}),H={glob:t,state:x,regex:l,posix:g,input:b,output:C,match:I,isMatch:k};return typeof i.onResult=="function"&&i.onResult(H),k===!1?(H.isMatch=!1,v?H:!1):A(b)?(typeof i.onIgnore=="function"&&i.onIgnore(H),H.isMatch=!1,v?H:!1):(typeof i.onMatch=="function"&&i.onMatch(H),v?H:!0)},"matcher");return e&&(m.state=x),m},"picomatch");T.test=(t,a,e,{glob:E,posix:i}={})=>{if(typeof t!="string")throw new TypeError("Expected input to be a string");if(t==="")return{isMatch:!1,output:""};let g=e||{},l=g.format||(i?Ct.toPosixSlashes:null),x=t===E,A=x&&l?l(t):t;return x===!1&&(A=l?l(t):t,x=A===E),(x===!1||g.capture===!0)&&(g.matchBase===!0||g.basename===!0?x=T.matchBase(t,a,e,i):x=a.exec(A)),{isMatch:!!x,match:x,output:A}};T.matchBase=(t,a,e,E=Ct.isWindows(e))=>(a instanceof RegExp?a:T.makeRe(a,e)).test(be.basename(t));T.isMatch=(t,a,e)=>T(a,e)(t);T.parse=(t,a)=>Array.isArray(t)?t.map(e=>T.parse(e,a)):bt(t,{...a,fastpaths:!1});T.scan=(t,a)=>Ce(t,a);T.compileRe=(t,a,e=!1,E=!1)=>{if(e===!0)return t.output;let i=a||{},g=i.contains?"":"^",l=i.contains?"":"$",x=`${g}(?:${t.output})${l}`;t&&t.negated===!0&&(x=`^(?!${x}).*$`);let A=T.toRegex(x,a);return E===!0&&(A.state=t),A};T.makeRe=(t,a={},e=!1,E=!1)=>{if(!t||typeof t!="string")throw new TypeError("Expected a non-empty string");let i={negated:!1,fastpaths:!0};return a.fastpaths!==!1&&(t[0]==="."||t[0]==="*")&&(i.output=bt.fastpaths(t,a)),i.output||(i=bt(t,a)),T.compileRe(i,a,e,E)};T.toRegex=(t,a)=>{try{let e=a||{};return new RegExp(t,e.flags||(e.nocase?"i":""))}catch(e){if(a&&a.debug===!0)throw e;return/$^/}};T.constants=Se;Dt.exports=T});var Kt=J((ke,Pt)=>{"use strict";Pt.exports=Mt()});module.exports=Kt();
|
|
6
|
+
"use strict";
|
|
7
|
+
var __defProp = Object.defineProperty;
|
|
8
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
9
|
+
var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
|
|
10
|
+
var __commonJS = (cb, mod) => function __require() {
|
|
11
|
+
return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
|
|
12
|
+
};
|
|
13
|
+
|
|
14
|
+
// node_modules/.pnpm/picomatch@2.3.1/node_modules/picomatch/lib/constants.js
|
|
15
|
+
var require_constants = __commonJS({
|
|
16
|
+
"node_modules/.pnpm/picomatch@2.3.1/node_modules/picomatch/lib/constants.js"(exports2, module2) {
|
|
17
|
+
"use strict";
|
|
18
|
+
var path = require("path");
|
|
19
|
+
var WIN_SLASH = "\\\\/";
|
|
20
|
+
var WIN_NO_SLASH = `[^${WIN_SLASH}]`;
|
|
21
|
+
var DOT_LITERAL = "\\.";
|
|
22
|
+
var PLUS_LITERAL = "\\+";
|
|
23
|
+
var QMARK_LITERAL = "\\?";
|
|
24
|
+
var SLASH_LITERAL = "\\/";
|
|
25
|
+
var ONE_CHAR = "(?=.)";
|
|
26
|
+
var QMARK = "[^/]";
|
|
27
|
+
var END_ANCHOR = `(?:${SLASH_LITERAL}|$)`;
|
|
28
|
+
var START_ANCHOR = `(?:^|${SLASH_LITERAL})`;
|
|
29
|
+
var DOTS_SLASH = `${DOT_LITERAL}{1,2}${END_ANCHOR}`;
|
|
30
|
+
var NO_DOT = `(?!${DOT_LITERAL})`;
|
|
31
|
+
var NO_DOTS = `(?!${START_ANCHOR}${DOTS_SLASH})`;
|
|
32
|
+
var NO_DOT_SLASH = `(?!${DOT_LITERAL}{0,1}${END_ANCHOR})`;
|
|
33
|
+
var NO_DOTS_SLASH = `(?!${DOTS_SLASH})`;
|
|
34
|
+
var QMARK_NO_DOT = `[^.${SLASH_LITERAL}]`;
|
|
35
|
+
var STAR = `${QMARK}*?`;
|
|
36
|
+
var POSIX_CHARS = {
|
|
37
|
+
DOT_LITERAL,
|
|
38
|
+
PLUS_LITERAL,
|
|
39
|
+
QMARK_LITERAL,
|
|
40
|
+
SLASH_LITERAL,
|
|
41
|
+
ONE_CHAR,
|
|
42
|
+
QMARK,
|
|
43
|
+
END_ANCHOR,
|
|
44
|
+
DOTS_SLASH,
|
|
45
|
+
NO_DOT,
|
|
46
|
+
NO_DOTS,
|
|
47
|
+
NO_DOT_SLASH,
|
|
48
|
+
NO_DOTS_SLASH,
|
|
49
|
+
QMARK_NO_DOT,
|
|
50
|
+
STAR,
|
|
51
|
+
START_ANCHOR
|
|
52
|
+
};
|
|
53
|
+
var WINDOWS_CHARS = {
|
|
54
|
+
...POSIX_CHARS,
|
|
55
|
+
SLASH_LITERAL: `[${WIN_SLASH}]`,
|
|
56
|
+
QMARK: WIN_NO_SLASH,
|
|
57
|
+
STAR: `${WIN_NO_SLASH}*?`,
|
|
58
|
+
DOTS_SLASH: `${DOT_LITERAL}{1,2}(?:[${WIN_SLASH}]|$)`,
|
|
59
|
+
NO_DOT: `(?!${DOT_LITERAL})`,
|
|
60
|
+
NO_DOTS: `(?!(?:^|[${WIN_SLASH}])${DOT_LITERAL}{1,2}(?:[${WIN_SLASH}]|$))`,
|
|
61
|
+
NO_DOT_SLASH: `(?!${DOT_LITERAL}{0,1}(?:[${WIN_SLASH}]|$))`,
|
|
62
|
+
NO_DOTS_SLASH: `(?!${DOT_LITERAL}{1,2}(?:[${WIN_SLASH}]|$))`,
|
|
63
|
+
QMARK_NO_DOT: `[^.${WIN_SLASH}]`,
|
|
64
|
+
START_ANCHOR: `(?:^|[${WIN_SLASH}])`,
|
|
65
|
+
END_ANCHOR: `(?:[${WIN_SLASH}]|$)`
|
|
66
|
+
};
|
|
67
|
+
var POSIX_REGEX_SOURCE = {
|
|
68
|
+
alnum: "a-zA-Z0-9",
|
|
69
|
+
alpha: "a-zA-Z",
|
|
70
|
+
ascii: "\\x00-\\x7F",
|
|
71
|
+
blank: " \\t",
|
|
72
|
+
cntrl: "\\x00-\\x1F\\x7F",
|
|
73
|
+
digit: "0-9",
|
|
74
|
+
graph: "\\x21-\\x7E",
|
|
75
|
+
lower: "a-z",
|
|
76
|
+
print: "\\x20-\\x7E ",
|
|
77
|
+
punct: "\\-!\"#$%&'()\\*+,./:;<=>?@[\\]^_`{|}~",
|
|
78
|
+
space: " \\t\\r\\n\\v\\f",
|
|
79
|
+
upper: "A-Z",
|
|
80
|
+
word: "A-Za-z0-9_",
|
|
81
|
+
xdigit: "A-Fa-f0-9"
|
|
82
|
+
};
|
|
83
|
+
module2.exports = {
|
|
84
|
+
MAX_LENGTH: 1024 * 64,
|
|
85
|
+
POSIX_REGEX_SOURCE,
|
|
86
|
+
// regular expressions
|
|
87
|
+
REGEX_BACKSLASH: /\\(?![*+?^${}(|)[\]])/g,
|
|
88
|
+
REGEX_NON_SPECIAL_CHARS: /^[^@![\].,$*+?^{}()|\\/]+/,
|
|
89
|
+
REGEX_SPECIAL_CHARS: /[-*+?.^${}(|)[\]]/,
|
|
90
|
+
REGEX_SPECIAL_CHARS_BACKREF: /(\\?)((\W)(\3*))/g,
|
|
91
|
+
REGEX_SPECIAL_CHARS_GLOBAL: /([-*+?.^${}(|)[\]])/g,
|
|
92
|
+
REGEX_REMOVE_BACKSLASH: /(?:\[.*?[^\\]\]|\\(?=.))/g,
|
|
93
|
+
// Replace globs with equivalent patterns to reduce parsing time.
|
|
94
|
+
REPLACEMENTS: {
|
|
95
|
+
"***": "*",
|
|
96
|
+
"**/**": "**",
|
|
97
|
+
"**/**/**": "**"
|
|
98
|
+
},
|
|
99
|
+
// Digits
|
|
100
|
+
CHAR_0: 48,
|
|
101
|
+
/* 0 */
|
|
102
|
+
CHAR_9: 57,
|
|
103
|
+
/* 9 */
|
|
104
|
+
// Alphabet chars.
|
|
105
|
+
CHAR_UPPERCASE_A: 65,
|
|
106
|
+
/* A */
|
|
107
|
+
CHAR_LOWERCASE_A: 97,
|
|
108
|
+
/* a */
|
|
109
|
+
CHAR_UPPERCASE_Z: 90,
|
|
110
|
+
/* Z */
|
|
111
|
+
CHAR_LOWERCASE_Z: 122,
|
|
112
|
+
/* z */
|
|
113
|
+
CHAR_LEFT_PARENTHESES: 40,
|
|
114
|
+
/* ( */
|
|
115
|
+
CHAR_RIGHT_PARENTHESES: 41,
|
|
116
|
+
/* ) */
|
|
117
|
+
CHAR_ASTERISK: 42,
|
|
118
|
+
/* * */
|
|
119
|
+
// Non-alphabetic chars.
|
|
120
|
+
CHAR_AMPERSAND: 38,
|
|
121
|
+
/* & */
|
|
122
|
+
CHAR_AT: 64,
|
|
123
|
+
/* @ */
|
|
124
|
+
CHAR_BACKWARD_SLASH: 92,
|
|
125
|
+
/* \ */
|
|
126
|
+
CHAR_CARRIAGE_RETURN: 13,
|
|
127
|
+
/* \r */
|
|
128
|
+
CHAR_CIRCUMFLEX_ACCENT: 94,
|
|
129
|
+
/* ^ */
|
|
130
|
+
CHAR_COLON: 58,
|
|
131
|
+
/* : */
|
|
132
|
+
CHAR_COMMA: 44,
|
|
133
|
+
/* , */
|
|
134
|
+
CHAR_DOT: 46,
|
|
135
|
+
/* . */
|
|
136
|
+
CHAR_DOUBLE_QUOTE: 34,
|
|
137
|
+
/* " */
|
|
138
|
+
CHAR_EQUAL: 61,
|
|
139
|
+
/* = */
|
|
140
|
+
CHAR_EXCLAMATION_MARK: 33,
|
|
141
|
+
/* ! */
|
|
142
|
+
CHAR_FORM_FEED: 12,
|
|
143
|
+
/* \f */
|
|
144
|
+
CHAR_FORWARD_SLASH: 47,
|
|
145
|
+
/* / */
|
|
146
|
+
CHAR_GRAVE_ACCENT: 96,
|
|
147
|
+
/* ` */
|
|
148
|
+
CHAR_HASH: 35,
|
|
149
|
+
/* # */
|
|
150
|
+
CHAR_HYPHEN_MINUS: 45,
|
|
151
|
+
/* - */
|
|
152
|
+
CHAR_LEFT_ANGLE_BRACKET: 60,
|
|
153
|
+
/* < */
|
|
154
|
+
CHAR_LEFT_CURLY_BRACE: 123,
|
|
155
|
+
/* { */
|
|
156
|
+
CHAR_LEFT_SQUARE_BRACKET: 91,
|
|
157
|
+
/* [ */
|
|
158
|
+
CHAR_LINE_FEED: 10,
|
|
159
|
+
/* \n */
|
|
160
|
+
CHAR_NO_BREAK_SPACE: 160,
|
|
161
|
+
/* \u00A0 */
|
|
162
|
+
CHAR_PERCENT: 37,
|
|
163
|
+
/* % */
|
|
164
|
+
CHAR_PLUS: 43,
|
|
165
|
+
/* + */
|
|
166
|
+
CHAR_QUESTION_MARK: 63,
|
|
167
|
+
/* ? */
|
|
168
|
+
CHAR_RIGHT_ANGLE_BRACKET: 62,
|
|
169
|
+
/* > */
|
|
170
|
+
CHAR_RIGHT_CURLY_BRACE: 125,
|
|
171
|
+
/* } */
|
|
172
|
+
CHAR_RIGHT_SQUARE_BRACKET: 93,
|
|
173
|
+
/* ] */
|
|
174
|
+
CHAR_SEMICOLON: 59,
|
|
175
|
+
/* ; */
|
|
176
|
+
CHAR_SINGLE_QUOTE: 39,
|
|
177
|
+
/* ' */
|
|
178
|
+
CHAR_SPACE: 32,
|
|
179
|
+
/* */
|
|
180
|
+
CHAR_TAB: 9,
|
|
181
|
+
/* \t */
|
|
182
|
+
CHAR_UNDERSCORE: 95,
|
|
183
|
+
/* _ */
|
|
184
|
+
CHAR_VERTICAL_LINE: 124,
|
|
185
|
+
/* | */
|
|
186
|
+
CHAR_ZERO_WIDTH_NOBREAK_SPACE: 65279,
|
|
187
|
+
/* \uFEFF */
|
|
188
|
+
SEP: path.sep,
|
|
189
|
+
/**
|
|
190
|
+
* Create EXTGLOB_CHARS
|
|
191
|
+
*/
|
|
192
|
+
extglobChars(chars) {
|
|
193
|
+
return {
|
|
194
|
+
"!": { type: "negate", open: "(?:(?!(?:", close: `))${chars.STAR})` },
|
|
195
|
+
"?": { type: "qmark", open: "(?:", close: ")?" },
|
|
196
|
+
"+": { type: "plus", open: "(?:", close: ")+" },
|
|
197
|
+
"*": { type: "star", open: "(?:", close: ")*" },
|
|
198
|
+
"@": { type: "at", open: "(?:", close: ")" }
|
|
199
|
+
};
|
|
200
|
+
},
|
|
201
|
+
/**
|
|
202
|
+
* Create GLOB_CHARS
|
|
203
|
+
*/
|
|
204
|
+
globChars(win32) {
|
|
205
|
+
return win32 === true ? WINDOWS_CHARS : POSIX_CHARS;
|
|
206
|
+
}
|
|
207
|
+
};
|
|
208
|
+
}
|
|
209
|
+
});
|
|
210
|
+
|
|
211
|
+
// node_modules/.pnpm/picomatch@2.3.1/node_modules/picomatch/lib/utils.js
|
|
212
|
+
var require_utils = __commonJS({
|
|
213
|
+
"node_modules/.pnpm/picomatch@2.3.1/node_modules/picomatch/lib/utils.js"(exports2) {
|
|
214
|
+
"use strict";
|
|
215
|
+
var path = require("path");
|
|
216
|
+
var win32 = process.platform === "win32";
|
|
217
|
+
var {
|
|
218
|
+
REGEX_BACKSLASH,
|
|
219
|
+
REGEX_REMOVE_BACKSLASH,
|
|
220
|
+
REGEX_SPECIAL_CHARS,
|
|
221
|
+
REGEX_SPECIAL_CHARS_GLOBAL
|
|
222
|
+
} = require_constants();
|
|
223
|
+
exports2.isObject = (val) => val !== null && typeof val === "object" && !Array.isArray(val);
|
|
224
|
+
exports2.hasRegexChars = (str) => REGEX_SPECIAL_CHARS.test(str);
|
|
225
|
+
exports2.isRegexChar = (str) => str.length === 1 && exports2.hasRegexChars(str);
|
|
226
|
+
exports2.escapeRegex = (str) => str.replace(REGEX_SPECIAL_CHARS_GLOBAL, "\\$1");
|
|
227
|
+
exports2.toPosixSlashes = (str) => str.replace(REGEX_BACKSLASH, "/");
|
|
228
|
+
exports2.removeBackslashes = (str) => {
|
|
229
|
+
return str.replace(REGEX_REMOVE_BACKSLASH, (match) => {
|
|
230
|
+
return match === "\\" ? "" : match;
|
|
231
|
+
});
|
|
232
|
+
};
|
|
233
|
+
exports2.supportsLookbehinds = () => {
|
|
234
|
+
const segs = process.version.slice(1).split(".").map(Number);
|
|
235
|
+
if (segs.length === 3 && segs[0] >= 9 || segs[0] === 8 && segs[1] >= 10) {
|
|
236
|
+
return true;
|
|
237
|
+
}
|
|
238
|
+
return false;
|
|
239
|
+
};
|
|
240
|
+
exports2.isWindows = (options) => {
|
|
241
|
+
if (options && typeof options.windows === "boolean") {
|
|
242
|
+
return options.windows;
|
|
243
|
+
}
|
|
244
|
+
return win32 === true || path.sep === "\\";
|
|
245
|
+
};
|
|
246
|
+
exports2.escapeLast = (input, char, lastIdx) => {
|
|
247
|
+
const idx = input.lastIndexOf(char, lastIdx);
|
|
248
|
+
if (idx === -1) return input;
|
|
249
|
+
if (input[idx - 1] === "\\") return exports2.escapeLast(input, char, idx - 1);
|
|
250
|
+
return `${input.slice(0, idx)}\\${input.slice(idx)}`;
|
|
251
|
+
};
|
|
252
|
+
exports2.removePrefix = (input, state = {}) => {
|
|
253
|
+
let output = input;
|
|
254
|
+
if (output.startsWith("./")) {
|
|
255
|
+
output = output.slice(2);
|
|
256
|
+
state.prefix = "./";
|
|
257
|
+
}
|
|
258
|
+
return output;
|
|
259
|
+
};
|
|
260
|
+
exports2.wrapOutput = (input, state = {}, options = {}) => {
|
|
261
|
+
const prepend = options.contains ? "" : "^";
|
|
262
|
+
const append = options.contains ? "" : "$";
|
|
263
|
+
let output = `${prepend}(?:${input})${append}`;
|
|
264
|
+
if (state.negated === true) {
|
|
265
|
+
output = `(?:^(?!${output}).*$)`;
|
|
266
|
+
}
|
|
267
|
+
return output;
|
|
268
|
+
};
|
|
269
|
+
}
|
|
270
|
+
});
|
|
271
|
+
|
|
272
|
+
// node_modules/.pnpm/picomatch@2.3.1/node_modules/picomatch/lib/scan.js
|
|
273
|
+
var require_scan = __commonJS({
|
|
274
|
+
"node_modules/.pnpm/picomatch@2.3.1/node_modules/picomatch/lib/scan.js"(exports2, module2) {
|
|
275
|
+
"use strict";
|
|
276
|
+
var utils = require_utils();
|
|
277
|
+
var {
|
|
278
|
+
CHAR_ASTERISK,
|
|
279
|
+
/* * */
|
|
280
|
+
CHAR_AT,
|
|
281
|
+
/* @ */
|
|
282
|
+
CHAR_BACKWARD_SLASH,
|
|
283
|
+
/* \ */
|
|
284
|
+
CHAR_COMMA,
|
|
285
|
+
/* , */
|
|
286
|
+
CHAR_DOT,
|
|
287
|
+
/* . */
|
|
288
|
+
CHAR_EXCLAMATION_MARK,
|
|
289
|
+
/* ! */
|
|
290
|
+
CHAR_FORWARD_SLASH,
|
|
291
|
+
/* / */
|
|
292
|
+
CHAR_LEFT_CURLY_BRACE,
|
|
293
|
+
/* { */
|
|
294
|
+
CHAR_LEFT_PARENTHESES,
|
|
295
|
+
/* ( */
|
|
296
|
+
CHAR_LEFT_SQUARE_BRACKET,
|
|
297
|
+
/* [ */
|
|
298
|
+
CHAR_PLUS,
|
|
299
|
+
/* + */
|
|
300
|
+
CHAR_QUESTION_MARK,
|
|
301
|
+
/* ? */
|
|
302
|
+
CHAR_RIGHT_CURLY_BRACE,
|
|
303
|
+
/* } */
|
|
304
|
+
CHAR_RIGHT_PARENTHESES,
|
|
305
|
+
/* ) */
|
|
306
|
+
CHAR_RIGHT_SQUARE_BRACKET
|
|
307
|
+
/* ] */
|
|
308
|
+
} = require_constants();
|
|
309
|
+
var isPathSeparator = /* @__PURE__ */ __name((code) => {
|
|
310
|
+
return code === CHAR_FORWARD_SLASH || code === CHAR_BACKWARD_SLASH;
|
|
311
|
+
}, "isPathSeparator");
|
|
312
|
+
var depth = /* @__PURE__ */ __name((token) => {
|
|
313
|
+
if (token.isPrefix !== true) {
|
|
314
|
+
token.depth = token.isGlobstar ? Infinity : 1;
|
|
315
|
+
}
|
|
316
|
+
}, "depth");
|
|
317
|
+
var scan = /* @__PURE__ */ __name((input, options) => {
|
|
318
|
+
const opts = options || {};
|
|
319
|
+
const length = input.length - 1;
|
|
320
|
+
const scanToEnd = opts.parts === true || opts.scanToEnd === true;
|
|
321
|
+
const slashes = [];
|
|
322
|
+
const tokens = [];
|
|
323
|
+
const parts = [];
|
|
324
|
+
let str = input;
|
|
325
|
+
let index = -1;
|
|
326
|
+
let start = 0;
|
|
327
|
+
let lastIndex = 0;
|
|
328
|
+
let isBrace = false;
|
|
329
|
+
let isBracket = false;
|
|
330
|
+
let isGlob = false;
|
|
331
|
+
let isExtglob = false;
|
|
332
|
+
let isGlobstar = false;
|
|
333
|
+
let braceEscaped = false;
|
|
334
|
+
let backslashes = false;
|
|
335
|
+
let negated = false;
|
|
336
|
+
let negatedExtglob = false;
|
|
337
|
+
let finished = false;
|
|
338
|
+
let braces = 0;
|
|
339
|
+
let prev;
|
|
340
|
+
let code;
|
|
341
|
+
let token = { value: "", depth: 0, isGlob: false };
|
|
342
|
+
const eos = /* @__PURE__ */ __name(() => index >= length, "eos");
|
|
343
|
+
const peek = /* @__PURE__ */ __name(() => str.charCodeAt(index + 1), "peek");
|
|
344
|
+
const advance = /* @__PURE__ */ __name(() => {
|
|
345
|
+
prev = code;
|
|
346
|
+
return str.charCodeAt(++index);
|
|
347
|
+
}, "advance");
|
|
348
|
+
while (index < length) {
|
|
349
|
+
code = advance();
|
|
350
|
+
let next;
|
|
351
|
+
if (code === CHAR_BACKWARD_SLASH) {
|
|
352
|
+
backslashes = token.backslashes = true;
|
|
353
|
+
code = advance();
|
|
354
|
+
if (code === CHAR_LEFT_CURLY_BRACE) {
|
|
355
|
+
braceEscaped = true;
|
|
356
|
+
}
|
|
357
|
+
continue;
|
|
358
|
+
}
|
|
359
|
+
if (braceEscaped === true || code === CHAR_LEFT_CURLY_BRACE) {
|
|
360
|
+
braces++;
|
|
361
|
+
while (eos() !== true && (code = advance())) {
|
|
362
|
+
if (code === CHAR_BACKWARD_SLASH) {
|
|
363
|
+
backslashes = token.backslashes = true;
|
|
364
|
+
advance();
|
|
365
|
+
continue;
|
|
366
|
+
}
|
|
367
|
+
if (code === CHAR_LEFT_CURLY_BRACE) {
|
|
368
|
+
braces++;
|
|
369
|
+
continue;
|
|
370
|
+
}
|
|
371
|
+
if (braceEscaped !== true && code === CHAR_DOT && (code = advance()) === CHAR_DOT) {
|
|
372
|
+
isBrace = token.isBrace = true;
|
|
373
|
+
isGlob = token.isGlob = true;
|
|
374
|
+
finished = true;
|
|
375
|
+
if (scanToEnd === true) {
|
|
376
|
+
continue;
|
|
377
|
+
}
|
|
378
|
+
break;
|
|
379
|
+
}
|
|
380
|
+
if (braceEscaped !== true && code === CHAR_COMMA) {
|
|
381
|
+
isBrace = token.isBrace = true;
|
|
382
|
+
isGlob = token.isGlob = true;
|
|
383
|
+
finished = true;
|
|
384
|
+
if (scanToEnd === true) {
|
|
385
|
+
continue;
|
|
386
|
+
}
|
|
387
|
+
break;
|
|
388
|
+
}
|
|
389
|
+
if (code === CHAR_RIGHT_CURLY_BRACE) {
|
|
390
|
+
braces--;
|
|
391
|
+
if (braces === 0) {
|
|
392
|
+
braceEscaped = false;
|
|
393
|
+
isBrace = token.isBrace = true;
|
|
394
|
+
finished = true;
|
|
395
|
+
break;
|
|
396
|
+
}
|
|
397
|
+
}
|
|
398
|
+
}
|
|
399
|
+
if (scanToEnd === true) {
|
|
400
|
+
continue;
|
|
401
|
+
}
|
|
402
|
+
break;
|
|
403
|
+
}
|
|
404
|
+
if (code === CHAR_FORWARD_SLASH) {
|
|
405
|
+
slashes.push(index);
|
|
406
|
+
tokens.push(token);
|
|
407
|
+
token = { value: "", depth: 0, isGlob: false };
|
|
408
|
+
if (finished === true) continue;
|
|
409
|
+
if (prev === CHAR_DOT && index === start + 1) {
|
|
410
|
+
start += 2;
|
|
411
|
+
continue;
|
|
412
|
+
}
|
|
413
|
+
lastIndex = index + 1;
|
|
414
|
+
continue;
|
|
415
|
+
}
|
|
416
|
+
if (opts.noext !== true) {
|
|
417
|
+
const isExtglobChar = code === CHAR_PLUS || code === CHAR_AT || code === CHAR_ASTERISK || code === CHAR_QUESTION_MARK || code === CHAR_EXCLAMATION_MARK;
|
|
418
|
+
if (isExtglobChar === true && peek() === CHAR_LEFT_PARENTHESES) {
|
|
419
|
+
isGlob = token.isGlob = true;
|
|
420
|
+
isExtglob = token.isExtglob = true;
|
|
421
|
+
finished = true;
|
|
422
|
+
if (code === CHAR_EXCLAMATION_MARK && index === start) {
|
|
423
|
+
negatedExtglob = true;
|
|
424
|
+
}
|
|
425
|
+
if (scanToEnd === true) {
|
|
426
|
+
while (eos() !== true && (code = advance())) {
|
|
427
|
+
if (code === CHAR_BACKWARD_SLASH) {
|
|
428
|
+
backslashes = token.backslashes = true;
|
|
429
|
+
code = advance();
|
|
430
|
+
continue;
|
|
431
|
+
}
|
|
432
|
+
if (code === CHAR_RIGHT_PARENTHESES) {
|
|
433
|
+
isGlob = token.isGlob = true;
|
|
434
|
+
finished = true;
|
|
435
|
+
break;
|
|
436
|
+
}
|
|
437
|
+
}
|
|
438
|
+
continue;
|
|
439
|
+
}
|
|
440
|
+
break;
|
|
441
|
+
}
|
|
442
|
+
}
|
|
443
|
+
if (code === CHAR_ASTERISK) {
|
|
444
|
+
if (prev === CHAR_ASTERISK) isGlobstar = token.isGlobstar = true;
|
|
445
|
+
isGlob = token.isGlob = true;
|
|
446
|
+
finished = true;
|
|
447
|
+
if (scanToEnd === true) {
|
|
448
|
+
continue;
|
|
449
|
+
}
|
|
450
|
+
break;
|
|
451
|
+
}
|
|
452
|
+
if (code === CHAR_QUESTION_MARK) {
|
|
453
|
+
isGlob = token.isGlob = true;
|
|
454
|
+
finished = true;
|
|
455
|
+
if (scanToEnd === true) {
|
|
456
|
+
continue;
|
|
457
|
+
}
|
|
458
|
+
break;
|
|
459
|
+
}
|
|
460
|
+
if (code === CHAR_LEFT_SQUARE_BRACKET) {
|
|
461
|
+
while (eos() !== true && (next = advance())) {
|
|
462
|
+
if (next === CHAR_BACKWARD_SLASH) {
|
|
463
|
+
backslashes = token.backslashes = true;
|
|
464
|
+
advance();
|
|
465
|
+
continue;
|
|
466
|
+
}
|
|
467
|
+
if (next === CHAR_RIGHT_SQUARE_BRACKET) {
|
|
468
|
+
isBracket = token.isBracket = true;
|
|
469
|
+
isGlob = token.isGlob = true;
|
|
470
|
+
finished = true;
|
|
471
|
+
break;
|
|
472
|
+
}
|
|
473
|
+
}
|
|
474
|
+
if (scanToEnd === true) {
|
|
475
|
+
continue;
|
|
476
|
+
}
|
|
477
|
+
break;
|
|
478
|
+
}
|
|
479
|
+
if (opts.nonegate !== true && code === CHAR_EXCLAMATION_MARK && index === start) {
|
|
480
|
+
negated = token.negated = true;
|
|
481
|
+
start++;
|
|
482
|
+
continue;
|
|
483
|
+
}
|
|
484
|
+
if (opts.noparen !== true && code === CHAR_LEFT_PARENTHESES) {
|
|
485
|
+
isGlob = token.isGlob = true;
|
|
486
|
+
if (scanToEnd === true) {
|
|
487
|
+
while (eos() !== true && (code = advance())) {
|
|
488
|
+
if (code === CHAR_LEFT_PARENTHESES) {
|
|
489
|
+
backslashes = token.backslashes = true;
|
|
490
|
+
code = advance();
|
|
491
|
+
continue;
|
|
492
|
+
}
|
|
493
|
+
if (code === CHAR_RIGHT_PARENTHESES) {
|
|
494
|
+
finished = true;
|
|
495
|
+
break;
|
|
496
|
+
}
|
|
497
|
+
}
|
|
498
|
+
continue;
|
|
499
|
+
}
|
|
500
|
+
break;
|
|
501
|
+
}
|
|
502
|
+
if (isGlob === true) {
|
|
503
|
+
finished = true;
|
|
504
|
+
if (scanToEnd === true) {
|
|
505
|
+
continue;
|
|
506
|
+
}
|
|
507
|
+
break;
|
|
508
|
+
}
|
|
509
|
+
}
|
|
510
|
+
if (opts.noext === true) {
|
|
511
|
+
isExtglob = false;
|
|
512
|
+
isGlob = false;
|
|
513
|
+
}
|
|
514
|
+
let base = str;
|
|
515
|
+
let prefix = "";
|
|
516
|
+
let glob = "";
|
|
517
|
+
if (start > 0) {
|
|
518
|
+
prefix = str.slice(0, start);
|
|
519
|
+
str = str.slice(start);
|
|
520
|
+
lastIndex -= start;
|
|
521
|
+
}
|
|
522
|
+
if (base && isGlob === true && lastIndex > 0) {
|
|
523
|
+
base = str.slice(0, lastIndex);
|
|
524
|
+
glob = str.slice(lastIndex);
|
|
525
|
+
} else if (isGlob === true) {
|
|
526
|
+
base = "";
|
|
527
|
+
glob = str;
|
|
528
|
+
} else {
|
|
529
|
+
base = str;
|
|
530
|
+
}
|
|
531
|
+
if (base && base !== "" && base !== "/" && base !== str) {
|
|
532
|
+
if (isPathSeparator(base.charCodeAt(base.length - 1))) {
|
|
533
|
+
base = base.slice(0, -1);
|
|
534
|
+
}
|
|
535
|
+
}
|
|
536
|
+
if (opts.unescape === true) {
|
|
537
|
+
if (glob) glob = utils.removeBackslashes(glob);
|
|
538
|
+
if (base && backslashes === true) {
|
|
539
|
+
base = utils.removeBackslashes(base);
|
|
540
|
+
}
|
|
541
|
+
}
|
|
542
|
+
const state = {
|
|
543
|
+
prefix,
|
|
544
|
+
input,
|
|
545
|
+
start,
|
|
546
|
+
base,
|
|
547
|
+
glob,
|
|
548
|
+
isBrace,
|
|
549
|
+
isBracket,
|
|
550
|
+
isGlob,
|
|
551
|
+
isExtglob,
|
|
552
|
+
isGlobstar,
|
|
553
|
+
negated,
|
|
554
|
+
negatedExtglob
|
|
555
|
+
};
|
|
556
|
+
if (opts.tokens === true) {
|
|
557
|
+
state.maxDepth = 0;
|
|
558
|
+
if (!isPathSeparator(code)) {
|
|
559
|
+
tokens.push(token);
|
|
560
|
+
}
|
|
561
|
+
state.tokens = tokens;
|
|
562
|
+
}
|
|
563
|
+
if (opts.parts === true || opts.tokens === true) {
|
|
564
|
+
let prevIndex;
|
|
565
|
+
for (let idx = 0; idx < slashes.length; idx++) {
|
|
566
|
+
const n = prevIndex ? prevIndex + 1 : start;
|
|
567
|
+
const i = slashes[idx];
|
|
568
|
+
const value = input.slice(n, i);
|
|
569
|
+
if (opts.tokens) {
|
|
570
|
+
if (idx === 0 && start !== 0) {
|
|
571
|
+
tokens[idx].isPrefix = true;
|
|
572
|
+
tokens[idx].value = prefix;
|
|
573
|
+
} else {
|
|
574
|
+
tokens[idx].value = value;
|
|
575
|
+
}
|
|
576
|
+
depth(tokens[idx]);
|
|
577
|
+
state.maxDepth += tokens[idx].depth;
|
|
578
|
+
}
|
|
579
|
+
if (idx !== 0 || value !== "") {
|
|
580
|
+
parts.push(value);
|
|
581
|
+
}
|
|
582
|
+
prevIndex = i;
|
|
583
|
+
}
|
|
584
|
+
if (prevIndex && prevIndex + 1 < input.length) {
|
|
585
|
+
const value = input.slice(prevIndex + 1);
|
|
586
|
+
parts.push(value);
|
|
587
|
+
if (opts.tokens) {
|
|
588
|
+
tokens[tokens.length - 1].value = value;
|
|
589
|
+
depth(tokens[tokens.length - 1]);
|
|
590
|
+
state.maxDepth += tokens[tokens.length - 1].depth;
|
|
591
|
+
}
|
|
592
|
+
}
|
|
593
|
+
state.slashes = slashes;
|
|
594
|
+
state.parts = parts;
|
|
595
|
+
}
|
|
596
|
+
return state;
|
|
597
|
+
}, "scan");
|
|
598
|
+
module2.exports = scan;
|
|
599
|
+
}
|
|
600
|
+
});
|
|
601
|
+
|
|
602
|
+
// node_modules/.pnpm/picomatch@2.3.1/node_modules/picomatch/lib/parse.js
|
|
603
|
+
var require_parse = __commonJS({
|
|
604
|
+
"node_modules/.pnpm/picomatch@2.3.1/node_modules/picomatch/lib/parse.js"(exports2, module2) {
|
|
605
|
+
"use strict";
|
|
606
|
+
var constants = require_constants();
|
|
607
|
+
var utils = require_utils();
|
|
608
|
+
var {
|
|
609
|
+
MAX_LENGTH,
|
|
610
|
+
POSIX_REGEX_SOURCE,
|
|
611
|
+
REGEX_NON_SPECIAL_CHARS,
|
|
612
|
+
REGEX_SPECIAL_CHARS_BACKREF,
|
|
613
|
+
REPLACEMENTS
|
|
614
|
+
} = constants;
|
|
615
|
+
var expandRange = /* @__PURE__ */ __name((args, options) => {
|
|
616
|
+
if (typeof options.expandRange === "function") {
|
|
617
|
+
return options.expandRange(...args, options);
|
|
618
|
+
}
|
|
619
|
+
args.sort();
|
|
620
|
+
const value = `[${args.join("-")}]`;
|
|
621
|
+
try {
|
|
622
|
+
new RegExp(value);
|
|
623
|
+
} catch (ex) {
|
|
624
|
+
return args.map((v) => utils.escapeRegex(v)).join("..");
|
|
625
|
+
}
|
|
626
|
+
return value;
|
|
627
|
+
}, "expandRange");
|
|
628
|
+
var syntaxError = /* @__PURE__ */ __name((type, char) => {
|
|
629
|
+
return `Missing ${type}: "${char}" - use "\\\\${char}" to match literal characters`;
|
|
630
|
+
}, "syntaxError");
|
|
631
|
+
var parse = /* @__PURE__ */ __name((input, options) => {
|
|
632
|
+
if (typeof input !== "string") {
|
|
633
|
+
throw new TypeError("Expected a string");
|
|
634
|
+
}
|
|
635
|
+
input = REPLACEMENTS[input] || input;
|
|
636
|
+
const opts = { ...options };
|
|
637
|
+
const max = typeof opts.maxLength === "number" ? Math.min(MAX_LENGTH, opts.maxLength) : MAX_LENGTH;
|
|
638
|
+
let len = input.length;
|
|
639
|
+
if (len > max) {
|
|
640
|
+
throw new SyntaxError(`Input length: ${len}, exceeds maximum allowed length: ${max}`);
|
|
641
|
+
}
|
|
642
|
+
const bos = { type: "bos", value: "", output: opts.prepend || "" };
|
|
643
|
+
const tokens = [bos];
|
|
644
|
+
const capture = opts.capture ? "" : "?:";
|
|
645
|
+
const win32 = utils.isWindows(options);
|
|
646
|
+
const PLATFORM_CHARS = constants.globChars(win32);
|
|
647
|
+
const EXTGLOB_CHARS = constants.extglobChars(PLATFORM_CHARS);
|
|
648
|
+
const {
|
|
649
|
+
DOT_LITERAL,
|
|
650
|
+
PLUS_LITERAL,
|
|
651
|
+
SLASH_LITERAL,
|
|
652
|
+
ONE_CHAR,
|
|
653
|
+
DOTS_SLASH,
|
|
654
|
+
NO_DOT,
|
|
655
|
+
NO_DOT_SLASH,
|
|
656
|
+
NO_DOTS_SLASH,
|
|
657
|
+
QMARK,
|
|
658
|
+
QMARK_NO_DOT,
|
|
659
|
+
STAR,
|
|
660
|
+
START_ANCHOR
|
|
661
|
+
} = PLATFORM_CHARS;
|
|
662
|
+
const globstar = /* @__PURE__ */ __name((opts2) => {
|
|
663
|
+
return `(${capture}(?:(?!${START_ANCHOR}${opts2.dot ? DOTS_SLASH : DOT_LITERAL}).)*?)`;
|
|
664
|
+
}, "globstar");
|
|
665
|
+
const nodot = opts.dot ? "" : NO_DOT;
|
|
666
|
+
const qmarkNoDot = opts.dot ? QMARK : QMARK_NO_DOT;
|
|
667
|
+
let star = opts.bash === true ? globstar(opts) : STAR;
|
|
668
|
+
if (opts.capture) {
|
|
669
|
+
star = `(${star})`;
|
|
670
|
+
}
|
|
671
|
+
if (typeof opts.noext === "boolean") {
|
|
672
|
+
opts.noextglob = opts.noext;
|
|
673
|
+
}
|
|
674
|
+
const state = {
|
|
675
|
+
input,
|
|
676
|
+
index: -1,
|
|
677
|
+
start: 0,
|
|
678
|
+
dot: opts.dot === true,
|
|
679
|
+
consumed: "",
|
|
680
|
+
output: "",
|
|
681
|
+
prefix: "",
|
|
682
|
+
backtrack: false,
|
|
683
|
+
negated: false,
|
|
684
|
+
brackets: 0,
|
|
685
|
+
braces: 0,
|
|
686
|
+
parens: 0,
|
|
687
|
+
quotes: 0,
|
|
688
|
+
globstar: false,
|
|
689
|
+
tokens
|
|
690
|
+
};
|
|
691
|
+
input = utils.removePrefix(input, state);
|
|
692
|
+
len = input.length;
|
|
693
|
+
const extglobs = [];
|
|
694
|
+
const braces = [];
|
|
695
|
+
const stack = [];
|
|
696
|
+
let prev = bos;
|
|
697
|
+
let value;
|
|
698
|
+
const eos = /* @__PURE__ */ __name(() => state.index === len - 1, "eos");
|
|
699
|
+
const peek = state.peek = (n = 1) => input[state.index + n];
|
|
700
|
+
const advance = state.advance = () => input[++state.index] || "";
|
|
701
|
+
const remaining = /* @__PURE__ */ __name(() => input.slice(state.index + 1), "remaining");
|
|
702
|
+
const consume = /* @__PURE__ */ __name((value2 = "", num = 0) => {
|
|
703
|
+
state.consumed += value2;
|
|
704
|
+
state.index += num;
|
|
705
|
+
}, "consume");
|
|
706
|
+
const append = /* @__PURE__ */ __name((token) => {
|
|
707
|
+
state.output += token.output != null ? token.output : token.value;
|
|
708
|
+
consume(token.value);
|
|
709
|
+
}, "append");
|
|
710
|
+
const negate = /* @__PURE__ */ __name(() => {
|
|
711
|
+
let count = 1;
|
|
712
|
+
while (peek() === "!" && (peek(2) !== "(" || peek(3) === "?")) {
|
|
713
|
+
advance();
|
|
714
|
+
state.start++;
|
|
715
|
+
count++;
|
|
716
|
+
}
|
|
717
|
+
if (count % 2 === 0) {
|
|
718
|
+
return false;
|
|
719
|
+
}
|
|
720
|
+
state.negated = true;
|
|
721
|
+
state.start++;
|
|
722
|
+
return true;
|
|
723
|
+
}, "negate");
|
|
724
|
+
const increment = /* @__PURE__ */ __name((type) => {
|
|
725
|
+
state[type]++;
|
|
726
|
+
stack.push(type);
|
|
727
|
+
}, "increment");
|
|
728
|
+
const decrement = /* @__PURE__ */ __name((type) => {
|
|
729
|
+
state[type]--;
|
|
730
|
+
stack.pop();
|
|
731
|
+
}, "decrement");
|
|
732
|
+
const push = /* @__PURE__ */ __name((tok) => {
|
|
733
|
+
if (prev.type === "globstar") {
|
|
734
|
+
const isBrace = state.braces > 0 && (tok.type === "comma" || tok.type === "brace");
|
|
735
|
+
const isExtglob = tok.extglob === true || extglobs.length && (tok.type === "pipe" || tok.type === "paren");
|
|
736
|
+
if (tok.type !== "slash" && tok.type !== "paren" && !isBrace && !isExtglob) {
|
|
737
|
+
state.output = state.output.slice(0, -prev.output.length);
|
|
738
|
+
prev.type = "star";
|
|
739
|
+
prev.value = "*";
|
|
740
|
+
prev.output = star;
|
|
741
|
+
state.output += prev.output;
|
|
742
|
+
}
|
|
743
|
+
}
|
|
744
|
+
if (extglobs.length && tok.type !== "paren") {
|
|
745
|
+
extglobs[extglobs.length - 1].inner += tok.value;
|
|
746
|
+
}
|
|
747
|
+
if (tok.value || tok.output) append(tok);
|
|
748
|
+
if (prev && prev.type === "text" && tok.type === "text") {
|
|
749
|
+
prev.value += tok.value;
|
|
750
|
+
prev.output = (prev.output || "") + tok.value;
|
|
751
|
+
return;
|
|
752
|
+
}
|
|
753
|
+
tok.prev = prev;
|
|
754
|
+
tokens.push(tok);
|
|
755
|
+
prev = tok;
|
|
756
|
+
}, "push");
|
|
757
|
+
const extglobOpen = /* @__PURE__ */ __name((type, value2) => {
|
|
758
|
+
const token = { ...EXTGLOB_CHARS[value2], conditions: 1, inner: "" };
|
|
759
|
+
token.prev = prev;
|
|
760
|
+
token.parens = state.parens;
|
|
761
|
+
token.output = state.output;
|
|
762
|
+
const output = (opts.capture ? "(" : "") + token.open;
|
|
763
|
+
increment("parens");
|
|
764
|
+
push({ type, value: value2, output: state.output ? "" : ONE_CHAR });
|
|
765
|
+
push({ type: "paren", extglob: true, value: advance(), output });
|
|
766
|
+
extglobs.push(token);
|
|
767
|
+
}, "extglobOpen");
|
|
768
|
+
const extglobClose = /* @__PURE__ */ __name((token) => {
|
|
769
|
+
let output = token.close + (opts.capture ? ")" : "");
|
|
770
|
+
let rest;
|
|
771
|
+
if (token.type === "negate") {
|
|
772
|
+
let extglobStar = star;
|
|
773
|
+
if (token.inner && token.inner.length > 1 && token.inner.includes("/")) {
|
|
774
|
+
extglobStar = globstar(opts);
|
|
775
|
+
}
|
|
776
|
+
if (extglobStar !== star || eos() || /^\)+$/.test(remaining())) {
|
|
777
|
+
output = token.close = `)$))${extglobStar}`;
|
|
778
|
+
}
|
|
779
|
+
if (token.inner.includes("*") && (rest = remaining()) && /^\.[^\\/.]+$/.test(rest)) {
|
|
780
|
+
const expression = parse(rest, { ...options, fastpaths: false }).output;
|
|
781
|
+
output = token.close = `)${expression})${extglobStar})`;
|
|
782
|
+
}
|
|
783
|
+
if (token.prev.type === "bos") {
|
|
784
|
+
state.negatedExtglob = true;
|
|
785
|
+
}
|
|
786
|
+
}
|
|
787
|
+
push({ type: "paren", extglob: true, value, output });
|
|
788
|
+
decrement("parens");
|
|
789
|
+
}, "extglobClose");
|
|
790
|
+
if (opts.fastpaths !== false && !/(^[*!]|[/()[\]{}"])/.test(input)) {
|
|
791
|
+
let backslashes = false;
|
|
792
|
+
let output = input.replace(REGEX_SPECIAL_CHARS_BACKREF, (m, esc, chars, first, rest, index) => {
|
|
793
|
+
if (first === "\\") {
|
|
794
|
+
backslashes = true;
|
|
795
|
+
return m;
|
|
796
|
+
}
|
|
797
|
+
if (first === "?") {
|
|
798
|
+
if (esc) {
|
|
799
|
+
return esc + first + (rest ? QMARK.repeat(rest.length) : "");
|
|
800
|
+
}
|
|
801
|
+
if (index === 0) {
|
|
802
|
+
return qmarkNoDot + (rest ? QMARK.repeat(rest.length) : "");
|
|
803
|
+
}
|
|
804
|
+
return QMARK.repeat(chars.length);
|
|
805
|
+
}
|
|
806
|
+
if (first === ".") {
|
|
807
|
+
return DOT_LITERAL.repeat(chars.length);
|
|
808
|
+
}
|
|
809
|
+
if (first === "*") {
|
|
810
|
+
if (esc) {
|
|
811
|
+
return esc + first + (rest ? star : "");
|
|
812
|
+
}
|
|
813
|
+
return star;
|
|
814
|
+
}
|
|
815
|
+
return esc ? m : `\\${m}`;
|
|
816
|
+
});
|
|
817
|
+
if (backslashes === true) {
|
|
818
|
+
if (opts.unescape === true) {
|
|
819
|
+
output = output.replace(/\\/g, "");
|
|
820
|
+
} else {
|
|
821
|
+
output = output.replace(/\\+/g, (m) => {
|
|
822
|
+
return m.length % 2 === 0 ? "\\\\" : m ? "\\" : "";
|
|
823
|
+
});
|
|
824
|
+
}
|
|
825
|
+
}
|
|
826
|
+
if (output === input && opts.contains === true) {
|
|
827
|
+
state.output = input;
|
|
828
|
+
return state;
|
|
829
|
+
}
|
|
830
|
+
state.output = utils.wrapOutput(output, state, options);
|
|
831
|
+
return state;
|
|
832
|
+
}
|
|
833
|
+
while (!eos()) {
|
|
834
|
+
value = advance();
|
|
835
|
+
if (value === "\0") {
|
|
836
|
+
continue;
|
|
837
|
+
}
|
|
838
|
+
if (value === "\\") {
|
|
839
|
+
const next = peek();
|
|
840
|
+
if (next === "/" && opts.bash !== true) {
|
|
841
|
+
continue;
|
|
842
|
+
}
|
|
843
|
+
if (next === "." || next === ";") {
|
|
844
|
+
continue;
|
|
845
|
+
}
|
|
846
|
+
if (!next) {
|
|
847
|
+
value += "\\";
|
|
848
|
+
push({ type: "text", value });
|
|
849
|
+
continue;
|
|
850
|
+
}
|
|
851
|
+
const match = /^\\+/.exec(remaining());
|
|
852
|
+
let slashes = 0;
|
|
853
|
+
if (match && match[0].length > 2) {
|
|
854
|
+
slashes = match[0].length;
|
|
855
|
+
state.index += slashes;
|
|
856
|
+
if (slashes % 2 !== 0) {
|
|
857
|
+
value += "\\";
|
|
858
|
+
}
|
|
859
|
+
}
|
|
860
|
+
if (opts.unescape === true) {
|
|
861
|
+
value = advance();
|
|
862
|
+
} else {
|
|
863
|
+
value += advance();
|
|
864
|
+
}
|
|
865
|
+
if (state.brackets === 0) {
|
|
866
|
+
push({ type: "text", value });
|
|
867
|
+
continue;
|
|
868
|
+
}
|
|
869
|
+
}
|
|
870
|
+
if (state.brackets > 0 && (value !== "]" || prev.value === "[" || prev.value === "[^")) {
|
|
871
|
+
if (opts.posix !== false && value === ":") {
|
|
872
|
+
const inner = prev.value.slice(1);
|
|
873
|
+
if (inner.includes("[")) {
|
|
874
|
+
prev.posix = true;
|
|
875
|
+
if (inner.includes(":")) {
|
|
876
|
+
const idx = prev.value.lastIndexOf("[");
|
|
877
|
+
const pre = prev.value.slice(0, idx);
|
|
878
|
+
const rest2 = prev.value.slice(idx + 2);
|
|
879
|
+
const posix = POSIX_REGEX_SOURCE[rest2];
|
|
880
|
+
if (posix) {
|
|
881
|
+
prev.value = pre + posix;
|
|
882
|
+
state.backtrack = true;
|
|
883
|
+
advance();
|
|
884
|
+
if (!bos.output && tokens.indexOf(prev) === 1) {
|
|
885
|
+
bos.output = ONE_CHAR;
|
|
886
|
+
}
|
|
887
|
+
continue;
|
|
888
|
+
}
|
|
889
|
+
}
|
|
890
|
+
}
|
|
891
|
+
}
|
|
892
|
+
if (value === "[" && peek() !== ":" || value === "-" && peek() === "]") {
|
|
893
|
+
value = `\\${value}`;
|
|
894
|
+
}
|
|
895
|
+
if (value === "]" && (prev.value === "[" || prev.value === "[^")) {
|
|
896
|
+
value = `\\${value}`;
|
|
897
|
+
}
|
|
898
|
+
if (opts.posix === true && value === "!" && prev.value === "[") {
|
|
899
|
+
value = "^";
|
|
900
|
+
}
|
|
901
|
+
prev.value += value;
|
|
902
|
+
append({ value });
|
|
903
|
+
continue;
|
|
904
|
+
}
|
|
905
|
+
if (state.quotes === 1 && value !== '"') {
|
|
906
|
+
value = utils.escapeRegex(value);
|
|
907
|
+
prev.value += value;
|
|
908
|
+
append({ value });
|
|
909
|
+
continue;
|
|
910
|
+
}
|
|
911
|
+
if (value === '"') {
|
|
912
|
+
state.quotes = state.quotes === 1 ? 0 : 1;
|
|
913
|
+
if (opts.keepQuotes === true) {
|
|
914
|
+
push({ type: "text", value });
|
|
915
|
+
}
|
|
916
|
+
continue;
|
|
917
|
+
}
|
|
918
|
+
if (value === "(") {
|
|
919
|
+
increment("parens");
|
|
920
|
+
push({ type: "paren", value });
|
|
921
|
+
continue;
|
|
922
|
+
}
|
|
923
|
+
if (value === ")") {
|
|
924
|
+
if (state.parens === 0 && opts.strictBrackets === true) {
|
|
925
|
+
throw new SyntaxError(syntaxError("opening", "("));
|
|
926
|
+
}
|
|
927
|
+
const extglob = extglobs[extglobs.length - 1];
|
|
928
|
+
if (extglob && state.parens === extglob.parens + 1) {
|
|
929
|
+
extglobClose(extglobs.pop());
|
|
930
|
+
continue;
|
|
931
|
+
}
|
|
932
|
+
push({ type: "paren", value, output: state.parens ? ")" : "\\)" });
|
|
933
|
+
decrement("parens");
|
|
934
|
+
continue;
|
|
935
|
+
}
|
|
936
|
+
if (value === "[") {
|
|
937
|
+
if (opts.nobracket === true || !remaining().includes("]")) {
|
|
938
|
+
if (opts.nobracket !== true && opts.strictBrackets === true) {
|
|
939
|
+
throw new SyntaxError(syntaxError("closing", "]"));
|
|
940
|
+
}
|
|
941
|
+
value = `\\${value}`;
|
|
942
|
+
} else {
|
|
943
|
+
increment("brackets");
|
|
944
|
+
}
|
|
945
|
+
push({ type: "bracket", value });
|
|
946
|
+
continue;
|
|
947
|
+
}
|
|
948
|
+
if (value === "]") {
|
|
949
|
+
if (opts.nobracket === true || prev && prev.type === "bracket" && prev.value.length === 1) {
|
|
950
|
+
push({ type: "text", value, output: `\\${value}` });
|
|
951
|
+
continue;
|
|
952
|
+
}
|
|
953
|
+
if (state.brackets === 0) {
|
|
954
|
+
if (opts.strictBrackets === true) {
|
|
955
|
+
throw new SyntaxError(syntaxError("opening", "["));
|
|
956
|
+
}
|
|
957
|
+
push({ type: "text", value, output: `\\${value}` });
|
|
958
|
+
continue;
|
|
959
|
+
}
|
|
960
|
+
decrement("brackets");
|
|
961
|
+
const prevValue = prev.value.slice(1);
|
|
962
|
+
if (prev.posix !== true && prevValue[0] === "^" && !prevValue.includes("/")) {
|
|
963
|
+
value = `/${value}`;
|
|
964
|
+
}
|
|
965
|
+
prev.value += value;
|
|
966
|
+
append({ value });
|
|
967
|
+
if (opts.literalBrackets === false || utils.hasRegexChars(prevValue)) {
|
|
968
|
+
continue;
|
|
969
|
+
}
|
|
970
|
+
const escaped = utils.escapeRegex(prev.value);
|
|
971
|
+
state.output = state.output.slice(0, -prev.value.length);
|
|
972
|
+
if (opts.literalBrackets === true) {
|
|
973
|
+
state.output += escaped;
|
|
974
|
+
prev.value = escaped;
|
|
975
|
+
continue;
|
|
976
|
+
}
|
|
977
|
+
prev.value = `(${capture}${escaped}|${prev.value})`;
|
|
978
|
+
state.output += prev.value;
|
|
979
|
+
continue;
|
|
980
|
+
}
|
|
981
|
+
if (value === "{" && opts.nobrace !== true) {
|
|
982
|
+
increment("braces");
|
|
983
|
+
const open = {
|
|
984
|
+
type: "brace",
|
|
985
|
+
value,
|
|
986
|
+
output: "(",
|
|
987
|
+
outputIndex: state.output.length,
|
|
988
|
+
tokensIndex: state.tokens.length
|
|
989
|
+
};
|
|
990
|
+
braces.push(open);
|
|
991
|
+
push(open);
|
|
992
|
+
continue;
|
|
993
|
+
}
|
|
994
|
+
if (value === "}") {
|
|
995
|
+
const brace = braces[braces.length - 1];
|
|
996
|
+
if (opts.nobrace === true || !brace) {
|
|
997
|
+
push({ type: "text", value, output: value });
|
|
998
|
+
continue;
|
|
999
|
+
}
|
|
1000
|
+
let output = ")";
|
|
1001
|
+
if (brace.dots === true) {
|
|
1002
|
+
const arr = tokens.slice();
|
|
1003
|
+
const range = [];
|
|
1004
|
+
for (let i = arr.length - 1; i >= 0; i--) {
|
|
1005
|
+
tokens.pop();
|
|
1006
|
+
if (arr[i].type === "brace") {
|
|
1007
|
+
break;
|
|
1008
|
+
}
|
|
1009
|
+
if (arr[i].type !== "dots") {
|
|
1010
|
+
range.unshift(arr[i].value);
|
|
1011
|
+
}
|
|
1012
|
+
}
|
|
1013
|
+
output = expandRange(range, opts);
|
|
1014
|
+
state.backtrack = true;
|
|
1015
|
+
}
|
|
1016
|
+
if (brace.comma !== true && brace.dots !== true) {
|
|
1017
|
+
const out = state.output.slice(0, brace.outputIndex);
|
|
1018
|
+
const toks = state.tokens.slice(brace.tokensIndex);
|
|
1019
|
+
brace.value = brace.output = "\\{";
|
|
1020
|
+
value = output = "\\}";
|
|
1021
|
+
state.output = out;
|
|
1022
|
+
for (const t of toks) {
|
|
1023
|
+
state.output += t.output || t.value;
|
|
1024
|
+
}
|
|
1025
|
+
}
|
|
1026
|
+
push({ type: "brace", value, output });
|
|
1027
|
+
decrement("braces");
|
|
1028
|
+
braces.pop();
|
|
1029
|
+
continue;
|
|
1030
|
+
}
|
|
1031
|
+
if (value === "|") {
|
|
1032
|
+
if (extglobs.length > 0) {
|
|
1033
|
+
extglobs[extglobs.length - 1].conditions++;
|
|
1034
|
+
}
|
|
1035
|
+
push({ type: "text", value });
|
|
1036
|
+
continue;
|
|
1037
|
+
}
|
|
1038
|
+
if (value === ",") {
|
|
1039
|
+
let output = value;
|
|
1040
|
+
const brace = braces[braces.length - 1];
|
|
1041
|
+
if (brace && stack[stack.length - 1] === "braces") {
|
|
1042
|
+
brace.comma = true;
|
|
1043
|
+
output = "|";
|
|
1044
|
+
}
|
|
1045
|
+
push({ type: "comma", value, output });
|
|
1046
|
+
continue;
|
|
1047
|
+
}
|
|
1048
|
+
if (value === "/") {
|
|
1049
|
+
if (prev.type === "dot" && state.index === state.start + 1) {
|
|
1050
|
+
state.start = state.index + 1;
|
|
1051
|
+
state.consumed = "";
|
|
1052
|
+
state.output = "";
|
|
1053
|
+
tokens.pop();
|
|
1054
|
+
prev = bos;
|
|
1055
|
+
continue;
|
|
1056
|
+
}
|
|
1057
|
+
push({ type: "slash", value, output: SLASH_LITERAL });
|
|
1058
|
+
continue;
|
|
1059
|
+
}
|
|
1060
|
+
if (value === ".") {
|
|
1061
|
+
if (state.braces > 0 && prev.type === "dot") {
|
|
1062
|
+
if (prev.value === ".") prev.output = DOT_LITERAL;
|
|
1063
|
+
const brace = braces[braces.length - 1];
|
|
1064
|
+
prev.type = "dots";
|
|
1065
|
+
prev.output += value;
|
|
1066
|
+
prev.value += value;
|
|
1067
|
+
brace.dots = true;
|
|
1068
|
+
continue;
|
|
1069
|
+
}
|
|
1070
|
+
if (state.braces + state.parens === 0 && prev.type !== "bos" && prev.type !== "slash") {
|
|
1071
|
+
push({ type: "text", value, output: DOT_LITERAL });
|
|
1072
|
+
continue;
|
|
1073
|
+
}
|
|
1074
|
+
push({ type: "dot", value, output: DOT_LITERAL });
|
|
1075
|
+
continue;
|
|
1076
|
+
}
|
|
1077
|
+
if (value === "?") {
|
|
1078
|
+
const isGroup = prev && prev.value === "(";
|
|
1079
|
+
if (!isGroup && opts.noextglob !== true && peek() === "(" && peek(2) !== "?") {
|
|
1080
|
+
extglobOpen("qmark", value);
|
|
1081
|
+
continue;
|
|
1082
|
+
}
|
|
1083
|
+
if (prev && prev.type === "paren") {
|
|
1084
|
+
const next = peek();
|
|
1085
|
+
let output = value;
|
|
1086
|
+
if (next === "<" && !utils.supportsLookbehinds()) {
|
|
1087
|
+
throw new Error("Node.js v10 or higher is required for regex lookbehinds");
|
|
1088
|
+
}
|
|
1089
|
+
if (prev.value === "(" && !/[!=<:]/.test(next) || next === "<" && !/<([!=]|\w+>)/.test(remaining())) {
|
|
1090
|
+
output = `\\${value}`;
|
|
1091
|
+
}
|
|
1092
|
+
push({ type: "text", value, output });
|
|
1093
|
+
continue;
|
|
1094
|
+
}
|
|
1095
|
+
if (opts.dot !== true && (prev.type === "slash" || prev.type === "bos")) {
|
|
1096
|
+
push({ type: "qmark", value, output: QMARK_NO_DOT });
|
|
1097
|
+
continue;
|
|
1098
|
+
}
|
|
1099
|
+
push({ type: "qmark", value, output: QMARK });
|
|
1100
|
+
continue;
|
|
1101
|
+
}
|
|
1102
|
+
if (value === "!") {
|
|
1103
|
+
if (opts.noextglob !== true && peek() === "(") {
|
|
1104
|
+
if (peek(2) !== "?" || !/[!=<:]/.test(peek(3))) {
|
|
1105
|
+
extglobOpen("negate", value);
|
|
1106
|
+
continue;
|
|
1107
|
+
}
|
|
1108
|
+
}
|
|
1109
|
+
if (opts.nonegate !== true && state.index === 0) {
|
|
1110
|
+
negate();
|
|
1111
|
+
continue;
|
|
1112
|
+
}
|
|
1113
|
+
}
|
|
1114
|
+
if (value === "+") {
|
|
1115
|
+
if (opts.noextglob !== true && peek() === "(" && peek(2) !== "?") {
|
|
1116
|
+
extglobOpen("plus", value);
|
|
1117
|
+
continue;
|
|
1118
|
+
}
|
|
1119
|
+
if (prev && prev.value === "(" || opts.regex === false) {
|
|
1120
|
+
push({ type: "plus", value, output: PLUS_LITERAL });
|
|
1121
|
+
continue;
|
|
1122
|
+
}
|
|
1123
|
+
if (prev && (prev.type === "bracket" || prev.type === "paren" || prev.type === "brace") || state.parens > 0) {
|
|
1124
|
+
push({ type: "plus", value });
|
|
1125
|
+
continue;
|
|
1126
|
+
}
|
|
1127
|
+
push({ type: "plus", value: PLUS_LITERAL });
|
|
1128
|
+
continue;
|
|
1129
|
+
}
|
|
1130
|
+
if (value === "@") {
|
|
1131
|
+
if (opts.noextglob !== true && peek() === "(" && peek(2) !== "?") {
|
|
1132
|
+
push({ type: "at", extglob: true, value, output: "" });
|
|
1133
|
+
continue;
|
|
1134
|
+
}
|
|
1135
|
+
push({ type: "text", value });
|
|
1136
|
+
continue;
|
|
1137
|
+
}
|
|
1138
|
+
if (value !== "*") {
|
|
1139
|
+
if (value === "$" || value === "^") {
|
|
1140
|
+
value = `\\${value}`;
|
|
1141
|
+
}
|
|
1142
|
+
const match = REGEX_NON_SPECIAL_CHARS.exec(remaining());
|
|
1143
|
+
if (match) {
|
|
1144
|
+
value += match[0];
|
|
1145
|
+
state.index += match[0].length;
|
|
1146
|
+
}
|
|
1147
|
+
push({ type: "text", value });
|
|
1148
|
+
continue;
|
|
1149
|
+
}
|
|
1150
|
+
if (prev && (prev.type === "globstar" || prev.star === true)) {
|
|
1151
|
+
prev.type = "star";
|
|
1152
|
+
prev.star = true;
|
|
1153
|
+
prev.value += value;
|
|
1154
|
+
prev.output = star;
|
|
1155
|
+
state.backtrack = true;
|
|
1156
|
+
state.globstar = true;
|
|
1157
|
+
consume(value);
|
|
1158
|
+
continue;
|
|
1159
|
+
}
|
|
1160
|
+
let rest = remaining();
|
|
1161
|
+
if (opts.noextglob !== true && /^\([^?]/.test(rest)) {
|
|
1162
|
+
extglobOpen("star", value);
|
|
1163
|
+
continue;
|
|
1164
|
+
}
|
|
1165
|
+
if (prev.type === "star") {
|
|
1166
|
+
if (opts.noglobstar === true) {
|
|
1167
|
+
consume(value);
|
|
1168
|
+
continue;
|
|
1169
|
+
}
|
|
1170
|
+
const prior = prev.prev;
|
|
1171
|
+
const before = prior.prev;
|
|
1172
|
+
const isStart = prior.type === "slash" || prior.type === "bos";
|
|
1173
|
+
const afterStar = before && (before.type === "star" || before.type === "globstar");
|
|
1174
|
+
if (opts.bash === true && (!isStart || rest[0] && rest[0] !== "/")) {
|
|
1175
|
+
push({ type: "star", value, output: "" });
|
|
1176
|
+
continue;
|
|
1177
|
+
}
|
|
1178
|
+
const isBrace = state.braces > 0 && (prior.type === "comma" || prior.type === "brace");
|
|
1179
|
+
const isExtglob = extglobs.length && (prior.type === "pipe" || prior.type === "paren");
|
|
1180
|
+
if (!isStart && prior.type !== "paren" && !isBrace && !isExtglob) {
|
|
1181
|
+
push({ type: "star", value, output: "" });
|
|
1182
|
+
continue;
|
|
1183
|
+
}
|
|
1184
|
+
while (rest.slice(0, 3) === "/**") {
|
|
1185
|
+
const after = input[state.index + 4];
|
|
1186
|
+
if (after && after !== "/") {
|
|
1187
|
+
break;
|
|
1188
|
+
}
|
|
1189
|
+
rest = rest.slice(3);
|
|
1190
|
+
consume("/**", 3);
|
|
1191
|
+
}
|
|
1192
|
+
if (prior.type === "bos" && eos()) {
|
|
1193
|
+
prev.type = "globstar";
|
|
1194
|
+
prev.value += value;
|
|
1195
|
+
prev.output = globstar(opts);
|
|
1196
|
+
state.output = prev.output;
|
|
1197
|
+
state.globstar = true;
|
|
1198
|
+
consume(value);
|
|
1199
|
+
continue;
|
|
1200
|
+
}
|
|
1201
|
+
if (prior.type === "slash" && prior.prev.type !== "bos" && !afterStar && eos()) {
|
|
1202
|
+
state.output = state.output.slice(0, -(prior.output + prev.output).length);
|
|
1203
|
+
prior.output = `(?:${prior.output}`;
|
|
1204
|
+
prev.type = "globstar";
|
|
1205
|
+
prev.output = globstar(opts) + (opts.strictSlashes ? ")" : "|$)");
|
|
1206
|
+
prev.value += value;
|
|
1207
|
+
state.globstar = true;
|
|
1208
|
+
state.output += prior.output + prev.output;
|
|
1209
|
+
consume(value);
|
|
1210
|
+
continue;
|
|
1211
|
+
}
|
|
1212
|
+
if (prior.type === "slash" && prior.prev.type !== "bos" && rest[0] === "/") {
|
|
1213
|
+
const end = rest[1] !== void 0 ? "|$" : "";
|
|
1214
|
+
state.output = state.output.slice(0, -(prior.output + prev.output).length);
|
|
1215
|
+
prior.output = `(?:${prior.output}`;
|
|
1216
|
+
prev.type = "globstar";
|
|
1217
|
+
prev.output = `${globstar(opts)}${SLASH_LITERAL}|${SLASH_LITERAL}${end})`;
|
|
1218
|
+
prev.value += value;
|
|
1219
|
+
state.output += prior.output + prev.output;
|
|
1220
|
+
state.globstar = true;
|
|
1221
|
+
consume(value + advance());
|
|
1222
|
+
push({ type: "slash", value: "/", output: "" });
|
|
1223
|
+
continue;
|
|
1224
|
+
}
|
|
1225
|
+
if (prior.type === "bos" && rest[0] === "/") {
|
|
1226
|
+
prev.type = "globstar";
|
|
1227
|
+
prev.value += value;
|
|
1228
|
+
prev.output = `(?:^|${SLASH_LITERAL}|${globstar(opts)}${SLASH_LITERAL})`;
|
|
1229
|
+
state.output = prev.output;
|
|
1230
|
+
state.globstar = true;
|
|
1231
|
+
consume(value + advance());
|
|
1232
|
+
push({ type: "slash", value: "/", output: "" });
|
|
1233
|
+
continue;
|
|
1234
|
+
}
|
|
1235
|
+
state.output = state.output.slice(0, -prev.output.length);
|
|
1236
|
+
prev.type = "globstar";
|
|
1237
|
+
prev.output = globstar(opts);
|
|
1238
|
+
prev.value += value;
|
|
1239
|
+
state.output += prev.output;
|
|
1240
|
+
state.globstar = true;
|
|
1241
|
+
consume(value);
|
|
1242
|
+
continue;
|
|
1243
|
+
}
|
|
1244
|
+
const token = { type: "star", value, output: star };
|
|
1245
|
+
if (opts.bash === true) {
|
|
1246
|
+
token.output = ".*?";
|
|
1247
|
+
if (prev.type === "bos" || prev.type === "slash") {
|
|
1248
|
+
token.output = nodot + token.output;
|
|
1249
|
+
}
|
|
1250
|
+
push(token);
|
|
1251
|
+
continue;
|
|
1252
|
+
}
|
|
1253
|
+
if (prev && (prev.type === "bracket" || prev.type === "paren") && opts.regex === true) {
|
|
1254
|
+
token.output = value;
|
|
1255
|
+
push(token);
|
|
1256
|
+
continue;
|
|
1257
|
+
}
|
|
1258
|
+
if (state.index === state.start || prev.type === "slash" || prev.type === "dot") {
|
|
1259
|
+
if (prev.type === "dot") {
|
|
1260
|
+
state.output += NO_DOT_SLASH;
|
|
1261
|
+
prev.output += NO_DOT_SLASH;
|
|
1262
|
+
} else if (opts.dot === true) {
|
|
1263
|
+
state.output += NO_DOTS_SLASH;
|
|
1264
|
+
prev.output += NO_DOTS_SLASH;
|
|
1265
|
+
} else {
|
|
1266
|
+
state.output += nodot;
|
|
1267
|
+
prev.output += nodot;
|
|
1268
|
+
}
|
|
1269
|
+
if (peek() !== "*") {
|
|
1270
|
+
state.output += ONE_CHAR;
|
|
1271
|
+
prev.output += ONE_CHAR;
|
|
1272
|
+
}
|
|
1273
|
+
}
|
|
1274
|
+
push(token);
|
|
1275
|
+
}
|
|
1276
|
+
while (state.brackets > 0) {
|
|
1277
|
+
if (opts.strictBrackets === true) throw new SyntaxError(syntaxError("closing", "]"));
|
|
1278
|
+
state.output = utils.escapeLast(state.output, "[");
|
|
1279
|
+
decrement("brackets");
|
|
1280
|
+
}
|
|
1281
|
+
while (state.parens > 0) {
|
|
1282
|
+
if (opts.strictBrackets === true) throw new SyntaxError(syntaxError("closing", ")"));
|
|
1283
|
+
state.output = utils.escapeLast(state.output, "(");
|
|
1284
|
+
decrement("parens");
|
|
1285
|
+
}
|
|
1286
|
+
while (state.braces > 0) {
|
|
1287
|
+
if (opts.strictBrackets === true) throw new SyntaxError(syntaxError("closing", "}"));
|
|
1288
|
+
state.output = utils.escapeLast(state.output, "{");
|
|
1289
|
+
decrement("braces");
|
|
1290
|
+
}
|
|
1291
|
+
if (opts.strictSlashes !== true && (prev.type === "star" || prev.type === "bracket")) {
|
|
1292
|
+
push({ type: "maybe_slash", value: "", output: `${SLASH_LITERAL}?` });
|
|
1293
|
+
}
|
|
1294
|
+
if (state.backtrack === true) {
|
|
1295
|
+
state.output = "";
|
|
1296
|
+
for (const token of state.tokens) {
|
|
1297
|
+
state.output += token.output != null ? token.output : token.value;
|
|
1298
|
+
if (token.suffix) {
|
|
1299
|
+
state.output += token.suffix;
|
|
1300
|
+
}
|
|
1301
|
+
}
|
|
1302
|
+
}
|
|
1303
|
+
return state;
|
|
1304
|
+
}, "parse");
|
|
1305
|
+
parse.fastpaths = (input, options) => {
|
|
1306
|
+
const opts = { ...options };
|
|
1307
|
+
const max = typeof opts.maxLength === "number" ? Math.min(MAX_LENGTH, opts.maxLength) : MAX_LENGTH;
|
|
1308
|
+
const len = input.length;
|
|
1309
|
+
if (len > max) {
|
|
1310
|
+
throw new SyntaxError(`Input length: ${len}, exceeds maximum allowed length: ${max}`);
|
|
1311
|
+
}
|
|
1312
|
+
input = REPLACEMENTS[input] || input;
|
|
1313
|
+
const win32 = utils.isWindows(options);
|
|
1314
|
+
const {
|
|
1315
|
+
DOT_LITERAL,
|
|
1316
|
+
SLASH_LITERAL,
|
|
1317
|
+
ONE_CHAR,
|
|
1318
|
+
DOTS_SLASH,
|
|
1319
|
+
NO_DOT,
|
|
1320
|
+
NO_DOTS,
|
|
1321
|
+
NO_DOTS_SLASH,
|
|
1322
|
+
STAR,
|
|
1323
|
+
START_ANCHOR
|
|
1324
|
+
} = constants.globChars(win32);
|
|
1325
|
+
const nodot = opts.dot ? NO_DOTS : NO_DOT;
|
|
1326
|
+
const slashDot = opts.dot ? NO_DOTS_SLASH : NO_DOT;
|
|
1327
|
+
const capture = opts.capture ? "" : "?:";
|
|
1328
|
+
const state = { negated: false, prefix: "" };
|
|
1329
|
+
let star = opts.bash === true ? ".*?" : STAR;
|
|
1330
|
+
if (opts.capture) {
|
|
1331
|
+
star = `(${star})`;
|
|
1332
|
+
}
|
|
1333
|
+
const globstar = /* @__PURE__ */ __name((opts2) => {
|
|
1334
|
+
if (opts2.noglobstar === true) return star;
|
|
1335
|
+
return `(${capture}(?:(?!${START_ANCHOR}${opts2.dot ? DOTS_SLASH : DOT_LITERAL}).)*?)`;
|
|
1336
|
+
}, "globstar");
|
|
1337
|
+
const create = /* @__PURE__ */ __name((str) => {
|
|
1338
|
+
switch (str) {
|
|
1339
|
+
case "*":
|
|
1340
|
+
return `${nodot}${ONE_CHAR}${star}`;
|
|
1341
|
+
case ".*":
|
|
1342
|
+
return `${DOT_LITERAL}${ONE_CHAR}${star}`;
|
|
1343
|
+
case "*.*":
|
|
1344
|
+
return `${nodot}${star}${DOT_LITERAL}${ONE_CHAR}${star}`;
|
|
1345
|
+
case "*/*":
|
|
1346
|
+
return `${nodot}${star}${SLASH_LITERAL}${ONE_CHAR}${slashDot}${star}`;
|
|
1347
|
+
case "**":
|
|
1348
|
+
return nodot + globstar(opts);
|
|
1349
|
+
case "**/*":
|
|
1350
|
+
return `(?:${nodot}${globstar(opts)}${SLASH_LITERAL})?${slashDot}${ONE_CHAR}${star}`;
|
|
1351
|
+
case "**/*.*":
|
|
1352
|
+
return `(?:${nodot}${globstar(opts)}${SLASH_LITERAL})?${slashDot}${star}${DOT_LITERAL}${ONE_CHAR}${star}`;
|
|
1353
|
+
case "**/.*":
|
|
1354
|
+
return `(?:${nodot}${globstar(opts)}${SLASH_LITERAL})?${DOT_LITERAL}${ONE_CHAR}${star}`;
|
|
1355
|
+
default: {
|
|
1356
|
+
const match = /^(.*?)\.(\w+)$/.exec(str);
|
|
1357
|
+
if (!match) return;
|
|
1358
|
+
const source2 = create(match[1]);
|
|
1359
|
+
if (!source2) return;
|
|
1360
|
+
return source2 + DOT_LITERAL + match[2];
|
|
1361
|
+
}
|
|
1362
|
+
}
|
|
1363
|
+
}, "create");
|
|
1364
|
+
const output = utils.removePrefix(input, state);
|
|
1365
|
+
let source = create(output);
|
|
1366
|
+
if (source && opts.strictSlashes !== true) {
|
|
1367
|
+
source += `${SLASH_LITERAL}?`;
|
|
1368
|
+
}
|
|
1369
|
+
return source;
|
|
1370
|
+
};
|
|
1371
|
+
module2.exports = parse;
|
|
1372
|
+
}
|
|
1373
|
+
});
|
|
1374
|
+
|
|
1375
|
+
// node_modules/.pnpm/picomatch@2.3.1/node_modules/picomatch/lib/picomatch.js
|
|
1376
|
+
var require_picomatch = __commonJS({
|
|
1377
|
+
"node_modules/.pnpm/picomatch@2.3.1/node_modules/picomatch/lib/picomatch.js"(exports2, module2) {
|
|
1378
|
+
"use strict";
|
|
1379
|
+
var path = require("path");
|
|
1380
|
+
var scan = require_scan();
|
|
1381
|
+
var parse = require_parse();
|
|
1382
|
+
var utils = require_utils();
|
|
1383
|
+
var constants = require_constants();
|
|
1384
|
+
var isObject = /* @__PURE__ */ __name((val) => val && typeof val === "object" && !Array.isArray(val), "isObject");
|
|
1385
|
+
var picomatch = /* @__PURE__ */ __name((glob, options, returnState = false) => {
|
|
1386
|
+
if (Array.isArray(glob)) {
|
|
1387
|
+
const fns = glob.map((input) => picomatch(input, options, returnState));
|
|
1388
|
+
const arrayMatcher = /* @__PURE__ */ __name((str) => {
|
|
1389
|
+
for (const isMatch of fns) {
|
|
1390
|
+
const state2 = isMatch(str);
|
|
1391
|
+
if (state2) return state2;
|
|
1392
|
+
}
|
|
1393
|
+
return false;
|
|
1394
|
+
}, "arrayMatcher");
|
|
1395
|
+
return arrayMatcher;
|
|
1396
|
+
}
|
|
1397
|
+
const isState = isObject(glob) && glob.tokens && glob.input;
|
|
1398
|
+
if (glob === "" || typeof glob !== "string" && !isState) {
|
|
1399
|
+
throw new TypeError("Expected pattern to be a non-empty string");
|
|
1400
|
+
}
|
|
1401
|
+
const opts = options || {};
|
|
1402
|
+
const posix = utils.isWindows(options);
|
|
1403
|
+
const regex = isState ? picomatch.compileRe(glob, options) : picomatch.makeRe(glob, options, false, true);
|
|
1404
|
+
const state = regex.state;
|
|
1405
|
+
delete regex.state;
|
|
1406
|
+
let isIgnored = /* @__PURE__ */ __name(() => false, "isIgnored");
|
|
1407
|
+
if (opts.ignore) {
|
|
1408
|
+
const ignoreOpts = { ...options, ignore: null, onMatch: null, onResult: null };
|
|
1409
|
+
isIgnored = picomatch(opts.ignore, ignoreOpts, returnState);
|
|
1410
|
+
}
|
|
1411
|
+
const matcher = /* @__PURE__ */ __name((input, returnObject = false) => {
|
|
1412
|
+
const { isMatch, match, output } = picomatch.test(input, regex, options, { glob, posix });
|
|
1413
|
+
const result = { glob, state, regex, posix, input, output, match, isMatch };
|
|
1414
|
+
if (typeof opts.onResult === "function") {
|
|
1415
|
+
opts.onResult(result);
|
|
1416
|
+
}
|
|
1417
|
+
if (isMatch === false) {
|
|
1418
|
+
result.isMatch = false;
|
|
1419
|
+
return returnObject ? result : false;
|
|
1420
|
+
}
|
|
1421
|
+
if (isIgnored(input)) {
|
|
1422
|
+
if (typeof opts.onIgnore === "function") {
|
|
1423
|
+
opts.onIgnore(result);
|
|
1424
|
+
}
|
|
1425
|
+
result.isMatch = false;
|
|
1426
|
+
return returnObject ? result : false;
|
|
1427
|
+
}
|
|
1428
|
+
if (typeof opts.onMatch === "function") {
|
|
1429
|
+
opts.onMatch(result);
|
|
1430
|
+
}
|
|
1431
|
+
return returnObject ? result : true;
|
|
1432
|
+
}, "matcher");
|
|
1433
|
+
if (returnState) {
|
|
1434
|
+
matcher.state = state;
|
|
1435
|
+
}
|
|
1436
|
+
return matcher;
|
|
1437
|
+
}, "picomatch");
|
|
1438
|
+
picomatch.test = (input, regex, options, { glob, posix } = {}) => {
|
|
1439
|
+
if (typeof input !== "string") {
|
|
1440
|
+
throw new TypeError("Expected input to be a string");
|
|
1441
|
+
}
|
|
1442
|
+
if (input === "") {
|
|
1443
|
+
return { isMatch: false, output: "" };
|
|
1444
|
+
}
|
|
1445
|
+
const opts = options || {};
|
|
1446
|
+
const format = opts.format || (posix ? utils.toPosixSlashes : null);
|
|
1447
|
+
let match = input === glob;
|
|
1448
|
+
let output = match && format ? format(input) : input;
|
|
1449
|
+
if (match === false) {
|
|
1450
|
+
output = format ? format(input) : input;
|
|
1451
|
+
match = output === glob;
|
|
1452
|
+
}
|
|
1453
|
+
if (match === false || opts.capture === true) {
|
|
1454
|
+
if (opts.matchBase === true || opts.basename === true) {
|
|
1455
|
+
match = picomatch.matchBase(input, regex, options, posix);
|
|
1456
|
+
} else {
|
|
1457
|
+
match = regex.exec(output);
|
|
1458
|
+
}
|
|
1459
|
+
}
|
|
1460
|
+
return { isMatch: Boolean(match), match, output };
|
|
1461
|
+
};
|
|
1462
|
+
picomatch.matchBase = (input, glob, options, posix = utils.isWindows(options)) => {
|
|
1463
|
+
const regex = glob instanceof RegExp ? glob : picomatch.makeRe(glob, options);
|
|
1464
|
+
return regex.test(path.basename(input));
|
|
1465
|
+
};
|
|
1466
|
+
picomatch.isMatch = (str, patterns, options) => picomatch(patterns, options)(str);
|
|
1467
|
+
picomatch.parse = (pattern, options) => {
|
|
1468
|
+
if (Array.isArray(pattern)) return pattern.map((p) => picomatch.parse(p, options));
|
|
1469
|
+
return parse(pattern, { ...options, fastpaths: false });
|
|
1470
|
+
};
|
|
1471
|
+
picomatch.scan = (input, options) => scan(input, options);
|
|
1472
|
+
picomatch.compileRe = (state, options, returnOutput = false, returnState = false) => {
|
|
1473
|
+
if (returnOutput === true) {
|
|
1474
|
+
return state.output;
|
|
1475
|
+
}
|
|
1476
|
+
const opts = options || {};
|
|
1477
|
+
const prepend = opts.contains ? "" : "^";
|
|
1478
|
+
const append = opts.contains ? "" : "$";
|
|
1479
|
+
let source = `${prepend}(?:${state.output})${append}`;
|
|
1480
|
+
if (state && state.negated === true) {
|
|
1481
|
+
source = `^(?!${source}).*$`;
|
|
1482
|
+
}
|
|
1483
|
+
const regex = picomatch.toRegex(source, options);
|
|
1484
|
+
if (returnState === true) {
|
|
1485
|
+
regex.state = state;
|
|
1486
|
+
}
|
|
1487
|
+
return regex;
|
|
1488
|
+
};
|
|
1489
|
+
picomatch.makeRe = (input, options = {}, returnOutput = false, returnState = false) => {
|
|
1490
|
+
if (!input || typeof input !== "string") {
|
|
1491
|
+
throw new TypeError("Expected a non-empty string");
|
|
1492
|
+
}
|
|
1493
|
+
let parsed = { negated: false, fastpaths: true };
|
|
1494
|
+
if (options.fastpaths !== false && (input[0] === "." || input[0] === "*")) {
|
|
1495
|
+
parsed.output = parse.fastpaths(input, options);
|
|
1496
|
+
}
|
|
1497
|
+
if (!parsed.output) {
|
|
1498
|
+
parsed = parse(input, options);
|
|
1499
|
+
}
|
|
1500
|
+
return picomatch.compileRe(parsed, options, returnOutput, returnState);
|
|
1501
|
+
};
|
|
1502
|
+
picomatch.toRegex = (source, options) => {
|
|
1503
|
+
try {
|
|
1504
|
+
const opts = options || {};
|
|
1505
|
+
return new RegExp(source, opts.flags || (opts.nocase ? "i" : ""));
|
|
1506
|
+
} catch (err) {
|
|
1507
|
+
if (options && options.debug === true) throw err;
|
|
1508
|
+
return /$^/;
|
|
1509
|
+
}
|
|
1510
|
+
};
|
|
1511
|
+
picomatch.constants = constants;
|
|
1512
|
+
module2.exports = picomatch;
|
|
1513
|
+
}
|
|
1514
|
+
});
|
|
1515
|
+
|
|
1516
|
+
// node_modules/.pnpm/picomatch@2.3.1/node_modules/picomatch/index.js
|
|
1517
|
+
var require_picomatch2 = __commonJS({
|
|
1518
|
+
"node_modules/.pnpm/picomatch@2.3.1/node_modules/picomatch/index.js"(exports2, module2) {
|
|
1519
|
+
"use strict";
|
|
1520
|
+
module2.exports = require_picomatch();
|
|
1521
|
+
}
|
|
1522
|
+
});
|
|
1523
|
+
|
|
1524
|
+
// src/external/picomatch.js
|
|
1525
|
+
module.exports = require_picomatch2();
|