minimatch 5.1.2 → 5.1.4

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 +1 -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 = []
@@ -729,7 +729,8 @@ class Minimatch {
729
729
  }
730
730
  nlAfter = cleanAfter
731
731
 
732
- const dollar = nlAfter === '' && isSub !== SUBPARSE ? '$' : ''
732
+ const dollar = nlAfter === '' && isSub !== SUBPARSE ? '(?:$|\\/)' : ''
733
+
733
734
  re = nlBefore + nlFirst + nlAfter + dollar + nlLast
734
735
  }
735
736
 
@@ -749,6 +750,11 @@ class Minimatch {
749
750
  return [re, hasMagic]
750
751
  }
751
752
 
753
+ // if it's nocase, and the lcase/uppercase don't match, it's magic
754
+ if (options.nocase && !hasMagic) {
755
+ hasMagic = pattern.toUpperCase() !== pattern.toLowerCase()
756
+ }
757
+
752
758
  // skip the regexp for non-magical patterns
753
759
  // unescape anything in it, though, so that it'll be
754
760
  // an exact match against a file etc.
package/package.json CHANGED
@@ -2,7 +2,7 @@
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.2",
5
+ "version": "5.1.4",
6
6
  "repository": {
7
7
  "type": "git",
8
8
  "url": "git://github.com/isaacs/minimatch.git"