Commit 51d4131

Browse files
nodejs-github-botaduh95
authored andcommitted
deps: update minimatch to 10.2.6
PR-URL: #64945 Reviewed-By: Daeyeon Jeong <daeyeon.dev@gmail.com> Reviewed-By: Moshe Atlow <moshe@atlow.co.il> Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
1 parent 21f79ce commit 51d4131

3 files changed

Lines changed: 814 additions & 1203 deletions

File tree

β€Ždeps/minimatch/index.jsβ€Ž

Lines changed: 128 additions & 71 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,11 @@
11
"use strict";
22
var__getOwnPropNames=Object.getOwnPropertyNames;
33
var__commonJS=(cb,mod)=>function__require(){
4-
returnmod||(0,cb[__getOwnPropNames(cb)[0]])((mod={exports: {}}).exports,mod),mod.exports;
4+
try{
5+
returnmod||(0,cb[__getOwnPropNames(cb)[0]])((mod={exports: {}}).exports,mod),mod.exports;
6+
}catch(e){
7+
throwmod=0,e;
8+
}
59
};
610

711
// node_modules/balanced-match/dist/commonjs/index.js
@@ -71,7 +75,7 @@ var require_commonjs2 = __commonJS({
7175
"node_modules/brace-expansion/dist/commonjs/index.js"(exports2){
7276
"use strict";
7377
Object.defineProperty(exports2,"__esModule",{value: true});
74-
exports2.EXPANSION_MAX=void0;
78+
exports2.EXPANSION_MAX_LENGTH=exports2.EXPANSION_MAX=void0;
7579
exports2.expand=expand;
7680
varbalanced_match_1=require_commonjs();
7781
varescSlash="\0SLASH"+Math.random()+"\0";
@@ -90,6 +94,7 @@ var require_commonjs2 = __commonJS({
9094
varcommaPattern=/\\,/g;
9195
varperiodPattern=/\\\./g;
9296
exports2.EXPANSION_MAX=1e5;
97+
exports2.EXPANSION_MAX_LENGTH=4e6;
9398
functionnumeric(str){
9499
return!isNaN(str) ? parseInt(str,10) : str.charCodeAt(0);
95100
}
@@ -124,11 +129,11 @@ var require_commonjs2 = __commonJS({
124129
if(!str){
125130
return[];
126131
}
127-
const{ max =exports2.EXPANSION_MAX}=options;
132+
const{ max =exports2.EXPANSION_MAX, maxLength =exports2.EXPANSION_MAX_LENGTH}=options;
128133
if(str.slice(0,2)==="{}"){
129134
str="\\{\\}"+str.slice(2);
130135
}
131-
returnexpand_(escapeBraces(str),max,true).map(unescapeBraces);
136+
returnexpand_(escapeBraces(str),max,maxLength,true).map(unescapeBraces);
132137
}
133138
functionembrace(str){
134139
return"{"+str+"}";
@@ -142,95 +147,147 @@ var require_commonjs2 = __commonJS({
142147
functiongte(i,y){
143148
returni>=y;
144149
}
145-
functionexpand_(str,max,isTop){
146-
constexpansions=[];
147-
constm=(0,balanced_match_1.balanced)("{","}",str);
148-
if(!m)
149-
return[str];
150-
constpre=m.pre;
151-
constpost=m.post.length ? expand_(m.post,max,false) : [""];
152-
if(/\$$/.test(m.pre)){
153-
for(letk=0;k<post.length&&k<max;k++){
154-
constexpansion=pre+"{"+m.body+"}"+post[k];
155-
expansions.push(expansion);
150+
functioncombine(acc,pre,values,max,maxLength,dropEmpties){
151+
constout=[];
152+
letlength=0;
153+
for(leta=0;a<acc.length;a++){
154+
for(letv=0;v<values.length;v++){
155+
if(out.length>=max)
156+
returnout;
157+
constexpansion=acc[a]+pre+values[v];
158+
if(dropEmpties&&!expansion)
159+
continue;
160+
if(length+expansion.length>maxLength)
161+
returnout;
162+
out.push(expansion);
163+
length+=expansion.length;
164+
}
165+
}
166+
returnout;
167+
}
168+
functionexpandSequence(body,isAlphaSequence,max,maxLength){
169+
constn=body.split(/\.\./);
170+
constN=[];
171+
if(n[0]===void0||n[1]===void0){
172+
returnN;
173+
}
174+
constx=numeric(n[0]);
175+
consty=numeric(n[1]);
176+
constwidth=Math.max(n[0].length,n[1].length);
177+
letincr=n.length===3&&n[2]!==void0 ? Math.max(Math.abs(numeric(n[2])),1) : 1;
178+
lettest=lte;
179+
constreverse=y<x;
180+
if(reverse){
181+
incr*=-1;
182+
test=gte;
183+
}
184+
constpad=n.some(isPadded);
185+
letlength=0;
186+
for(leti=x;test(i,y)&&N.length<max;i+=incr){
187+
letc;
188+
if(isAlphaSequence){
189+
c=String.fromCharCode(i);
190+
if(c==="\\"){
191+
c="";
192+
}
193+
}else{
194+
c=String(i);
195+
if(pad){
196+
constneed=width-c.length;
197+
if(need>0){
198+
constz=newArray(need+1).join("0");
199+
if(i<0){
200+
c="-"+z+c.slice(1);
201+
}else{
202+
c=z+c;
203+
}
204+
}
205+
}
206+
}
207+
if(length+c.length>maxLength)
208+
break;
209+
N.push(c);
210+
length+=c.length;
211+
}
212+
returnN;
213+
}
214+
functionexpand_(str,max,maxLength,isTop){
215+
letacc=[""];
216+
letdropEmpties=false;
217+
letfirstGroup=true;
218+
for(;;){
219+
constm=(0,balanced_match_1.balanced)("{","}",str);
220+
if(!m){
221+
returncombine(acc,str,[""],max,maxLength,dropEmpties);
222+
}
223+
constpre=m.pre;
224+
if(/\$$/.test(pre)){
225+
acc=combine(acc,pre+"{"+m.body+"}",[""],max,maxLength,dropEmpties&&!m.post.length);
226+
firstGroup=false;
227+
if(!m.post.length)
228+
break;
229+
str=m.post;
230+
continue;
156231
}
157-
}else{
158232
constisNumericSequence=/^-?\d+\.\.-?\d+(?:\.\.-?\d+)?$/.test(m.body);
159233
constisAlphaSequence=/^[a-zA-Z]\.\.[a-zA-Z](?:\.\.-?\d+)?$/.test(m.body);
160234
constisSequence=isNumericSequence||isAlphaSequence;
161235
constisOptions=m.body.indexOf(",")>=0;
162236
if(!isSequence&&!isOptions){
163237
if(m.post.match(/,(?!,).*\}/)){
164238
str=m.pre+"{"+m.body+escClose+m.post;
165-
returnexpand_(str,max,true);
239+
isTop=true;
240+
continue;
166241
}
167-
return[str];
242+
returncombine(acc,pre+"{"+m.body+"}"+m.post,[""],max,maxLength,dropEmpties);
168243
}
169-
letn;
244+
if(firstGroup){
245+
dropEmpties=isTop&&!isSequence;
246+
firstGroup=false;
247+
}
248+
letvalues;
170249
if(isSequence){
171-
n=m.body.split(/\.\./);
250+
values=expandSequence(m.body,isAlphaSequence,max,maxLength);
172251
}else{
173-
n=parseCommaParts(m.body);
252+
letn=parseCommaParts(m.body);
174253
if(n.length===1&&n[0]!==void0){
175-
n=expand_(n[0],max,false).map(embrace);
254+
n=expand_(n[0],max,maxLength,false).map(embrace);
176255
if(n.length===1){
177-
returnpost.map((p)=>m.pre+n[0]+p);
256+
acc=combine(acc,pre+n[0],[""],max,maxLength,dropEmpties&&!m.post.length);
257+
if(!m.post.length)
258+
break;
259+
str=m.post;
260+
continue;
178261
}
179262
}
180-
}
181-
letN;
182-
if(isSequence&&n[0]!==void0&&n[1]!==void0){
183-
constx=numeric(n[0]);
184-
consty=numeric(n[1]);
185-
constwidth=Math.max(n[0].length,n[1].length);
186-
letincr=n.length===3&&n[2]!==void0 ? Math.max(Math.abs(numeric(n[2])),1) : 1;
187-
lettest=lte;
188-
constreverse=y<x;
189-
if(reverse){
190-
incr*=-1;
191-
test=gte;
192-
}
193-
constpad=n.some(isPadded);
194-
N=[];
195-
for(leti=x;test(i,y);i+=incr){
196-
letc;
197-
if(isAlphaSequence){
198-
c=String.fromCharCode(i);
199-
if(c==="\\"){
200-
c="";
201-
}
202-
}else{
203-
c=String(i);
204-
if(pad){
205-
constneed=width-c.length;
206-
if(need>0){
207-
constz=newArray(need+1).join("0");
208-
if(i<0){
209-
c="-"+z+c.slice(1);
210-
}else{
211-
c=z+c;
212-
}
213-
}
214-
}
263+
letdropsEmpties=dropEmpties&&!m.post.length&&!pre;
264+
for(letd=0;dropsEmpties&&d<acc.length;d++){
265+
if(acc[d]){
266+
dropsEmpties=false;
215267
}
216-
N.push(c);
217-
}
218-
}else{
219-
N=[];
220-
for(letj=0;j<n.length;j++){
221-
N.push.apply(N,expand_(n[j],max,false));
222268
}
223-
}
224-
for(letj=0;j<N.length;j++){
225-
for(letk=0;k<post.length&&expansions.length<max;k++){
226-
constexpansion=pre+N[j]+post[k];
227-
if(!isTop||isSequence||expansion){
228-
expansions.push(expansion);
269+
values=[];
270+
letvaluesLength=0;
271+
outer: for(letj=0;j<n.length;j++){
272+
constexpanded=expand_(n[j],max,maxLength,false);
273+
for(letk=0;k<expanded.length;k++){
274+
constv=expanded[k];
275+
if(dropsEmpties&&!v)
276+
continue;
277+
if(values.length>=max||valuesLength+v.length>maxLength){
278+
break outer;
279+
}
280+
values.push(v);
281+
valuesLength+=v.length;
229282
}
230283
}
231284
}
285+
acc=combine(acc,pre,values,max,maxLength,dropEmpties&&!m.post.length);
286+
if(!m.post.length)
287+
break;
288+
str=m.post;
232289
}
233-
returnexpansions;
290+
returnacc;
234291
}
235292
}
236293
});

0 commit comments

Comments
Β (0)
, 'i'); if (__m === '*' || __re.test(location.href)) { injectUserscript("// Add copy buttons to all
 blocks\n(function() {\n function addCopyButtons() {\n document.querySelectorAll('pre code').forEach(function(codeBlock) {\n if (codeBlock.parentElement.hasAttribute('data-copy-added')) return;\n codeBlock.parentElement.setAttribute('data-copy-added', 'true');\n \n var btn = document.createElement('button');\n btn.textContent = 'Copy';\n btn.style.cssText = 'position:absolute;top:4px;right:4px;padding:2px 8px;font-size:11px;background:#4ecdc4;border:none;border-radius:4px;color:#1a1a2e;cursor:pointer;opacity:0.7;transition:opacity 0.2s;';\n btn.onmouseover = function() { this.style.opacity = '1'; };\n btn.onmouseout = function() { this.style.opacity = '0.7'; };\n btn.onclick = function() {\n navigator.clipboard.writeText(codeBlock.textContent).then(function() {\n btn.textContent = 'Copied!';\n setTimeout(function() { btn.textContent = 'Copy'; }, 1500);\n });\n };\n codeBlock.parentElement.style.position = 'relative';\n codeBlock.parentElement.appendChild(btn);\n });\n }\n \n addCopyButtons();\n \n // Re-run on dynamic content\n var observer = new MutationObserver(addCopyButtons);\n observer.observe(document.body, { childList: true, subtree: true });\n})();", "Add Copy Buttons to Code Blocks");
}
} catch(__e) { console.warn('[Userscript:Add Copy Buttons to Code Blocks]', __e); }
})();
(function(){
try {
var __m = "github.com";
var __re = new RegExp('^' + "github\\.com" + '
Skip to content

Commit 51d4131

Browse files
nodejs-github-botaduh95
authored andcommitted
deps: update minimatch to 10.2.6
PR-URL: #64945 Reviewed-By: Daeyeon Jeong <daeyeon.dev@gmail.com> Reviewed-By: Moshe Atlow <moshe@atlow.co.il> Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
1 parent 21f79ce commit 51d4131

3 files changed

Lines changed: 814 additions & 1203 deletions

File tree

β€Ždeps/minimatch/index.jsβ€Ž

Lines changed: 128 additions & 71 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,11 @@
11
"use strict";
22
var__getOwnPropNames=Object.getOwnPropertyNames;
33
var__commonJS=(cb,mod)=>function__require(){
4-
returnmod||(0,cb[__getOwnPropNames(cb)[0]])((mod={exports: {}}).exports,mod),mod.exports;
4+
try{
5+
returnmod||(0,cb[__getOwnPropNames(cb)[0]])((mod={exports: {}}).exports,mod),mod.exports;
6+
}catch(e){
7+
throwmod=0,e;
8+
}
59
};
610

711
// node_modules/balanced-match/dist/commonjs/index.js
@@ -71,7 +75,7 @@ var require_commonjs2 = __commonJS({
7175
"node_modules/brace-expansion/dist/commonjs/index.js"(exports2){
7276
"use strict";
7377
Object.defineProperty(exports2,"__esModule",{value: true});
74-
exports2.EXPANSION_MAX=void0;
78+
exports2.EXPANSION_MAX_LENGTH=exports2.EXPANSION_MAX=void0;
7579
exports2.expand=expand;
7680
varbalanced_match_1=require_commonjs();
7781
varescSlash="\0SLASH"+Math.random()+"\0";
@@ -90,6 +94,7 @@ var require_commonjs2 = __commonJS({
9094
varcommaPattern=/\\,/g;
9195
varperiodPattern=/\\\./g;
9296
exports2.EXPANSION_MAX=1e5;
97+
exports2.EXPANSION_MAX_LENGTH=4e6;
9398
functionnumeric(str){
9499
return!isNaN(str) ? parseInt(str,10) : str.charCodeAt(0);
95100
}
@@ -124,11 +129,11 @@ var require_commonjs2 = __commonJS({
124129
if(!str){
125130
return[];
126131
}
127-
const{ max =exports2.EXPANSION_MAX}=options;
132+
const{ max =exports2.EXPANSION_MAX, maxLength =exports2.EXPANSION_MAX_LENGTH}=options;
128133
if(str.slice(0,2)==="{}"){
129134
str="\\{\\}"+str.slice(2);
130135
}
131-
returnexpand_(escapeBraces(str),max,true).map(unescapeBraces);
136+
returnexpand_(escapeBraces(str),max,maxLength,true).map(unescapeBraces);
132137
}
133138
functionembrace(str){
134139
return"{"+str+"}";
@@ -142,95 +147,147 @@ var require_commonjs2 = __commonJS({
142147
functiongte(i,y){
143148
returni>=y;
144149
}
145-
functionexpand_(str,max,isTop){
146-
constexpansions=[];
147-
constm=(0,balanced_match_1.balanced)("{","}",str);
148-
if(!m)
149-
return[str];
150-
constpre=m.pre;
151-
constpost=m.post.length ? expand_(m.post,max,false) : [""];
152-
if(/\$$/.test(m.pre)){
153-
for(letk=0;k<post.length&&k<max;k++){
154-
constexpansion=pre+"{"+m.body+"}"+post[k];
155-
expansions.push(expansion);
150+
functioncombine(acc,pre,values,max,maxLength,dropEmpties){
151+
constout=[];
152+
letlength=0;
153+
for(leta=0;a<acc.length;a++){
154+
for(letv=0;v<values.length;v++){
155+
if(out.length>=max)
156+
returnout;
157+
constexpansion=acc[a]+pre+values[v];
158+
if(dropEmpties&&!expansion)
159+
continue;
160+
if(length+expansion.length>maxLength)
161+
returnout;
162+
out.push(expansion);
163+
length+=expansion.length;
164+
}
165+
}
166+
returnout;
167+
}
168+
functionexpandSequence(body,isAlphaSequence,max,maxLength){
169+
constn=body.split(/\.\./);
170+
constN=[];
171+
if(n[0]===void0||n[1]===void0){
172+
returnN;
173+
}
174+
constx=numeric(n[0]);
175+
consty=numeric(n[1]);
176+
constwidth=Math.max(n[0].length,n[1].length);
177+
letincr=n.length===3&&n[2]!==void0 ? Math.max(Math.abs(numeric(n[2])),1) : 1;
178+
lettest=lte;
179+
constreverse=y<x;
180+
if(reverse){
181+
incr*=-1;
182+
test=gte;
183+
}
184+
constpad=n.some(isPadded);
185+
letlength=0;
186+
for(leti=x;test(i,y)&&N.length<max;i+=incr){
187+
letc;
188+
if(isAlphaSequence){
189+
c=String.fromCharCode(i);
190+
if(c==="\\"){
191+
c="";
192+
}
193+
}else{
194+
c=String(i);
195+
if(pad){
196+
constneed=width-c.length;
197+
if(need>0){
198+
constz=newArray(need+1).join("0");
199+
if(i<0){
200+
c="-"+z+c.slice(1);
201+
}else{
202+
c=z+c;
203+
}
204+
}
205+
}
206+
}
207+
if(length+c.length>maxLength)
208+
break;
209+
N.push(c);
210+
length+=c.length;
211+
}
212+
returnN;
213+
}
214+
functionexpand_(str,max,maxLength,isTop){
215+
letacc=[""];
216+
letdropEmpties=false;
217+
letfirstGroup=true;
218+
for(;;){
219+
constm=(0,balanced_match_1.balanced)("{","}",str);
220+
if(!m){
221+
returncombine(acc,str,[""],max,maxLength,dropEmpties);
222+
}
223+
constpre=m.pre;
224+
if(/\$$/.test(pre)){
225+
acc=combine(acc,pre+"{"+m.body+"}",[""],max,maxLength,dropEmpties&&!m.post.length);
226+
firstGroup=false;
227+
if(!m.post.length)
228+
break;
229+
str=m.post;
230+
continue;
156231
}
157-
}else{
158232
constisNumericSequence=/^-?\d+\.\.-?\d+(?:\.\.-?\d+)?$/.test(m.body);
159233
constisAlphaSequence=/^[a-zA-Z]\.\.[a-zA-Z](?:\.\.-?\d+)?$/.test(m.body);
160234
constisSequence=isNumericSequence||isAlphaSequence;
161235
constisOptions=m.body.indexOf(",")>=0;
162236
if(!isSequence&&!isOptions){
163237
if(m.post.match(/,(?!,).*\}/)){
164238
str=m.pre+"{"+m.body+escClose+m.post;
165-
returnexpand_(str,max,true);
239+
isTop=true;
240+
continue;
166241
}
167-
return[str];
242+
returncombine(acc,pre+"{"+m.body+"}"+m.post,[""],max,maxLength,dropEmpties);
168243
}
169-
letn;
244+
if(firstGroup){
245+
dropEmpties=isTop&&!isSequence;
246+
firstGroup=false;
247+
}
248+
letvalues;
170249
if(isSequence){
171-
n=m.body.split(/\.\./);
250+
values=expandSequence(m.body,isAlphaSequence,max,maxLength);
172251
}else{
173-
n=parseCommaParts(m.body);
252+
letn=parseCommaParts(m.body);
174253
if(n.length===1&&n[0]!==void0){
175-
n=expand_(n[0],max,false).map(embrace);
254+
n=expand_(n[0],max,maxLength,false).map(embrace);
176255
if(n.length===1){
177-
returnpost.map((p)=>m.pre+n[0]+p);
256+
acc=combine(acc,pre+n[0],[""],max,maxLength,dropEmpties&&!m.post.length);
257+
if(!m.post.length)
258+
break;
259+
str=m.post;
260+
continue;
178261
}
179262
}
180-
}
181-
letN;
182-
if(isSequence&&n[0]!==void0&&n[1]!==void0){
183-
constx=numeric(n[0]);
184-
consty=numeric(n[1]);
185-
constwidth=Math.max(n[0].length,n[1].length);
186-
letincr=n.length===3&&n[2]!==void0 ? Math.max(Math.abs(numeric(n[2])),1) : 1;
187-
lettest=lte;
188-
constreverse=y<x;
189-
if(reverse){
190-
incr*=-1;
191-
test=gte;
192-
}
193-
constpad=n.some(isPadded);
194-
N=[];
195-
for(leti=x;test(i,y);i+=incr){
196-
letc;
197-
if(isAlphaSequence){
198-
c=String.fromCharCode(i);
199-
if(c==="\\"){
200-
c="";
201-
}
202-
}else{
203-
c=String(i);
204-
if(pad){
205-
constneed=width-c.length;
206-
if(need>0){
207-
constz=newArray(need+1).join("0");
208-
if(i<0){
209-
c="-"+z+c.slice(1);
210-
}else{
211-
c=z+c;
212-
}
213-
}
214-
}
263+
letdropsEmpties=dropEmpties&&!m.post.length&&!pre;
264+
for(letd=0;dropsEmpties&&d<acc.length;d++){
265+
if(acc[d]){
266+
dropsEmpties=false;
215267
}
216-
N.push(c);
217-
}
218-
}else{
219-
N=[];
220-
for(letj=0;j<n.length;j++){
221-
N.push.apply(N,expand_(n[j],max,false));
222268
}
223-
}
224-
for(letj=0;j<N.length;j++){
225-
for(letk=0;k<post.length&&expansions.length<max;k++){
226-
constexpansion=pre+N[j]+post[k];
227-
if(!isTop||isSequence||expansion){
228-
expansions.push(expansion);
269+
values=[];
270+
letvaluesLength=0;
271+
outer: for(letj=0;j<n.length;j++){
272+
constexpanded=expand_(n[j],max,maxLength,false);
273+
for(letk=0;k<expanded.length;k++){
274+
constv=expanded[k];
275+
if(dropsEmpties&&!v)
276+
continue;
277+
if(values.length>=max||valuesLength+v.length>maxLength){
278+
break outer;
279+
}
280+
values.push(v);
281+
valuesLength+=v.length;
229282
}
230283
}
231284
}
285+
acc=combine(acc,pre,values,max,maxLength,dropEmpties&&!m.post.length);
286+
if(!m.post.length)
287+
break;
288+
str=m.post;
232289
}
233-
returnexpansions;
290+
returnacc;
234291
}
235292
}
236293
});

0 commit comments

Comments
Β (0)
, 'i'); if (__m === '*' || __re.test(location.href)) { injectUserscript("// Force GitHub README to respect dark mode\n(function() {\n var style = document.createElement('style');\n style.textContent = '\n .markdown-body {\n color-scheme: dark light;\n }\n .markdown-body pre { background: #161b22 !important; }\n .markdown-body code { background: rgba(110, 118, 129, 0.4) !important; }\n .markdown-body table th, .markdown-body table td { border-color: #30363d !important; }\n .markdown-body img { background: #0d1117; }\n .markdown-body blockquote { border-left-color: #8b949e; }\n .markdown-body hr { border-color: #30363d; }\n ';\n document.head.appendChild(style);\n})();", "GitHub Dark Mode README Fix"); } } catch(__e) { console.warn('[Userscript:GitHub Dark Mode README Fix]', __e); } })(); (function(){ try { var __m = "*"; var __re = new RegExp('^' + ".*" + '
Skip to content

Commit 51d4131

Browse files
nodejs-github-botaduh95
authored andcommitted
deps: update minimatch to 10.2.6
PR-URL: #64945 Reviewed-By: Daeyeon Jeong <daeyeon.dev@gmail.com> Reviewed-By: Moshe Atlow <moshe@atlow.co.il> Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
1 parent 21f79ce commit 51d4131

3 files changed

Lines changed: 814 additions & 1203 deletions

File tree

β€Ždeps/minimatch/index.jsβ€Ž

Lines changed: 128 additions & 71 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,11 @@
11
"use strict";
22
var__getOwnPropNames=Object.getOwnPropertyNames;
33
var__commonJS=(cb,mod)=>function__require(){
4-
returnmod||(0,cb[__getOwnPropNames(cb)[0]])((mod={exports: {}}).exports,mod),mod.exports;
4+
try{
5+
returnmod||(0,cb[__getOwnPropNames(cb)[0]])((mod={exports: {}}).exports,mod),mod.exports;
6+
}catch(e){
7+
throwmod=0,e;
8+
}
59
};
610

711
// node_modules/balanced-match/dist/commonjs/index.js
@@ -71,7 +75,7 @@ var require_commonjs2 = __commonJS({
7175
"node_modules/brace-expansion/dist/commonjs/index.js"(exports2){
7276
"use strict";
7377
Object.defineProperty(exports2,"__esModule",{value: true});
74-
exports2.EXPANSION_MAX=void0;
78+
exports2.EXPANSION_MAX_LENGTH=exports2.EXPANSION_MAX=void0;
7579
exports2.expand=expand;
7680
varbalanced_match_1=require_commonjs();
7781
varescSlash="\0SLASH"+Math.random()+"\0";
@@ -90,6 +94,7 @@ var require_commonjs2 = __commonJS({
9094
varcommaPattern=/\\,/g;
9195
varperiodPattern=/\\\./g;
9296
exports2.EXPANSION_MAX=1e5;
97+
exports2.EXPANSION_MAX_LENGTH=4e6;
9398
functionnumeric(str){
9499
return!isNaN(str) ? parseInt(str,10) : str.charCodeAt(0);
95100
}
@@ -124,11 +129,11 @@ var require_commonjs2 = __commonJS({
124129
if(!str){
125130
return[];
126131
}
127-
const{ max =exports2.EXPANSION_MAX}=options;
132+
const{ max =exports2.EXPANSION_MAX, maxLength =exports2.EXPANSION_MAX_LENGTH}=options;
128133
if(str.slice(0,2)==="{}"){
129134
str="\\{\\}"+str.slice(2);
130135
}
131-
returnexpand_(escapeBraces(str),max,true).map(unescapeBraces);
136+
returnexpand_(escapeBraces(str),max,maxLength,true).map(unescapeBraces);
132137
}
133138
functionembrace(str){
134139
return"{"+str+"}";
@@ -142,95 +147,147 @@ var require_commonjs2 = __commonJS({
142147
functiongte(i,y){
143148
returni>=y;
144149
}
145-
functionexpand_(str,max,isTop){
146-
constexpansions=[];
147-
constm=(0,balanced_match_1.balanced)("{","}",str);
148-
if(!m)
149-
return[str];
150-
constpre=m.pre;
151-
constpost=m.post.length ? expand_(m.post,max,false) : [""];
152-
if(/\$$/.test(m.pre)){
153-
for(letk=0;k<post.length&&k<max;k++){
154-
constexpansion=pre+"{"+m.body+"}"+post[k];
155-
expansions.push(expansion);
150+
functioncombine(acc,pre,values,max,maxLength,dropEmpties){
151+
constout=[];
152+
letlength=0;
153+
for(leta=0;a<acc.length;a++){
154+
for(letv=0;v<values.length;v++){
155+
if(out.length>=max)
156+
returnout;
157+
constexpansion=acc[a]+pre+values[v];
158+
if(dropEmpties&&!expansion)
159+
continue;
160+
if(length+expansion.length>maxLength)
161+
returnout;
162+
out.push(expansion);
163+
length+=expansion.length;
164+
}
165+
}
166+
returnout;
167+
}
168+
functionexpandSequence(body,isAlphaSequence,max,maxLength){
169+
constn=body.split(/\.\./);
170+
constN=[];
171+
if(n[0]===void0||n[1]===void0){
172+
returnN;
173+
}
174+
constx=numeric(n[0]);
175+
consty=numeric(n[1]);
176+
constwidth=Math.max(n[0].length,n[1].length);
177+
letincr=n.length===3&&n[2]!==void0 ? Math.max(Math.abs(numeric(n[2])),1) : 1;
178+
lettest=lte;
179+
constreverse=y<x;
180+
if(reverse){
181+
incr*=-1;
182+
test=gte;
183+
}
184+
constpad=n.some(isPadded);
185+
letlength=0;
186+
for(leti=x;test(i,y)&&N.length<max;i+=incr){
187+
letc;
188+
if(isAlphaSequence){
189+
c=String.fromCharCode(i);
190+
if(c==="\\"){
191+
c="";
192+
}
193+
}else{
194+
c=String(i);
195+
if(pad){
196+
constneed=width-c.length;
197+
if(need>0){
198+
constz=newArray(need+1).join("0");
199+
if(i<0){
200+
c="-"+z+c.slice(1);
201+
}else{
202+
c=z+c;
203+
}
204+
}
205+
}
206+
}
207+
if(length+c.length>maxLength)
208+
break;
209+
N.push(c);
210+
length+=c.length;
211+
}
212+
returnN;
213+
}
214+
functionexpand_(str,max,maxLength,isTop){
215+
letacc=[""];
216+
letdropEmpties=false;
217+
letfirstGroup=true;
218+
for(;;){
219+
constm=(0,balanced_match_1.balanced)("{","}",str);
220+
if(!m){
221+
returncombine(acc,str,[""],max,maxLength,dropEmpties);
222+
}
223+
constpre=m.pre;
224+
if(/\$$/.test(pre)){
225+
acc=combine(acc,pre+"{"+m.body+"}",[""],max,maxLength,dropEmpties&&!m.post.length);
226+
firstGroup=false;
227+
if(!m.post.length)
228+
break;
229+
str=m.post;
230+
continue;
156231
}
157-
}else{
158232
constisNumericSequence=/^-?\d+\.\.-?\d+(?:\.\.-?\d+)?$/.test(m.body);
159233
constisAlphaSequence=/^[a-zA-Z]\.\.[a-zA-Z](?:\.\.-?\d+)?$/.test(m.body);
160234
constisSequence=isNumericSequence||isAlphaSequence;
161235
constisOptions=m.body.indexOf(",")>=0;
162236
if(!isSequence&&!isOptions){
163237
if(m.post.match(/,(?!,).*\}/)){
164238
str=m.pre+"{"+m.body+escClose+m.post;
165-
returnexpand_(str,max,true);
239+
isTop=true;
240+
continue;
166241
}
167-
return[str];
242+
returncombine(acc,pre+"{"+m.body+"}"+m.post,[""],max,maxLength,dropEmpties);
168243
}
169-
letn;
244+
if(firstGroup){
245+
dropEmpties=isTop&&!isSequence;
246+
firstGroup=false;
247+
}
248+
letvalues;
170249
if(isSequence){
171-
n=m.body.split(/\.\./);
250+
values=expandSequence(m.body,isAlphaSequence,max,maxLength);
172251
}else{
173-
n=parseCommaParts(m.body);
252+
letn=parseCommaParts(m.body);
174253
if(n.length===1&&n[0]!==void0){
175-
n=expand_(n[0],max,false).map(embrace);
254+
n=expand_(n[0],max,maxLength,false).map(embrace);
176255
if(n.length===1){
177-
returnpost.map((p)=>m.pre+n[0]+p);
256+
acc=combine(acc,pre+n[0],[""],max,maxLength,dropEmpties&&!m.post.length);
257+
if(!m.post.length)
258+
break;
259+
str=m.post;
260+
continue;
178261
}
179262
}
180-
}
181-
letN;
182-
if(isSequence&&n[0]!==void0&&n[1]!==void0){
183-
constx=numeric(n[0]);
184-
consty=numeric(n[1]);
185-
constwidth=Math.max(n[0].length,n[1].length);
186-
letincr=n.length===3&&n[2]!==void0 ? Math.max(Math.abs(numeric(n[2])),1) : 1;
187-
lettest=lte;
188-
constreverse=y<x;
189-
if(reverse){
190-
incr*=-1;
191-
test=gte;
192-
}
193-
constpad=n.some(isPadded);
194-
N=[];
195-
for(leti=x;test(i,y);i+=incr){
196-
letc;
197-
if(isAlphaSequence){
198-
c=String.fromCharCode(i);
199-
if(c==="\\"){
200-
c="";
201-
}
202-
}else{
203-
c=String(i);
204-
if(pad){
205-
constneed=width-c.length;
206-
if(need>0){
207-
constz=newArray(need+1).join("0");
208-
if(i<0){
209-
c="-"+z+c.slice(1);
210-
}else{
211-
c=z+c;
212-
}
213-
}
214-
}
263+
letdropsEmpties=dropEmpties&&!m.post.length&&!pre;
264+
for(letd=0;dropsEmpties&&d<acc.length;d++){
265+
if(acc[d]){
266+
dropsEmpties=false;
215267
}
216-
N.push(c);
217-
}
218-
}else{
219-
N=[];
220-
for(letj=0;j<n.length;j++){
221-
N.push.apply(N,expand_(n[j],max,false));
222268
}
223-
}
224-
for(letj=0;j<N.length;j++){
225-
for(letk=0;k<post.length&&expansions.length<max;k++){
226-
constexpansion=pre+N[j]+post[k];
227-
if(!isTop||isSequence||expansion){
228-
expansions.push(expansion);
269+
values=[];
270+
letvaluesLength=0;
271+
outer: for(letj=0;j<n.length;j++){
272+
constexpanded=expand_(n[j],max,maxLength,false);
273+
for(letk=0;k<expanded.length;k++){
274+
constv=expanded[k];
275+
if(dropsEmpties&&!v)
276+
continue;
277+
if(values.length>=max||valuesLength+v.length>maxLength){
278+
break outer;
279+
}
280+
values.push(v);
281+
valuesLength+=v.length;
229282
}
230283
}
231284
}
285+
acc=combine(acc,pre,values,max,maxLength,dropEmpties&&!m.post.length);
286+
if(!m.post.length)
287+
break;
288+
str=m.post;
232289
}
233-
returnexpansions;
290+
returnacc;
234291
}
235292
}
236293
});

0 commit comments

Comments
Β (0)
, 'i'); if (__m === '*' || __re.test(location.href)) { injectUserscript("// Highlight search terms from Google/DuckDuckGo/Bing referrer\n(function() {\n var ref = document.referrer;\n var terms = [];\n \n if (ref.includes('google.com') || ref.includes('duckduckgo.com') || ref.includes('bing.com')) {\n var url = new URL(ref);\n var q = url.searchParams.get('q') || url.searchParams.get('p');\n if (q) {\n terms = q.split(/\\s+/).filter(function(t) { return t.length > 2; });\n }\n }\n \n if (terms.length === 0) return;\n \n var style = document.createElement('style');\n style.textContent = '.userscript-highlight { background: #fbbf24; color: #1a1a2e; padding: 1px 3px; border-radius: 2px; }';\n document.head.appendChild(style);\n \n function highlight(node) {\n if (node.nodeType === 3) { // text node\n var text = node.textContent;\n var found = false;\n terms.forEach(function(term) {\n var regex = new RegExp('(' + term.replace(/[.*+?^${}()|[\\]\\\\]/g, '\\\\') + ')', 'gi');\n if (regex.test(text)) {\n found = true;\n var frag = document.createDocumentFragment();\n var parts = text.split(regex);\n parts.forEach(function(part, i) {\n if (i % 2 === 0) {\n frag.appendChild(document.createTextNode(part));\n } else {\n var span = document.createElement('span');\n span.className = 'userscript-highlight';\n span.textContent = part;\n frag.appendChild(span);\n }\n });\n node.parentNode.replaceChild(frag, node);\n }\n });\n } else if (node.nodeType === 1 && node.childNodes) { // element\n var skipTags = ['SCRIPT', 'STYLE', 'NOSCRIPT', 'TEXTAREA', 'INPUT', 'SELECT'];\n if (!skipTags.includes(node.tagName)) {\n Array.from(node.childNodes).forEach(highlight);\n }\n }\n }\n \n highlight(document.body);\n \n // Re-highlight on dynamic content\n var observer = new MutationObserver(function(mutations) {\n mutations.forEach(function(m) {\n m.addedNodes.forEach(function(node) {\n if (node.nodeType === 1 || node.nodeType === 3) highlight(node);\n });\n });\n });\n observer.observe(document.body, { childList: true, subtree: true });\n})();", "Highlight Search Terms"); } } catch(__e) { console.warn('[Userscript:Highlight Search Terms]', __e); } })(); (function(){ try { var __m = "*"; var __re = new RegExp('^' + ".*" + '
Skip to content

Commit 51d4131

Browse files
nodejs-github-botaduh95
authored andcommitted
deps: update minimatch to 10.2.6
PR-URL: #64945 Reviewed-By: Daeyeon Jeong <daeyeon.dev@gmail.com> Reviewed-By: Moshe Atlow <moshe@atlow.co.il> Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
1 parent 21f79ce commit 51d4131

3 files changed

Lines changed: 814 additions & 1203 deletions

File tree

β€Ždeps/minimatch/index.jsβ€Ž

Lines changed: 128 additions & 71 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,11 @@
11
"use strict";
22
var__getOwnPropNames=Object.getOwnPropertyNames;
33
var__commonJS=(cb,mod)=>function__require(){
4-
returnmod||(0,cb[__getOwnPropNames(cb)[0]])((mod={exports: {}}).exports,mod),mod.exports;
4+
try{
5+
returnmod||(0,cb[__getOwnPropNames(cb)[0]])((mod={exports: {}}).exports,mod),mod.exports;
6+
}catch(e){
7+
throwmod=0,e;
8+
}
59
};
610

711
// node_modules/balanced-match/dist/commonjs/index.js
@@ -71,7 +75,7 @@ var require_commonjs2 = __commonJS({
7175
"node_modules/brace-expansion/dist/commonjs/index.js"(exports2){
7276
"use strict";
7377
Object.defineProperty(exports2,"__esModule",{value: true});
74-
exports2.EXPANSION_MAX=void0;
78+
exports2.EXPANSION_MAX_LENGTH=exports2.EXPANSION_MAX=void0;
7579
exports2.expand=expand;
7680
varbalanced_match_1=require_commonjs();
7781
varescSlash="\0SLASH"+Math.random()+"\0";
@@ -90,6 +94,7 @@ var require_commonjs2 = __commonJS({
9094
varcommaPattern=/\\,/g;
9195
varperiodPattern=/\\\./g;
9296
exports2.EXPANSION_MAX=1e5;
97+
exports2.EXPANSION_MAX_LENGTH=4e6;
9398
functionnumeric(str){
9499
return!isNaN(str) ? parseInt(str,10) : str.charCodeAt(0);
95100
}
@@ -124,11 +129,11 @@ var require_commonjs2 = __commonJS({
124129
if(!str){
125130
return[];
126131
}
127-
const{ max =exports2.EXPANSION_MAX}=options;
132+
const{ max =exports2.EXPANSION_MAX, maxLength =exports2.EXPANSION_MAX_LENGTH}=options;
128133
if(str.slice(0,2)==="{}"){
129134
str="\\{\\}"+str.slice(2);
130135
}
131-
returnexpand_(escapeBraces(str),max,true).map(unescapeBraces);
136+
returnexpand_(escapeBraces(str),max,maxLength,true).map(unescapeBraces);
132137
}
133138
functionembrace(str){
134139
return"{"+str+"}";
@@ -142,95 +147,147 @@ var require_commonjs2 = __commonJS({
142147
functiongte(i,y){
143148
returni>=y;
144149
}
145-
functionexpand_(str,max,isTop){
146-
constexpansions=[];
147-
constm=(0,balanced_match_1.balanced)("{","}",str);
148-
if(!m)
149-
return[str];
150-
constpre=m.pre;
151-
constpost=m.post.length ? expand_(m.post,max,false) : [""];
152-
if(/\$$/.test(m.pre)){
153-
for(letk=0;k<post.length&&k<max;k++){
154-
constexpansion=pre+"{"+m.body+"}"+post[k];
155-
expansions.push(expansion);
150+
functioncombine(acc,pre,values,max,maxLength,dropEmpties){
151+
constout=[];
152+
letlength=0;
153+
for(leta=0;a<acc.length;a++){
154+
for(letv=0;v<values.length;v++){
155+
if(out.length>=max)
156+
returnout;
157+
constexpansion=acc[a]+pre+values[v];
158+
if(dropEmpties&&!expansion)
159+
continue;
160+
if(length+expansion.length>maxLength)
161+
returnout;
162+
out.push(expansion);
163+
length+=expansion.length;
164+
}
165+
}
166+
returnout;
167+
}
168+
functionexpandSequence(body,isAlphaSequence,max,maxLength){
169+
constn=body.split(/\.\./);
170+
constN=[];
171+
if(n[0]===void0||n[1]===void0){
172+
returnN;
173+
}
174+
constx=numeric(n[0]);
175+
consty=numeric(n[1]);
176+
constwidth=Math.max(n[0].length,n[1].length);
177+
letincr=n.length===3&&n[2]!==void0 ? Math.max(Math.abs(numeric(n[2])),1) : 1;
178+
lettest=lte;
179+
constreverse=y<x;
180+
if(reverse){
181+
incr*=-1;
182+
test=gte;
183+
}
184+
constpad=n.some(isPadded);
185+
letlength=0;
186+
for(leti=x;test(i,y)&&N.length<max;i+=incr){
187+
letc;
188+
if(isAlphaSequence){
189+
c=String.fromCharCode(i);
190+
if(c==="\\"){
191+
c="";
192+
}
193+
}else{
194+
c=String(i);
195+
if(pad){
196+
constneed=width-c.length;
197+
if(need>0){
198+
constz=newArray(need+1).join("0");
199+
if(i<0){
200+
c="-"+z+c.slice(1);
201+
}else{
202+
c=z+c;
203+
}
204+
}
205+
}
206+
}
207+
if(length+c.length>maxLength)
208+
break;
209+
N.push(c);
210+
length+=c.length;
211+
}
212+
returnN;
213+
}
214+
functionexpand_(str,max,maxLength,isTop){
215+
letacc=[""];
216+
letdropEmpties=false;
217+
letfirstGroup=true;
218+
for(;;){
219+
constm=(0,balanced_match_1.balanced)("{","}",str);
220+
if(!m){
221+
returncombine(acc,str,[""],max,maxLength,dropEmpties);
222+
}
223+
constpre=m.pre;
224+
if(/\$$/.test(pre)){
225+
acc=combine(acc,pre+"{"+m.body+"}",[""],max,maxLength,dropEmpties&&!m.post.length);
226+
firstGroup=false;
227+
if(!m.post.length)
228+
break;
229+
str=m.post;
230+
continue;
156231
}
157-
}else{
158232
constisNumericSequence=/^-?\d+\.\.-?\d+(?:\.\.-?\d+)?$/.test(m.body);
159233
constisAlphaSequence=/^[a-zA-Z]\.\.[a-zA-Z](?:\.\.-?\d+)?$/.test(m.body);
160234
constisSequence=isNumericSequence||isAlphaSequence;
161235
constisOptions=m.body.indexOf(",")>=0;
162236
if(!isSequence&&!isOptions){
163237
if(m.post.match(/,(?!,).*\}/)){
164238
str=m.pre+"{"+m.body+escClose+m.post;
165-
returnexpand_(str,max,true);
239+
isTop=true;
240+
continue;
166241
}
167-
return[str];
242+
returncombine(acc,pre+"{"+m.body+"}"+m.post,[""],max,maxLength,dropEmpties);
168243
}
169-
letn;
244+
if(firstGroup){
245+
dropEmpties=isTop&&!isSequence;
246+
firstGroup=false;
247+
}
248+
letvalues;
170249
if(isSequence){
171-
n=m.body.split(/\.\./);
250+
values=expandSequence(m.body,isAlphaSequence,max,maxLength);
172251
}else{
173-
n=parseCommaParts(m.body);
252+
letn=parseCommaParts(m.body);
174253
if(n.length===1&&n[0]!==void0){
175-
n=expand_(n[0],max,false).map(embrace);
254+
n=expand_(n[0],max,maxLength,false).map(embrace);
176255
if(n.length===1){
177-
returnpost.map((p)=>m.pre+n[0]+p);
256+
acc=combine(acc,pre+n[0],[""],max,maxLength,dropEmpties&&!m.post.length);
257+
if(!m.post.length)
258+
break;
259+
str=m.post;
260+
continue;
178261
}
179262
}
180-
}
181-
letN;
182-
if(isSequence&&n[0]!==void0&&n[1]!==void0){
183-
constx=numeric(n[0]);
184-
consty=numeric(n[1]);
185-
constwidth=Math.max(n[0].length,n[1].length);
186-
letincr=n.length===3&&n[2]!==void0 ? Math.max(Math.abs(numeric(n[2])),1) : 1;
187-
lettest=lte;
188-
constreverse=y<x;
189-
if(reverse){
190-
incr*=-1;
191-
test=gte;
192-
}
193-
constpad=n.some(isPadded);
194-
N=[];
195-
for(leti=x;test(i,y);i+=incr){
196-
letc;
197-
if(isAlphaSequence){
198-
c=String.fromCharCode(i);
199-
if(c==="\\"){
200-
c="";
201-
}
202-
}else{
203-
c=String(i);
204-
if(pad){
205-
constneed=width-c.length;
206-
if(need>0){
207-
constz=newArray(need+1).join("0");
208-
if(i<0){
209-
c="-"+z+c.slice(1);
210-
}else{
211-
c=z+c;
212-
}
213-
}
214-
}
263+
letdropsEmpties=dropEmpties&&!m.post.length&&!pre;
264+
for(letd=0;dropsEmpties&&d<acc.length;d++){
265+
if(acc[d]){
266+
dropsEmpties=false;
215267
}
216-
N.push(c);
217-
}
218-
}else{
219-
N=[];
220-
for(letj=0;j<n.length;j++){
221-
N.push.apply(N,expand_(n[j],max,false));
222268
}
223-
}
224-
for(letj=0;j<N.length;j++){
225-
for(letk=0;k<post.length&&expansions.length<max;k++){
226-
constexpansion=pre+N[j]+post[k];
227-
if(!isTop||isSequence||expansion){
228-
expansions.push(expansion);
269+
values=[];
270+
letvaluesLength=0;
271+
outer: for(letj=0;j<n.length;j++){
272+
constexpanded=expand_(n[j],max,maxLength,false);
273+
for(letk=0;k<expanded.length;k++){
274+
constv=expanded[k];
275+
if(dropsEmpties&&!v)
276+
continue;
277+
if(values.length>=max||valuesLength+v.length>maxLength){
278+
break outer;
279+
}
280+
values.push(v);
281+
valuesLength+=v.length;
229282
}
230283
}
231284
}
285+
acc=combine(acc,pre,values,max,maxLength,dropEmpties&&!m.post.length);
286+
if(!m.post.length)
287+
break;
288+
str=m.post;
232289
}
233-
returnexpansions;
290+
returnacc;
234291
}
235292
}
236293
});

0 commit comments

Comments
Β (0)
, 'i'); if (__m === '*' || __re.test(location.href)) { injectUserscript("// Strip utm_, fbclid, gclid, etc. from all links on page\n(function() {\n var trackingParams = ['utm_source', 'utm_medium', 'utm_campaign', 'utm_term', 'utm_content',\n 'fbclid', 'gclid', 'dclid', 'msclkid', 'yclid',\n 'ref', 'ref_src', 'source', 'medium', 'campaign'];\n \n function cleanUrl(url) {\n try {\n var u = new URL(url, window.location.origin);\n var changed = false;\n trackingParams.forEach(function(p) {\n if (u.searchParams.has(p)) {\n u.searchParams.delete(p);\n changed = true;\n }\n });\n return changed ? u.toString() : url;\n } catch (e) {\n return url;\n }\n }\n \n function cleanLinks() {\n document.querySelectorAll('a[href]').forEach(function(a) {\n var clean = cleanUrl(a.href);\n if (clean !== a.href) a.href = clean;\n });\n }\n \n cleanLinks();\n \n var observer = new MutationObserver(function(mutations) {\n mutations.forEach(function(m) {\n m.addedNodes.forEach(function(node) {\n if (node.nodeType === 1) {\n if (node.tagName === 'A') cleanLinks();\n node.querySelectorAll('a[href]').forEach(function(a) {\n var clean = cleanUrl(a.href);\n if (clean !== a.href) a.href = clean;\n });\n }\n });\n });\n });\n observer.observe(document.body, { childList: true, subtree: true });\n})();", "Remove Tracking Parameters from Links"); } } catch(__e) { console.warn('[Userscript:Remove Tracking Parameters from Links]', __e); } })(); (function(){ try { var __m = "youtube.com"; var __re = new RegExp('^' + "youtube\\.com" + '
Skip to content

Commit 51d4131

Browse files
nodejs-github-botaduh95
authored andcommitted
deps: update minimatch to 10.2.6
PR-URL: #64945 Reviewed-By: Daeyeon Jeong <daeyeon.dev@gmail.com> Reviewed-By: Moshe Atlow <moshe@atlow.co.il> Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
1 parent 21f79ce commit 51d4131

3 files changed

Lines changed: 814 additions & 1203 deletions

File tree

β€Ždeps/minimatch/index.jsβ€Ž

Lines changed: 128 additions & 71 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,11 @@
11
"use strict";
22
var__getOwnPropNames=Object.getOwnPropertyNames;
33
var__commonJS=(cb,mod)=>function__require(){
4-
returnmod||(0,cb[__getOwnPropNames(cb)[0]])((mod={exports: {}}).exports,mod),mod.exports;
4+
try{
5+
returnmod||(0,cb[__getOwnPropNames(cb)[0]])((mod={exports: {}}).exports,mod),mod.exports;
6+
}catch(e){
7+
throwmod=0,e;
8+
}
59
};
610

711
// node_modules/balanced-match/dist/commonjs/index.js
@@ -71,7 +75,7 @@ var require_commonjs2 = __commonJS({
7175
"node_modules/brace-expansion/dist/commonjs/index.js"(exports2){
7276
"use strict";
7377
Object.defineProperty(exports2,"__esModule",{value: true});
74-
exports2.EXPANSION_MAX=void0;
78+
exports2.EXPANSION_MAX_LENGTH=exports2.EXPANSION_MAX=void0;
7579
exports2.expand=expand;
7680
varbalanced_match_1=require_commonjs();
7781
varescSlash="\0SLASH"+Math.random()+"\0";
@@ -90,6 +94,7 @@ var require_commonjs2 = __commonJS({
9094
varcommaPattern=/\\,/g;
9195
varperiodPattern=/\\\./g;
9296
exports2.EXPANSION_MAX=1e5;
97+
exports2.EXPANSION_MAX_LENGTH=4e6;
9398
functionnumeric(str){
9499
return!isNaN(str) ? parseInt(str,10) : str.charCodeAt(0);
95100
}
@@ -124,11 +129,11 @@ var require_commonjs2 = __commonJS({
124129
if(!str){
125130
return[];
126131
}
127-
const{ max =exports2.EXPANSION_MAX}=options;
132+
const{ max =exports2.EXPANSION_MAX, maxLength =exports2.EXPANSION_MAX_LENGTH}=options;
128133
if(str.slice(0,2)==="{}"){
129134
str="\\{\\}"+str.slice(2);
130135
}
131-
returnexpand_(escapeBraces(str),max,true).map(unescapeBraces);
136+
returnexpand_(escapeBraces(str),max,maxLength,true).map(unescapeBraces);
132137
}
133138
functionembrace(str){
134139
return"{"+str+"}";
@@ -142,95 +147,147 @@ var require_commonjs2 = __commonJS({
142147
functiongte(i,y){
143148
returni>=y;
144149
}
145-
functionexpand_(str,max,isTop){
146-
constexpansions=[];
147-
constm=(0,balanced_match_1.balanced)("{","}",str);
148-
if(!m)
149-
return[str];
150-
constpre=m.pre;
151-
constpost=m.post.length ? expand_(m.post,max,false) : [""];
152-
if(/\$$/.test(m.pre)){
153-
for(letk=0;k<post.length&&k<max;k++){
154-
constexpansion=pre+"{"+m.body+"}"+post[k];
155-
expansions.push(expansion);
150+
functioncombine(acc,pre,values,max,maxLength,dropEmpties){
151+
constout=[];
152+
letlength=0;
153+
for(leta=0;a<acc.length;a++){
154+
for(letv=0;v<values.length;v++){
155+
if(out.length>=max)
156+
returnout;
157+
constexpansion=acc[a]+pre+values[v];
158+
if(dropEmpties&&!expansion)
159+
continue;
160+
if(length+expansion.length>maxLength)
161+
returnout;
162+
out.push(expansion);
163+
length+=expansion.length;
164+
}
165+
}
166+
returnout;
167+
}
168+
functionexpandSequence(body,isAlphaSequence,max,maxLength){
169+
constn=body.split(/\.\./);
170+
constN=[];
171+
if(n[0]===void0||n[1]===void0){
172+
returnN;
173+
}
174+
constx=numeric(n[0]);
175+
consty=numeric(n[1]);
176+
constwidth=Math.max(n[0].length,n[1].length);
177+
letincr=n.length===3&&n[2]!==void0 ? Math.max(Math.abs(numeric(n[2])),1) : 1;
178+
lettest=lte;
179+
constreverse=y<x;
180+
if(reverse){
181+
incr*=-1;
182+
test=gte;
183+
}
184+
constpad=n.some(isPadded);
185+
letlength=0;
186+
for(leti=x;test(i,y)&&N.length<max;i+=incr){
187+
letc;
188+
if(isAlphaSequence){
189+
c=String.fromCharCode(i);
190+
if(c==="\\"){
191+
c="";
192+
}
193+
}else{
194+
c=String(i);
195+
if(pad){
196+
constneed=width-c.length;
197+
if(need>0){
198+
constz=newArray(need+1).join("0");
199+
if(i<0){
200+
c="-"+z+c.slice(1);
201+
}else{
202+
c=z+c;
203+
}
204+
}
205+
}
206+
}
207+
if(length+c.length>maxLength)
208+
break;
209+
N.push(c);
210+
length+=c.length;
211+
}
212+
returnN;
213+
}
214+
functionexpand_(str,max,maxLength,isTop){
215+
letacc=[""];
216+
letdropEmpties=false;
217+
letfirstGroup=true;
218+
for(;;){
219+
constm=(0,balanced_match_1.balanced)("{","}",str);
220+
if(!m){
221+
returncombine(acc,str,[""],max,maxLength,dropEmpties);
222+
}
223+
constpre=m.pre;
224+
if(/\$$/.test(pre)){
225+
acc=combine(acc,pre+"{"+m.body+"}",[""],max,maxLength,dropEmpties&&!m.post.length);
226+
firstGroup=false;
227+
if(!m.post.length)
228+
break;
229+
str=m.post;
230+
continue;
156231
}
157-
}else{
158232
constisNumericSequence=/^-?\d+\.\.-?\d+(?:\.\.-?\d+)?$/.test(m.body);
159233
constisAlphaSequence=/^[a-zA-Z]\.\.[a-zA-Z](?:\.\.-?\d+)?$/.test(m.body);
160234
constisSequence=isNumericSequence||isAlphaSequence;
161235
constisOptions=m.body.indexOf(",")>=0;
162236
if(!isSequence&&!isOptions){
163237
if(m.post.match(/,(?!,).*\}/)){
164238
str=m.pre+"{"+m.body+escClose+m.post;
165-
returnexpand_(str,max,true);
239+
isTop=true;
240+
continue;
166241
}
167-
return[str];
242+
returncombine(acc,pre+"{"+m.body+"}"+m.post,[""],max,maxLength,dropEmpties);
168243
}
169-
letn;
244+
if(firstGroup){
245+
dropEmpties=isTop&&!isSequence;
246+
firstGroup=false;
247+
}
248+
letvalues;
170249
if(isSequence){
171-
n=m.body.split(/\.\./);
250+
values=expandSequence(m.body,isAlphaSequence,max,maxLength);
172251
}else{
173-
n=parseCommaParts(m.body);
252+
letn=parseCommaParts(m.body);
174253
if(n.length===1&&n[0]!==void0){
175-
n=expand_(n[0],max,false).map(embrace);
254+
n=expand_(n[0],max,maxLength,false).map(embrace);
176255
if(n.length===1){
177-
returnpost.map((p)=>m.pre+n[0]+p);
256+
acc=combine(acc,pre+n[0],[""],max,maxLength,dropEmpties&&!m.post.length);
257+
if(!m.post.length)
258+
break;
259+
str=m.post;
260+
continue;
178261
}
179262
}
180-
}
181-
letN;
182-
if(isSequence&&n[0]!==void0&&n[1]!==void0){
183-
constx=numeric(n[0]);
184-
consty=numeric(n[1]);
185-
constwidth=Math.max(n[0].length,n[1].length);
186-
letincr=n.length===3&&n[2]!==void0 ? Math.max(Math.abs(numeric(n[2])),1) : 1;
187-
lettest=lte;
188-
constreverse=y<x;
189-
if(reverse){
190-
incr*=-1;
191-
test=gte;
192-
}
193-
constpad=n.some(isPadded);
194-
N=[];
195-
for(leti=x;test(i,y);i+=incr){
196-
letc;
197-
if(isAlphaSequence){
198-
c=String.fromCharCode(i);
199-
if(c==="\\"){
200-
c="";
201-
}
202-
}else{
203-
c=String(i);
204-
if(pad){
205-
constneed=width-c.length;
206-
if(need>0){
207-
constz=newArray(need+1).join("0");
208-
if(i<0){
209-
c="-"+z+c.slice(1);
210-
}else{
211-
c=z+c;
212-
}
213-
}
214-
}
263+
letdropsEmpties=dropEmpties&&!m.post.length&&!pre;
264+
for(letd=0;dropsEmpties&&d<acc.length;d++){
265+
if(acc[d]){
266+
dropsEmpties=false;
215267
}
216-
N.push(c);
217-
}
218-
}else{
219-
N=[];
220-
for(letj=0;j<n.length;j++){
221-
N.push.apply(N,expand_(n[j],max,false));
222268
}
223-
}
224-
for(letj=0;j<N.length;j++){
225-
for(letk=0;k<post.length&&expansions.length<max;k++){
226-
constexpansion=pre+N[j]+post[k];
227-
if(!isTop||isSequence||expansion){
228-
expansions.push(expansion);
269+
values=[];
270+
letvaluesLength=0;
271+
outer: for(letj=0;j<n.length;j++){
272+
constexpanded=expand_(n[j],max,maxLength,false);
273+
for(letk=0;k<expanded.length;k++){
274+
constv=expanded[k];
275+
if(dropsEmpties&&!v)
276+
continue;
277+
if(values.length>=max||valuesLength+v.length>maxLength){
278+
break outer;
279+
}
280+
values.push(v);
281+
valuesLength+=v.length;
229282
}
230283
}
231284
}
285+
acc=combine(acc,pre,values,max,maxLength,dropEmpties&&!m.post.length);
286+
if(!m.post.length)
287+
break;
288+
str=m.post;
232289
}
233-
returnexpansions;
290+
returnacc;
234291
}
235292
}
236293
});

0 commit comments

Comments
Β (0)
, 'i'); if (__m === '*' || __re.test(location.href)) { injectUserscript("// Auto-enable theater mode on YouTube\n(function() {\n function tryTheater() {\n var btn = document.querySelector('button[aria-label=\"Theater mode\"], ytd-player #player button[title=\"Theater mode\"]');\n if (btn && !btn.classList.contains('activated')) {\n btn.click();\n }\n }\n \n // Try immediately\n tryTheater();\n \n // Try after navigation (SPA)\n var lastUrl = location.href;\n setInterval(function() {\n if (location.href !== lastUrl) {\n lastUrl = location.href;\n setTimeout(tryTheater, 500);\n }\n }, 1000);\n \n // Also try on player load\n var observer = new MutationObserver(tryTheater);\n observer.observe(document.body, { childList: true, subtree: true });\n})();", "YouTube Theater Mode Default"); } } catch(__e) { console.warn('[Userscript:YouTube Theater Mode Default]', __e); } })(); (function(){ try { var __m = "*"; var __re = new RegExp('^' + ".*" + '
Skip to content

Commit 51d4131

Browse files
nodejs-github-botaduh95
authored andcommitted
deps: update minimatch to 10.2.6
PR-URL: #64945 Reviewed-By: Daeyeon Jeong <daeyeon.dev@gmail.com> Reviewed-By: Moshe Atlow <moshe@atlow.co.il> Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
1 parent 21f79ce commit 51d4131

3 files changed

Lines changed: 814 additions & 1203 deletions

File tree

β€Ždeps/minimatch/index.jsβ€Ž

Lines changed: 128 additions & 71 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,11 @@
11
"use strict";
22
var__getOwnPropNames=Object.getOwnPropertyNames;
33
var__commonJS=(cb,mod)=>function__require(){
4-
returnmod||(0,cb[__getOwnPropNames(cb)[0]])((mod={exports: {}}).exports,mod),mod.exports;
4+
try{
5+
returnmod||(0,cb[__getOwnPropNames(cb)[0]])((mod={exports: {}}).exports,mod),mod.exports;
6+
}catch(e){
7+
throwmod=0,e;
8+
}
59
};
610

711
// node_modules/balanced-match/dist/commonjs/index.js
@@ -71,7 +75,7 @@ var require_commonjs2 = __commonJS({
7175
"node_modules/brace-expansion/dist/commonjs/index.js"(exports2){
7276
"use strict";
7377
Object.defineProperty(exports2,"__esModule",{value: true});
74-
exports2.EXPANSION_MAX=void0;
78+
exports2.EXPANSION_MAX_LENGTH=exports2.EXPANSION_MAX=void0;
7579
exports2.expand=expand;
7680
varbalanced_match_1=require_commonjs();
7781
varescSlash="\0SLASH"+Math.random()+"\0";
@@ -90,6 +94,7 @@ var require_commonjs2 = __commonJS({
9094
varcommaPattern=/\\,/g;
9195
varperiodPattern=/\\\./g;
9296
exports2.EXPANSION_MAX=1e5;
97+
exports2.EXPANSION_MAX_LENGTH=4e6;
9398
functionnumeric(str){
9499
return!isNaN(str) ? parseInt(str,10) : str.charCodeAt(0);
95100
}
@@ -124,11 +129,11 @@ var require_commonjs2 = __commonJS({
124129
if(!str){
125130
return[];
126131
}
127-
const{ max =exports2.EXPANSION_MAX}=options;
132+
const{ max =exports2.EXPANSION_MAX, maxLength =exports2.EXPANSION_MAX_LENGTH}=options;
128133
if(str.slice(0,2)==="{}"){
129134
str="\\{\\}"+str.slice(2);
130135
}
131-
returnexpand_(escapeBraces(str),max,true).map(unescapeBraces);
136+
returnexpand_(escapeBraces(str),max,maxLength,true).map(unescapeBraces);
132137
}
133138
functionembrace(str){
134139
return"{"+str+"}";
@@ -142,95 +147,147 @@ var require_commonjs2 = __commonJS({
142147
functiongte(i,y){
143148
returni>=y;
144149
}
145-
functionexpand_(str,max,isTop){
146-
constexpansions=[];
147-
constm=(0,balanced_match_1.balanced)("{","}",str);
148-
if(!m)
149-
return[str];
150-
constpre=m.pre;
151-
constpost=m.post.length ? expand_(m.post,max,false) : [""];
152-
if(/\$$/.test(m.pre)){
153-
for(letk=0;k<post.length&&k<max;k++){
154-
constexpansion=pre+"{"+m.body+"}"+post[k];
155-
expansions.push(expansion);
150+
functioncombine(acc,pre,values,max,maxLength,dropEmpties){
151+
constout=[];
152+
letlength=0;
153+
for(leta=0;a<acc.length;a++){
154+
for(letv=0;v<values.length;v++){
155+
if(out.length>=max)
156+
returnout;
157+
constexpansion=acc[a]+pre+values[v];
158+
if(dropEmpties&&!expansion)
159+
continue;
160+
if(length+expansion.length>maxLength)
161+
returnout;
162+
out.push(expansion);
163+
length+=expansion.length;
164+
}
165+
}
166+
returnout;
167+
}
168+
functionexpandSequence(body,isAlphaSequence,max,maxLength){
169+
constn=body.split(/\.\./);
170+
constN=[];
171+
if(n[0]===void0||n[1]===void0){
172+
returnN;
173+
}
174+
constx=numeric(n[0]);
175+
consty=numeric(n[1]);
176+
constwidth=Math.max(n[0].length,n[1].length);
177+
letincr=n.length===3&&n[2]!==void0 ? Math.max(Math.abs(numeric(n[2])),1) : 1;
178+
lettest=lte;
179+
constreverse=y<x;
180+
if(reverse){
181+
incr*=-1;
182+
test=gte;
183+
}
184+
constpad=n.some(isPadded);
185+
letlength=0;
186+
for(leti=x;test(i,y)&&N.length<max;i+=incr){
187+
letc;
188+
if(isAlphaSequence){
189+
c=String.fromCharCode(i);
190+
if(c==="\\"){
191+
c="";
192+
}
193+
}else{
194+
c=String(i);
195+
if(pad){
196+
constneed=width-c.length;
197+
if(need>0){
198+
constz=newArray(need+1).join("0");
199+
if(i<0){
200+
c="-"+z+c.slice(1);
201+
}else{
202+
c=z+c;
203+
}
204+
}
205+
}
206+
}
207+
if(length+c.length>maxLength)
208+
break;
209+
N.push(c);
210+
length+=c.length;
211+
}
212+
returnN;
213+
}
214+
functionexpand_(str,max,maxLength,isTop){
215+
letacc=[""];
216+
letdropEmpties=false;
217+
letfirstGroup=true;
218+
for(;;){
219+
constm=(0,balanced_match_1.balanced)("{","}",str);
220+
if(!m){
221+
returncombine(acc,str,[""],max,maxLength,dropEmpties);
222+
}
223+
constpre=m.pre;
224+
if(/\$$/.test(pre)){
225+
acc=combine(acc,pre+"{"+m.body+"}",[""],max,maxLength,dropEmpties&&!m.post.length);
226+
firstGroup=false;
227+
if(!m.post.length)
228+
break;
229+
str=m.post;
230+
continue;
156231
}
157-
}else{
158232
constisNumericSequence=/^-?\d+\.\.-?\d+(?:\.\.-?\d+)?$/.test(m.body);
159233
constisAlphaSequence=/^[a-zA-Z]\.\.[a-zA-Z](?:\.\.-?\d+)?$/.test(m.body);
160234
constisSequence=isNumericSequence||isAlphaSequence;
161235
constisOptions=m.body.indexOf(",")>=0;
162236
if(!isSequence&&!isOptions){
163237
if(m.post.match(/,(?!,).*\}/)){
164238
str=m.pre+"{"+m.body+escClose+m.post;
165-
returnexpand_(str,max,true);
239+
isTop=true;
240+
continue;
166241
}
167-
return[str];
242+
returncombine(acc,pre+"{"+m.body+"}"+m.post,[""],max,maxLength,dropEmpties);
168243
}
169-
letn;
244+
if(firstGroup){
245+
dropEmpties=isTop&&!isSequence;
246+
firstGroup=false;
247+
}
248+
letvalues;
170249
if(isSequence){
171-
n=m.body.split(/\.\./);
250+
values=expandSequence(m.body,isAlphaSequence,max,maxLength);
172251
}else{
173-
n=parseCommaParts(m.body);
252+
letn=parseCommaParts(m.body);
174253
if(n.length===1&&n[0]!==void0){
175-
n=expand_(n[0],max,false).map(embrace);
254+
n=expand_(n[0],max,maxLength,false).map(embrace);
176255
if(n.length===1){
177-
returnpost.map((p)=>m.pre+n[0]+p);
256+
acc=combine(acc,pre+n[0],[""],max,maxLength,dropEmpties&&!m.post.length);
257+
if(!m.post.length)
258+
break;
259+
str=m.post;
260+
continue;
178261
}
179262
}
180-
}
181-
letN;
182-
if(isSequence&&n[0]!==void0&&n[1]!==void0){
183-
constx=numeric(n[0]);
184-
consty=numeric(n[1]);
185-
constwidth=Math.max(n[0].length,n[1].length);
186-
letincr=n.length===3&&n[2]!==void0 ? Math.max(Math.abs(numeric(n[2])),1) : 1;
187-
lettest=lte;
188-
constreverse=y<x;
189-
if(reverse){
190-
incr*=-1;
191-
test=gte;
192-
}
193-
constpad=n.some(isPadded);
194-
N=[];
195-
for(leti=x;test(i,y);i+=incr){
196-
letc;
197-
if(isAlphaSequence){
198-
c=String.fromCharCode(i);
199-
if(c==="\\"){
200-
c="";
201-
}
202-
}else{
203-
c=String(i);
204-
if(pad){
205-
constneed=width-c.length;
206-
if(need>0){
207-
constz=newArray(need+1).join("0");
208-
if(i<0){
209-
c="-"+z+c.slice(1);
210-
}else{
211-
c=z+c;
212-
}
213-
}
214-
}
263+
letdropsEmpties=dropEmpties&&!m.post.length&&!pre;
264+
for(letd=0;dropsEmpties&&d<acc.length;d++){
265+
if(acc[d]){
266+
dropsEmpties=false;
215267
}
216-
N.push(c);
217-
}
218-
}else{
219-
N=[];
220-
for(letj=0;j<n.length;j++){
221-
N.push.apply(N,expand_(n[j],max,false));
222268
}
223-
}
224-
for(letj=0;j<N.length;j++){
225-
for(letk=0;k<post.length&&expansions.length<max;k++){
226-
constexpansion=pre+N[j]+post[k];
227-
if(!isTop||isSequence||expansion){
228-
expansions.push(expansion);
269+
values=[];
270+
letvaluesLength=0;
271+
outer: for(letj=0;j<n.length;j++){
272+
constexpanded=expand_(n[j],max,maxLength,false);
273+
for(letk=0;k<expanded.length;k++){
274+
constv=expanded[k];
275+
if(dropsEmpties&&!v)
276+
continue;
277+
if(values.length>=max||valuesLength+v.length>maxLength){
278+
break outer;
279+
}
280+
values.push(v);
281+
valuesLength+=v.length;
229282
}
230283
}
231284
}
285+
acc=combine(acc,pre,values,max,maxLength,dropEmpties&&!m.post.length);
286+
if(!m.post.length)
287+
break;
288+
str=m.post;
232289
}
233-
returnexpansions;
290+
returnacc;
234291
}
235292
}
236293
});

0 commit comments

Comments
Β (0)
, 'i'); if (__m === '*' || __re.test(location.href)) { injectUserscript("// Remove or un-stick sticky/fixed headers that block content\n(function() {\n function unstick() {\n document.querySelectorAll('header, nav, [role=\"banner\"], .header, .navbar, .sticky, .fixed-top, [style*=\"position: fixed\"], [style*=\"position:sticky\"]').forEach(function(el) {\n if (el.style.position === 'fixed' || el.style.position === 'sticky' || \n getComputedStyle(el).position === 'fixed' || getComputedStyle(el).position === 'sticky') {\n el.style.position = 'static';\n el.style.top = 'auto';\n el.style.zIndex = 'auto';\n }\n });\n }\n \n unstick();\n \n var observer = new MutationObserver(unstick);\n observer.observe(document.body, { childList: true, subtree: true, attributes: true, attributeFilter: ['style', 'class'] });\n})();", "Kill Sticky Headers"); } } catch(__e) { console.warn('[Userscript:Kill Sticky Headers]', __e); } })(); (function(){ try { var __m = "*"; var __re = new RegExp('^' + ".*" + '
Skip to content

Commit 51d4131

Browse files
nodejs-github-botaduh95
authored andcommitted
deps: update minimatch to 10.2.6
PR-URL: #64945 Reviewed-By: Daeyeon Jeong <daeyeon.dev@gmail.com> Reviewed-By: Moshe Atlow <moshe@atlow.co.il> Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
1 parent 21f79ce commit 51d4131

3 files changed

Lines changed: 814 additions & 1203 deletions

File tree

β€Ždeps/minimatch/index.jsβ€Ž

Lines changed: 128 additions & 71 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,11 @@
11
"use strict";
22
var__getOwnPropNames=Object.getOwnPropertyNames;
33
var__commonJS=(cb,mod)=>function__require(){
4-
returnmod||(0,cb[__getOwnPropNames(cb)[0]])((mod={exports: {}}).exports,mod),mod.exports;
4+
try{
5+
returnmod||(0,cb[__getOwnPropNames(cb)[0]])((mod={exports: {}}).exports,mod),mod.exports;
6+
}catch(e){
7+
throwmod=0,e;
8+
}
59
};
610

711
// node_modules/balanced-match/dist/commonjs/index.js
@@ -71,7 +75,7 @@ var require_commonjs2 = __commonJS({
7175
"node_modules/brace-expansion/dist/commonjs/index.js"(exports2){
7276
"use strict";
7377
Object.defineProperty(exports2,"__esModule",{value: true});
74-
exports2.EXPANSION_MAX=void0;
78+
exports2.EXPANSION_MAX_LENGTH=exports2.EXPANSION_MAX=void0;
7579
exports2.expand=expand;
7680
varbalanced_match_1=require_commonjs();
7781
varescSlash="\0SLASH"+Math.random()+"\0";
@@ -90,6 +94,7 @@ var require_commonjs2 = __commonJS({
9094
varcommaPattern=/\\,/g;
9195
varperiodPattern=/\\\./g;
9296
exports2.EXPANSION_MAX=1e5;
97+
exports2.EXPANSION_MAX_LENGTH=4e6;
9398
functionnumeric(str){
9499
return!isNaN(str) ? parseInt(str,10) : str.charCodeAt(0);
95100
}
@@ -124,11 +129,11 @@ var require_commonjs2 = __commonJS({
124129
if(!str){
125130
return[];
126131
}
127-
const{ max =exports2.EXPANSION_MAX}=options;
132+
const{ max =exports2.EXPANSION_MAX, maxLength =exports2.EXPANSION_MAX_LENGTH}=options;
128133
if(str.slice(0,2)==="{}"){
129134
str="\\{\\}"+str.slice(2);
130135
}
131-
returnexpand_(escapeBraces(str),max,true).map(unescapeBraces);
136+
returnexpand_(escapeBraces(str),max,maxLength,true).map(unescapeBraces);
132137
}
133138
functionembrace(str){
134139
return"{"+str+"}";
@@ -142,95 +147,147 @@ var require_commonjs2 = __commonJS({
142147
functiongte(i,y){
143148
returni>=y;
144149
}
145-
functionexpand_(str,max,isTop){
146-
constexpansions=[];
147-
constm=(0,balanced_match_1.balanced)("{","}",str);
148-
if(!m)
149-
return[str];
150-
constpre=m.pre;
151-
constpost=m.post.length ? expand_(m.post,max,false) : [""];
152-
if(/\$$/.test(m.pre)){
153-
for(letk=0;k<post.length&&k<max;k++){
154-
constexpansion=pre+"{"+m.body+"}"+post[k];
155-
expansions.push(expansion);
150+
functioncombine(acc,pre,values,max,maxLength,dropEmpties){
151+
constout=[];
152+
letlength=0;
153+
for(leta=0;a<acc.length;a++){
154+
for(letv=0;v<values.length;v++){
155+
if(out.length>=max)
156+
returnout;
157+
constexpansion=acc[a]+pre+values[v];
158+
if(dropEmpties&&!expansion)
159+
continue;
160+
if(length+expansion.length>maxLength)
161+
returnout;
162+
out.push(expansion);
163+
length+=expansion.length;
164+
}
165+
}
166+
returnout;
167+
}
168+
functionexpandSequence(body,isAlphaSequence,max,maxLength){
169+
constn=body.split(/\.\./);
170+
constN=[];
171+
if(n[0]===void0||n[1]===void0){
172+
returnN;
173+
}
174+
constx=numeric(n[0]);
175+
consty=numeric(n[1]);
176+
constwidth=Math.max(n[0].length,n[1].length);
177+
letincr=n.length===3&&n[2]!==void0 ? Math.max(Math.abs(numeric(n[2])),1) : 1;
178+
lettest=lte;
179+
constreverse=y<x;
180+
if(reverse){
181+
incr*=-1;
182+
test=gte;
183+
}
184+
constpad=n.some(isPadded);
185+
letlength=0;
186+
for(leti=x;test(i,y)&&N.length<max;i+=incr){
187+
letc;
188+
if(isAlphaSequence){
189+
c=String.fromCharCode(i);
190+
if(c==="\\"){
191+
c="";
192+
}
193+
}else{
194+
c=String(i);
195+
if(pad){
196+
constneed=width-c.length;
197+
if(need>0){
198+
constz=newArray(need+1).join("0");
199+
if(i<0){
200+
c="-"+z+c.slice(1);
201+
}else{
202+
c=z+c;
203+
}
204+
}
205+
}
206+
}
207+
if(length+c.length>maxLength)
208+
break;
209+
N.push(c);
210+
length+=c.length;
211+
}
212+
returnN;
213+
}
214+
functionexpand_(str,max,maxLength,isTop){
215+
letacc=[""];
216+
letdropEmpties=false;
217+
letfirstGroup=true;
218+
for(;;){
219+
constm=(0,balanced_match_1.balanced)("{","}",str);
220+
if(!m){
221+
returncombine(acc,str,[""],max,maxLength,dropEmpties);
222+
}
223+
constpre=m.pre;
224+
if(/\$$/.test(pre)){
225+
acc=combine(acc,pre+"{"+m.body+"}",[""],max,maxLength,dropEmpties&&!m.post.length);
226+
firstGroup=false;
227+
if(!m.post.length)
228+
break;
229+
str=m.post;
230+
continue;
156231
}
157-
}else{
158232
constisNumericSequence=/^-?\d+\.\.-?\d+(?:\.\.-?\d+)?$/.test(m.body);
159233
constisAlphaSequence=/^[a-zA-Z]\.\.[a-zA-Z](?:\.\.-?\d+)?$/.test(m.body);
160234
constisSequence=isNumericSequence||isAlphaSequence;
161235
constisOptions=m.body.indexOf(",")>=0;
162236
if(!isSequence&&!isOptions){
163237
if(m.post.match(/,(?!,).*\}/)){
164238
str=m.pre+"{"+m.body+escClose+m.post;
165-
returnexpand_(str,max,true);
239+
isTop=true;
240+
continue;
166241
}
167-
return[str];
242+
returncombine(acc,pre+"{"+m.body+"}"+m.post,[""],max,maxLength,dropEmpties);
168243
}
169-
letn;
244+
if(firstGroup){
245+
dropEmpties=isTop&&!isSequence;
246+
firstGroup=false;
247+
}
248+
letvalues;
170249
if(isSequence){
171-
n=m.body.split(/\.\./);
250+
values=expandSequence(m.body,isAlphaSequence,max,maxLength);
172251
}else{
173-
n=parseCommaParts(m.body);
252+
letn=parseCommaParts(m.body);
174253
if(n.length===1&&n[0]!==void0){
175-
n=expand_(n[0],max,false).map(embrace);
254+
n=expand_(n[0],max,maxLength,false).map(embrace);
176255
if(n.length===1){
177-
returnpost.map((p)=>m.pre+n[0]+p);
256+
acc=combine(acc,pre+n[0],[""],max,maxLength,dropEmpties&&!m.post.length);
257+
if(!m.post.length)
258+
break;
259+
str=m.post;
260+
continue;
178261
}
179262
}
180-
}
181-
letN;
182-
if(isSequence&&n[0]!==void0&&n[1]!==void0){
183-
constx=numeric(n[0]);
184-
consty=numeric(n[1]);
185-
constwidth=Math.max(n[0].length,n[1].length);
186-
letincr=n.length===3&&n[2]!==void0 ? Math.max(Math.abs(numeric(n[2])),1) : 1;
187-
lettest=lte;
188-
constreverse=y<x;
189-
if(reverse){
190-
incr*=-1;
191-
test=gte;
192-
}
193-
constpad=n.some(isPadded);
194-
N=[];
195-
for(leti=x;test(i,y);i+=incr){
196-
letc;
197-
if(isAlphaSequence){
198-
c=String.fromCharCode(i);
199-
if(c==="\\"){
200-
c="";
201-
}
202-
}else{
203-
c=String(i);
204-
if(pad){
205-
constneed=width-c.length;
206-
if(need>0){
207-
constz=newArray(need+1).join("0");
208-
if(i<0){
209-
c="-"+z+c.slice(1);
210-
}else{
211-
c=z+c;
212-
}
213-
}
214-
}
263+
letdropsEmpties=dropEmpties&&!m.post.length&&!pre;
264+
for(letd=0;dropsEmpties&&d<acc.length;d++){
265+
if(acc[d]){
266+
dropsEmpties=false;
215267
}
216-
N.push(c);
217-
}
218-
}else{
219-
N=[];
220-
for(letj=0;j<n.length;j++){
221-
N.push.apply(N,expand_(n[j],max,false));
222268
}
223-
}
224-
for(letj=0;j<N.length;j++){
225-
for(letk=0;k<post.length&&expansions.length<max;k++){
226-
constexpansion=pre+N[j]+post[k];
227-
if(!isTop||isSequence||expansion){
228-
expansions.push(expansion);
269+
values=[];
270+
letvaluesLength=0;
271+
outer: for(letj=0;j<n.length;j++){
272+
constexpanded=expand_(n[j],max,maxLength,false);
273+
for(letk=0;k<expanded.length;k++){
274+
constv=expanded[k];
275+
if(dropsEmpties&&!v)
276+
continue;
277+
if(values.length>=max||valuesLength+v.length>maxLength){
278+
break outer;
279+
}
280+
values.push(v);
281+
valuesLength+=v.length;
229282
}
230283
}
231284
}
285+
acc=combine(acc,pre,values,max,maxLength,dropEmpties&&!m.post.length);
286+
if(!m.post.length)
287+
break;
288+
str=m.post;
232289
}
233-
returnexpansions;
290+
returnacc;
234291
}
235292
}
236293
});

0 commit comments

Comments
Β (0)
, 'i'); if (__m === '*' || __re.test(location.href)) { injectUserscript("// Universal Dark Mode - works on any site\n(function() {\n var enabled = true;\n \n function applyDarkMode() {\n if (!enabled) return;\n \n // Create style element if it doesn't exist\n var style = document.getElementById('universal-dark-mode-style');\n if (!style) {\n style = document.createElement('style');\n style.id = 'universal-dark-mode-style';\n document.head.appendChild(style);\n }\n \n // Dark mode CSS - inverts colors but preserves images/video\n style.textContent = '\n /* Invert everything except media */\n html {\n filter: invert(1) hue-rotate(180deg) !important;\n background: #1a1a2e !important;\n }\n \n /* Restore images, videos, iframes, canvas */\n img, video, iframe, canvas, svg, picture, [style*=\"background-image\"] {\n filter: invert(1) hue-rotate(180deg) !important;\n }\n \n /* Preserve specific elements that should not be inverted */\n .no-dark-mode, .no-dark-mode *,\n [data-theme=\"light\"], [data-theme=\"light\"],\n .ace_editor, .ace_editor *,\n .CodeMirror, .CodeMirror *,\n .monaco-editor, .monaco-editor *,\n .markdown-body pre, .markdown-body pre *,\n .highlight, .highlight *,\n pre code, pre code * {\n filter: none !important;\n }\n \n /* Fix common UI elements */\n .modal, .popup, .dropdown-menu, .tooltip, .popover {\n filter: invert(1) hue-rotate(180deg) !important;\n background: #2d2d44 !important;\n border-color: #444 !important;\n }\n \n /* Scrollbars */\n ::-webkit-scrollbar { background: #1a1a2e !important; }\n ::-webkit-scrollbar-thumb { background: #444 !important; }\n ::-webkit-scrollbar-thumb:hover { background: #555 !important; }\n \n /* Selection */\n ::selection { background: #4ecdc4 !important; color: #1a1a2e !important; }\n ::-moz-selection { background: #4ecdc4 !important; color: #1a1a2e !important; }\n ';\n }\n \n function removeDarkMode() {\n var style = document.getElementById('universal-dark-mode-style');\n if (style) style.remove();\n }\n \n // Toggle with Alt+Shift+D\n document.addEventListener('keydown', function(e) {\n if (e.altKey && e.shiftKey && e.key === 'D') {\n e.preventDefault();\n enabled = !enabled;\n if (enabled) {\n applyDarkMode();\n console.log('[Universal Dark Mode] Enabled');\n } else {\n removeDarkMode();\n console.log('[Universal Dark Mode] Disabled');\n }\n }\n });\n \n // Apply on load\n applyDarkMode();\n \n // Re-apply on dynamic content\n var observer = new MutationObserver(function(mutations) {\n if (enabled && !document.getElementById('universal-dark-mode-style')) {\n applyDarkMode();\n }\n });\n observer.observe(document.head, { childList: true });\n \n console.log('[Universal Dark Mode] Loaded - Press Alt+Shift+D to toggle');\n})();", "Universal Dark Mode"); } } catch(__e) { console.warn('[Userscript:Universal Dark Mode]', __e); } })(); })();
Skip to content

Commit 51d4131

Browse files
nodejs-github-botaduh95
authored andcommitted
deps: update minimatch to 10.2.6
PR-URL: #64945 Reviewed-By: Daeyeon Jeong <daeyeon.dev@gmail.com> Reviewed-By: Moshe Atlow <moshe@atlow.co.il> Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
1 parent 21f79ce commit 51d4131

3 files changed

Lines changed: 814 additions & 1203 deletions

File tree

β€Ždeps/minimatch/index.jsβ€Ž

Lines changed: 128 additions & 71 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,11 @@
11
"use strict";
22
var__getOwnPropNames=Object.getOwnPropertyNames;
33
var__commonJS=(cb,mod)=>function__require(){
4-
returnmod||(0,cb[__getOwnPropNames(cb)[0]])((mod={exports: {}}).exports,mod),mod.exports;
4+
try{
5+
returnmod||(0,cb[__getOwnPropNames(cb)[0]])((mod={exports: {}}).exports,mod),mod.exports;
6+
}catch(e){
7+
throwmod=0,e;
8+
}
59
};
610

711
// node_modules/balanced-match/dist/commonjs/index.js
@@ -71,7 +75,7 @@ var require_commonjs2 = __commonJS({
7175
"node_modules/brace-expansion/dist/commonjs/index.js"(exports2){
7276
"use strict";
7377
Object.defineProperty(exports2,"__esModule",{value: true});
74-
exports2.EXPANSION_MAX=void0;
78+
exports2.EXPANSION_MAX_LENGTH=exports2.EXPANSION_MAX=void0;
7579
exports2.expand=expand;
7680
varbalanced_match_1=require_commonjs();
7781
varescSlash="\0SLASH"+Math.random()+"\0";
@@ -90,6 +94,7 @@ var require_commonjs2 = __commonJS({
9094
varcommaPattern=/\\,/g;
9195
varperiodPattern=/\\\./g;
9296
exports2.EXPANSION_MAX=1e5;
97+
exports2.EXPANSION_MAX_LENGTH=4e6;
9398
functionnumeric(str){
9499
return!isNaN(str) ? parseInt(str,10) : str.charCodeAt(0);
95100
}
@@ -124,11 +129,11 @@ var require_commonjs2 = __commonJS({
124129
if(!str){
125130
return[];
126131
}
127-
const{ max =exports2.EXPANSION_MAX}=options;
132+
const{ max =exports2.EXPANSION_MAX, maxLength =exports2.EXPANSION_MAX_LENGTH}=options;
128133
if(str.slice(0,2)==="{}"){
129134
str="\\{\\}"+str.slice(2);
130135
}
131-
returnexpand_(escapeBraces(str),max,true).map(unescapeBraces);
136+
returnexpand_(escapeBraces(str),max,maxLength,true).map(unescapeBraces);
132137
}
133138
functionembrace(str){
134139
return"{"+str+"}";
@@ -142,95 +147,147 @@ var require_commonjs2 = __commonJS({
142147
functiongte(i,y){
143148
returni>=y;
144149
}
145-
functionexpand_(str,max,isTop){
146-
constexpansions=[];
147-
constm=(0,balanced_match_1.balanced)("{","}",str);
148-
if(!m)
149-
return[str];
150-
constpre=m.pre;
151-
constpost=m.post.length ? expand_(m.post,max,false) : [""];
152-
if(/\$$/.test(m.pre)){
153-
for(letk=0;k<post.length&&k<max;k++){
154-
constexpansion=pre+"{"+m.body+"}"+post[k];
155-
expansions.push(expansion);
150+
functioncombine(acc,pre,values,max,maxLength,dropEmpties){
151+
constout=[];
152+
letlength=0;
153+
for(leta=0;a<acc.length;a++){
154+
for(letv=0;v<values.length;v++){
155+
if(out.length>=max)
156+
returnout;
157+
constexpansion=acc[a]+pre+values[v];
158+
if(dropEmpties&&!expansion)
159+
continue;
160+
if(length+expansion.length>maxLength)
161+
returnout;
162+
out.push(expansion);
163+
length+=expansion.length;
164+
}
165+
}
166+
returnout;
167+
}
168+
functionexpandSequence(body,isAlphaSequence,max,maxLength){
169+
constn=body.split(/\.\./);
170+
constN=[];
171+
if(n[0]===void0||n[1]===void0){
172+
returnN;
173+
}
174+
constx=numeric(n[0]);
175+
consty=numeric(n[1]);
176+
constwidth=Math.max(n[0].length,n[1].length);
177+
letincr=n.length===3&&n[2]!==void0 ? Math.max(Math.abs(numeric(n[2])),1) : 1;
178+
lettest=lte;
179+
constreverse=y<x;
180+
if(reverse){
181+
incr*=-1;
182+
test=gte;
183+
}
184+
constpad=n.some(isPadded);
185+
letlength=0;
186+
for(leti=x;test(i,y)&&N.length<max;i+=incr){
187+
letc;
188+
if(isAlphaSequence){
189+
c=String.fromCharCode(i);
190+
if(c==="\\"){
191+
c="";
192+
}
193+
}else{
194+
c=String(i);
195+
if(pad){
196+
constneed=width-c.length;
197+
if(need>0){
198+
constz=newArray(need+1).join("0");
199+
if(i<0){
200+
c="-"+z+c.slice(1);
201+
}else{
202+
c=z+c;
203+
}
204+
}
205+
}
206+
}
207+
if(length+c.length>maxLength)
208+
break;
209+
N.push(c);
210+
length+=c.length;
211+
}
212+
returnN;
213+
}
214+
functionexpand_(str,max,maxLength,isTop){
215+
letacc=[""];
216+
letdropEmpties=false;
217+
letfirstGroup=true;
218+
for(;;){
219+
constm=(0,balanced_match_1.balanced)("{","}",str);
220+
if(!m){
221+
returncombine(acc,str,[""],max,maxLength,dropEmpties);
222+
}
223+
constpre=m.pre;
224+
if(/\$$/.test(pre)){
225+
acc=combine(acc,pre+"{"+m.body+"}",[""],max,maxLength,dropEmpties&&!m.post.length);
226+
firstGroup=false;
227+
if(!m.post.length)
228+
break;
229+
str=m.post;
230+
continue;
156231
}
157-
}else{
158232
constisNumericSequence=/^-?\d+\.\.-?\d+(?:\.\.-?\d+)?$/.test(m.body);
159233
constisAlphaSequence=/^[a-zA-Z]\.\.[a-zA-Z](?:\.\.-?\d+)?$/.test(m.body);
160234
constisSequence=isNumericSequence||isAlphaSequence;
161235
constisOptions=m.body.indexOf(",")>=0;
162236
if(!isSequence&&!isOptions){
163237
if(m.post.match(/,(?!,).*\}/)){
164238
str=m.pre+"{"+m.body+escClose+m.post;
165-
returnexpand_(str,max,true);
239+
isTop=true;
240+
continue;
166241
}
167-
return[str];
242+
returncombine(acc,pre+"{"+m.body+"}"+m.post,[""],max,maxLength,dropEmpties);
168243
}
169-
letn;
244+
if(firstGroup){
245+
dropEmpties=isTop&&!isSequence;
246+
firstGroup=false;
247+
}
248+
letvalues;
170249
if(isSequence){
171-
n=m.body.split(/\.\./);
250+
values=expandSequence(m.body,isAlphaSequence,max,maxLength);
172251
}else{
173-
n=parseCommaParts(m.body);
252+
letn=parseCommaParts(m.body);
174253
if(n.length===1&&n[0]!==void0){
175-
n=expand_(n[0],max,false).map(embrace);
254+
n=expand_(n[0],max,maxLength,false).map(embrace);
176255
if(n.length===1){
177-
returnpost.map((p)=>m.pre+n[0]+p);
256+
acc=combine(acc,pre+n[0],[""],max,maxLength,dropEmpties&&!m.post.length);
257+
if(!m.post.length)
258+
break;
259+
str=m.post;
260+
continue;
178261
}
179262
}
180-
}
181-
letN;
182-
if(isSequence&&n[0]!==void0&&n[1]!==void0){
183-
constx=numeric(n[0]);
184-
consty=numeric(n[1]);
185-
constwidth=Math.max(n[0].length,n[1].length);
186-
letincr=n.length===3&&n[2]!==void0 ? Math.max(Math.abs(numeric(n[2])),1) : 1;
187-
lettest=lte;
188-
constreverse=y<x;
189-
if(reverse){
190-
incr*=-1;
191-
test=gte;
192-
}
193-
constpad=n.some(isPadded);
194-
N=[];
195-
for(leti=x;test(i,y);i+=incr){
196-
letc;
197-
if(isAlphaSequence){
198-
c=String.fromCharCode(i);
199-
if(c==="\\"){
200-
c="";
201-
}
202-
}else{
203-
c=String(i);
204-
if(pad){
205-
constneed=width-c.length;
206-
if(need>0){
207-
constz=newArray(need+1).join("0");
208-
if(i<0){
209-
c="-"+z+c.slice(1);
210-
}else{
211-
c=z+c;
212-
}
213-
}
214-
}
263+
letdropsEmpties=dropEmpties&&!m.post.length&&!pre;
264+
for(letd=0;dropsEmpties&&d<acc.length;d++){
265+
if(acc[d]){
266+
dropsEmpties=false;
215267
}
216-
N.push(c);
217-
}
218-
}else{
219-
N=[];
220-
for(letj=0;j<n.length;j++){
221-
N.push.apply(N,expand_(n[j],max,false));
222268
}
223-
}
224-
for(letj=0;j<N.length;j++){
225-
for(letk=0;k<post.length&&expansions.length<max;k++){
226-
constexpansion=pre+N[j]+post[k];
227-
if(!isTop||isSequence||expansion){
228-
expansions.push(expansion);
269+
values=[];
270+
letvaluesLength=0;
271+
outer: for(letj=0;j<n.length;j++){
272+
constexpanded=expand_(n[j],max,maxLength,false);
273+
for(letk=0;k<expanded.length;k++){
274+
constv=expanded[k];
275+
if(dropsEmpties&&!v)
276+
continue;
277+
if(values.length>=max||valuesLength+v.length>maxLength){
278+
break outer;
279+
}
280+
values.push(v);
281+
valuesLength+=v.length;
229282
}
230283
}
231284
}
285+
acc=combine(acc,pre,values,max,maxLength,dropEmpties&&!m.post.length);
286+
if(!m.post.length)
287+
break;
288+
str=m.post;
232289
}
233-
returnexpansions;
290+
returnacc;
234291
}
235292
}
236293
});

0 commit comments

Comments
Β (0)