◐ Shell
clean mode source ↗

deps: update minimatch to 9.0.5 · nodejs/node@878e9a4

@@ -10,10 +10,8 @@ var require_balanced_match = __commonJS({

1010

"use strict";

1111

module2.exports = balanced;

1212

function balanced(a, b, str) {

13-

if (a instanceof RegExp)

14-

a = maybeMatch(a, str);

15-

if (b instanceof RegExp)

16-

b = maybeMatch(b, str);

13+

if (a instanceof RegExp) a = maybeMatch(a, str);

14+

if (b instanceof RegExp) b = maybeMatch(b, str);

1715

var r = range(a, b, str);

1816

return r && {

1917

start: r[0],

@@ -126,8 +124,7 @@ var require_brace_expansion = __commonJS({

126124

function expand(str, isTop) {

127125

var expansions = [];

128126

var m = balanced("{", "}", str);

129-

if (!m)

130-

return [str];

127+

if (!m) return [str];

131128

var pre = m.pre;

132129

var post = m.post.length ? expand(m.post, false) : [""];

133130

if (/\$$/.test(m.pre)) {

@@ -273,66 +270,65 @@ var require_brace_expressions = __commonJS({

273270

let negate = false;

274271

let endPos = pos;

275272

let rangeStart = "";

276-

WHILE:

277-

while (i < glob.length) {

278-

const c = glob.charAt(i);

279-

if ((c === "!" || c === "^") && i === pos + 1) {

280-

negate = true;

273+

WHILE: while (i < glob.length) {

274+

const c = glob.charAt(i);

275+

if ((c === "!" || c === "^") && i === pos + 1) {

276+

negate = true;

277+

i++;

278+

continue;

279+

}

280+

if (c === "]" && sawStart && !escaping) {

281+

endPos = i + 1;

282+

break;

283+

}

284+

sawStart = true;

285+

if (c === "\\") {

286+

if (!escaping) {

287+

escaping = true;

281288

i++;

282289

continue;

283290

}

284-

if (c === "]" && sawStart && !escaping) {

285-

endPos = i + 1;

286-

break;

287-

}

288-

sawStart = true;

289-

if (c === "\\") {

290-

if (!escaping) {

291-

escaping = true;

292-

i++;

293-

continue;

294-

}

295-

}

296-

if (c === "[" && !escaping) {

297-

for (const [cls, [unip, u, neg]] of Object.entries(posixClasses)) {

298-

if (glob.startsWith(cls, i)) {

299-

if (rangeStart) {

300-

return ["$.", false, glob.length - pos, true];

301-

}

302-

i += cls.length;

303-

if (neg)

304-

negs.push(unip);

305-

else

306-

ranges.push(unip);

307-

uflag = uflag || u;

308-

continue WHILE;

291+

}

292+

if (c === "[" && !escaping) {

293+

for (const [cls, [unip, u, neg]] of Object.entries(posixClasses)) {

294+

if (glob.startsWith(cls, i)) {

295+

if (rangeStart) {

296+

return ["$.", false, glob.length - pos, true];

309297

}

298+

i += cls.length;

299+

if (neg)

300+

negs.push(unip);

301+

else

302+

ranges.push(unip);

303+

uflag = uflag || u;

304+

continue WHILE;

310305

}

311306

}

312-

escaping = false;

313-

if (rangeStart) {

314-

if (c > rangeStart) {

315-

ranges.push(braceEscape(rangeStart) + "-" + braceEscape(c));

316-

} else if (c === rangeStart) {

317-

ranges.push(braceEscape(c));

318-

}

319-

rangeStart = "";

320-

i++;

321-

continue;

322-

}

323-

if (glob.startsWith("-]", i + 1)) {

324-

ranges.push(braceEscape(c + "-"));

325-

i += 2;

326-

continue;

327-

}

328-

if (glob.startsWith("-", i + 1)) {

329-

rangeStart = c;

330-

i += 2;

331-

continue;

307+

}

308+

escaping = false;

309+

if (rangeStart) {

310+

if (c > rangeStart) {

311+

ranges.push(braceEscape(rangeStart) + "-" + braceEscape(c));

312+

} else if (c === rangeStart) {

313+

ranges.push(braceEscape(c));

332314

}

333-

ranges.push(braceEscape(c));

315+

rangeStart = "";

334316

i++;

317+

continue;

335318

}

319+

if (glob.startsWith("-]", i + 1)) {

320+

ranges.push(braceEscape(c + "-"));

321+

i += 2;

322+

continue;

323+

}

324+

if (glob.startsWith("-", i + 1)) {

325+

rangeStart = c;

326+

i += 2;

327+

continue;

328+

}

329+

ranges.push(braceEscape(c));

330+

i++;

331+

}

336332

if (endPos < i) {

337333

return ["", false, 0, false];

338334

}

@@ -1304,10 +1300,11 @@ var Minimatch = class {

13041300

for (let i = 0; i < globParts.length - 1; i++) {

13051301

for (let j = i + 1; j < globParts.length; j++) {

13061302

const matched = this.partsMatch(globParts[i], globParts[j], !this.preserveMultipleSlashes);

1307-

if (!matched)

1308-

continue;

1309-

globParts[i] = matched;

1310-

globParts[j] = [];

1303+

if (matched) {

1304+

globParts[i] = [];

1305+

globParts[j] = matched;

1306+

break;

1307+

}

13111308

}

13121309

}

13131310

return globParts.filter((gs) => gs.length);