minimatch 4.2.0 → 4.2.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/minimatch.js +14 -11
- package/package.json +1 -1
package/minimatch.js
CHANGED
|
@@ -472,8 +472,16 @@ class Minimatch {
|
|
|
472
472
|
this.debug('%s\t%s %s %j', pattern, i, re, c)
|
|
473
473
|
|
|
474
474
|
// skip over any that are escaped.
|
|
475
|
-
if (escaping
|
|
476
|
-
|
|
475
|
+
if (escaping) {
|
|
476
|
+
/* istanbul ignore next - completely not allowed, even escaped. */
|
|
477
|
+
if (c === '/') {
|
|
478
|
+
return false
|
|
479
|
+
}
|
|
480
|
+
|
|
481
|
+
if (reSpecials[c]) {
|
|
482
|
+
re += '\\'
|
|
483
|
+
}
|
|
484
|
+
re += c
|
|
477
485
|
escaping = false
|
|
478
486
|
continue
|
|
479
487
|
}
|
|
@@ -481,7 +489,6 @@ class Minimatch {
|
|
|
481
489
|
switch (c) {
|
|
482
490
|
/* istanbul ignore next */
|
|
483
491
|
case '/': {
|
|
484
|
-
// completely not allowed, even escaped.
|
|
485
492
|
// Should already be path-split by now.
|
|
486
493
|
return false
|
|
487
494
|
}
|
|
@@ -564,9 +571,8 @@ class Minimatch {
|
|
|
564
571
|
continue
|
|
565
572
|
|
|
566
573
|
case '|':
|
|
567
|
-
if (inClass || !patternListStack.length
|
|
574
|
+
if (inClass || !patternListStack.length) {
|
|
568
575
|
re += '\\|'
|
|
569
|
-
escaping = false
|
|
570
576
|
continue
|
|
571
577
|
}
|
|
572
578
|
|
|
@@ -597,7 +603,6 @@ class Minimatch {
|
|
|
597
603
|
// first in the list. -- POSIX.2 2.8.3.2
|
|
598
604
|
if (i === classStart + 1 || !inClass) {
|
|
599
605
|
re += '\\' + c
|
|
600
|
-
escaping = false
|
|
601
606
|
continue
|
|
602
607
|
}
|
|
603
608
|
|
|
@@ -632,15 +637,12 @@ class Minimatch {
|
|
|
632
637
|
// swallow any state char that wasn't consumed
|
|
633
638
|
clearStateChar()
|
|
634
639
|
|
|
635
|
-
if (
|
|
636
|
-
// no need
|
|
637
|
-
escaping = false
|
|
638
|
-
} else if (reSpecials[c]
|
|
639
|
-
&& !(c === '^' && inClass)) {
|
|
640
|
+
if (reSpecials[c] && !(c === '^' && inClass)) {
|
|
640
641
|
re += '\\'
|
|
641
642
|
}
|
|
642
643
|
|
|
643
644
|
re += c
|
|
645
|
+
break
|
|
644
646
|
|
|
645
647
|
} // switch
|
|
646
648
|
} // for
|
|
@@ -670,6 +672,7 @@ class Minimatch {
|
|
|
670
672
|
this.debug('setting tail', re, pl)
|
|
671
673
|
// maybe some even number of \, then maybe 1 \, followed by a |
|
|
672
674
|
tail = tail.replace(/((?:\\{2}){0,64})(\\?)\|/g, (_, $1, $2) => {
|
|
675
|
+
/* istanbul ignore else - should already be done */
|
|
673
676
|
if (!$2) {
|
|
674
677
|
// the | isn't already escaped, so escape it.
|
|
675
678
|
$2 = '\\'
|
package/package.json
CHANGED