minimatch 3.0.6 → 3.1.2

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/README.md CHANGED
@@ -187,6 +187,12 @@ minimatch('/a/b', '/**/d', { partial: true }) // true, might be /a/b/.../d
187
187
  minimatch('/x/y/z', '/a/**/z', { partial: true }) // false, because x !== a
188
188
  ```
189
189
 
190
+ ### allowWindowsEscape
191
+
192
+ Windows path separator `\` is by default converted to `/`, which
193
+ prohibits the usage of `\` as a escape character. This flag skips that
194
+ behavior and allows using the escape character.
195
+
190
196
  ## Comparisons to other fnmatch/glob implementations
191
197
 
192
198
  While strict compliance with the existing standards is a worthwhile
package/minimatch.js CHANGED
@@ -134,8 +134,10 @@ function Minimatch (pattern, options) {
134
134
 
135
135
  if (!options) options = {}
136
136
 
137
+ pattern = pattern.trim()
138
+
137
139
  // windows support: need to use /, not \
138
- if (path.sep !== '/') {
140
+ if (!options.allowWindowsEscape && path.sep !== '/') {
139
141
  pattern = pattern.split(path.sep).join('/')
140
142
  }
141
143
 
@@ -306,7 +308,7 @@ function parse (pattern, isSub) {
306
308
  if (pattern === '') return ''
307
309
 
308
310
  var re = ''
309
- var hasMagic = false
311
+ var hasMagic = !!options.nocase
310
312
  var escaping = false
311
313
  // ? => one single character
312
314
  var patternListStack = []
@@ -891,11 +893,7 @@ Minimatch.prototype.matchOne = function (file, pattern, partial) {
891
893
  // patterns with magic have been turned into regexps.
892
894
  var hit
893
895
  if (typeof p === 'string') {
894
- if (options.nocase) {
895
- hit = f.toLowerCase() === p.toLowerCase()
896
- } else {
897
- hit = f === p
898
- }
896
+ hit = f === p
899
897
  this.debug('string match', p, f, hit)
900
898
  } else {
901
899
  hit = f.match(p)
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": "3.0.6",
5
+ "version": "3.1.2",
6
+ "publishConfig": {
7
+ "tag": "v3-legacy"
8
+ },
6
9
  "repository": {
7
10
  "type": "git",
8
11
  "url": "git://github.com/isaacs/minimatch.git"