minimatch 5.1.3 → 5.1.5

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.
Files changed (3) hide show
  1. package/LICENSE +1 -1
  2. package/minimatch.js +8 -2
  3. package/package.json +4 -1
package/LICENSE CHANGED
@@ -1,6 +1,6 @@
1
1
  The ISC License
2
2
 
3
- Copyright (c) 2011-2022 Isaac Z. Schlueter and Contributors
3
+ Copyright (c) 2011-2023 Isaac Z. Schlueter and Contributors
4
4
 
5
5
  Permission to use, copy, modify, and/or distribute this software for any
6
6
  purpose with or without fee is hereby granted, provided that the above
package/minimatch.js CHANGED
@@ -427,7 +427,7 @@ class Minimatch {
427
427
  if (pattern === '') return ''
428
428
 
429
429
  let re = ''
430
- let hasMagic = !!options.nocase
430
+ let hasMagic = false
431
431
  let escaping = false
432
432
  // ? => one single character
433
433
  const patternListStack = []
@@ -722,7 +722,8 @@ class Minimatch {
722
722
  // Handle nested stuff like *(*.js|!(*.json)), where open parens
723
723
  // mean that we should *not* include the ) in the bit that is considered
724
724
  // "after" the negated section.
725
- const openParensBefore = nlBefore.split('(').length - 1
725
+ const closeParensBefore = nlBefore.split(')').length
726
+ const openParensBefore = nlBefore.split('(').length - closeParensBefore
726
727
  let cleanAfter = nlAfter
727
728
  for (let i = 0; i < openParensBefore; i++) {
728
729
  cleanAfter = cleanAfter.replace(/\)[+*?]?/, '')
@@ -750,6 +751,11 @@ class Minimatch {
750
751
  return [re, hasMagic]
751
752
  }
752
753
 
754
+ // if it's nocase, and the lcase/uppercase don't match, it's magic
755
+ if (options.nocase && !hasMagic) {
756
+ hasMagic = pattern.toUpperCase() !== pattern.toLowerCase()
757
+ }
758
+
753
759
  // skip the regexp for non-magical patterns
754
760
  // unescape anything in it, though, so that it'll be
755
761
  // an exact match against a file etc.
package/package.json CHANGED
@@ -2,7 +2,10 @@
2
2
  "author": "Isaac Z. Schlueter <i@izs.me> (http://blog.izs.me)",
3
3
  "name": "minimatch",
4
4
  "description": "a glob matcher in javascript",
5
- "version": "5.1.3",
5
+ "publishConfig": {
6
+ "tag": "legacy-v5"
7
+ },
8
+ "version": "5.1.5",
6
9
  "repository": {
7
10
  "type": "git",
8
11
  "url": "git://github.com/isaacs/minimatch.git"