snyk 1.1235.0 → 1.1237.0

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.
@@ -698,6 +698,7 @@ function ownProp (obj, field) {
698
698
  return Object.prototype.hasOwnProperty.call(obj, field)
699
699
  }
700
700
 
701
+ var fs = __webpack_require__(57147)
701
702
  var path = __webpack_require__(71017)
702
703
  var minimatch = __webpack_require__(91171)
703
704
  var isAbsolute = __webpack_require__(64095)
@@ -763,6 +764,7 @@ function setopts (self, pattern, options) {
763
764
  self.stat = !!options.stat
764
765
  self.noprocess = !!options.noprocess
765
766
  self.absolute = !!options.absolute
767
+ self.fs = options.fs || fs
766
768
 
767
769
  self.maxLength = options.maxLength || Infinity
768
770
  self.cache = options.cache || Object.create(null)
@@ -796,6 +798,8 @@ function setopts (self, pattern, options) {
796
798
  // Note that they are not supported in Glob itself anyway.
797
799
  options.nonegate = true
798
800
  options.nocomment = true
801
+ // always treat \ in patterns as escapes, not path separators
802
+ options.allowWindowsEscape = false
799
803
 
800
804
  self.minimatch = new Minimatch(pattern, options)
801
805
  self.options = self.minimatch.options
@@ -969,7 +973,6 @@ function childrenIgnored (self, path) {
969
973
 
970
974
  module.exports = glob
971
975
 
972
- var fs = __webpack_require__(57147)
973
976
  var rp = __webpack_require__(37334)
974
977
  var minimatch = __webpack_require__(91171)
975
978
  var Minimatch = minimatch.Minimatch
@@ -1272,7 +1275,10 @@ Glob.prototype._process = function (pattern, index, inGlobStar, cb) {
1272
1275
  var read
1273
1276
  if (prefix === null)
1274
1277
  read = '.'
1275
- else if (isAbsolute(prefix) || isAbsolute(pattern.join('/'))) {
1278
+ else if (isAbsolute(prefix) ||
1279
+ isAbsolute(pattern.map(function (p) {
1280
+ return typeof p === 'string' ? p : '[*]'
1281
+ }).join('/'))) {
1276
1282
  if (!prefix || !isAbsolute(prefix))
1277
1283
  prefix = '/' + prefix
1278
1284
  read = prefix
@@ -1430,7 +1436,7 @@ Glob.prototype._readdirInGlobStar = function (abs, cb) {
1430
1436
  var lstatcb = inflight(lstatkey, lstatcb_)
1431
1437
 
1432
1438
  if (lstatcb)
1433
- fs.lstat(abs, lstatcb)
1439
+ self.fs.lstat(abs, lstatcb)
1434
1440
 
1435
1441
  function lstatcb_ (er, lstat) {
1436
1442
  if (er && er.code === 'ENOENT')
@@ -1471,7 +1477,7 @@ Glob.prototype._readdir = function (abs, inGlobStar, cb) {
1471
1477
  }
1472
1478
 
1473
1479
  var self = this
1474
- fs.readdir(abs, readdirCb(this, abs, cb))
1480
+ self.fs.readdir(abs, readdirCb(this, abs, cb))
1475
1481
  }
1476
1482
 
1477
1483
  function readdirCb (self, abs, cb) {
@@ -1675,13 +1681,13 @@ Glob.prototype._stat = function (f, cb) {
1675
1681
  var self = this
1676
1682
  var statcb = inflight('stat\0' + abs, lstatcb_)
1677
1683
  if (statcb)
1678
- fs.lstat(abs, statcb)
1684
+ self.fs.lstat(abs, statcb)
1679
1685
 
1680
1686
  function lstatcb_ (er, lstat) {
1681
1687
  if (lstat && lstat.isSymbolicLink()) {
1682
1688
  // If it's a symlink, then treat it as the target, unless
1683
1689
  // the target does not exist, then treat it as a file.
1684
- return fs.stat(abs, function (er, stat) {
1690
+ return self.fs.stat(abs, function (er, stat) {
1685
1691
  if (er)
1686
1692
  self._stat2(f, abs, null, lstat, cb)
1687
1693
  else
@@ -1725,7 +1731,6 @@ Glob.prototype._stat2 = function (f, abs, er, stat, cb) {
1725
1731
  module.exports = globSync
1726
1732
  globSync.GlobSync = GlobSync
1727
1733
 
1728
- var fs = __webpack_require__(57147)
1729
1734
  var rp = __webpack_require__(37334)
1730
1735
  var minimatch = __webpack_require__(91171)
1731
1736
  var Minimatch = minimatch.Minimatch
@@ -1773,7 +1778,7 @@ function GlobSync (pattern, options) {
1773
1778
  }
1774
1779
 
1775
1780
  GlobSync.prototype._finish = function () {
1776
- assert(this instanceof GlobSync)
1781
+ assert.ok(this instanceof GlobSync)
1777
1782
  if (this.realpath) {
1778
1783
  var self = this
1779
1784
  this.matches.forEach(function (matchset, index) {
@@ -1797,7 +1802,7 @@ GlobSync.prototype._finish = function () {
1797
1802
 
1798
1803
 
1799
1804
  GlobSync.prototype._process = function (pattern, index, inGlobStar) {
1800
- assert(this instanceof GlobSync)
1805
+ assert.ok(this instanceof GlobSync)
1801
1806
 
1802
1807
  // Get the first [n] parts of pattern that are all strings.
1803
1808
  var n = 0
@@ -1834,7 +1839,10 @@ GlobSync.prototype._process = function (pattern, index, inGlobStar) {
1834
1839
  var read
1835
1840
  if (prefix === null)
1836
1841
  read = '.'
1837
- else if (isAbsolute(prefix) || isAbsolute(pattern.join('/'))) {
1842
+ else if (isAbsolute(prefix) ||
1843
+ isAbsolute(pattern.map(function (p) {
1844
+ return typeof p === 'string' ? p : '[*]'
1845
+ }).join('/'))) {
1838
1846
  if (!prefix || !isAbsolute(prefix))
1839
1847
  prefix = '/' + prefix
1840
1848
  read = prefix
@@ -1970,7 +1978,7 @@ GlobSync.prototype._readdirInGlobStar = function (abs) {
1970
1978
  var lstat
1971
1979
  var stat
1972
1980
  try {
1973
- lstat = fs.lstatSync(abs)
1981
+ lstat = this.fs.lstatSync(abs)
1974
1982
  } catch (er) {
1975
1983
  if (er.code === 'ENOENT') {
1976
1984
  // lstat failed, doesn't exist
@@ -2007,7 +2015,7 @@ GlobSync.prototype._readdir = function (abs, inGlobStar) {
2007
2015
  }
2008
2016
 
2009
2017
  try {
2010
- return this._readdirEntries(abs, fs.readdirSync(abs))
2018
+ return this._readdirEntries(abs, this.fs.readdirSync(abs))
2011
2019
  } catch (er) {
2012
2020
  this._readdirError(abs, er)
2013
2021
  return null
@@ -2166,7 +2174,7 @@ GlobSync.prototype._stat = function (f) {
2166
2174
  if (!stat) {
2167
2175
  var lstat
2168
2176
  try {
2169
- lstat = fs.lstatSync(abs)
2177
+ lstat = this.fs.lstatSync(abs)
2170
2178
  } catch (er) {
2171
2179
  if (er && (er.code === 'ENOENT' || er.code === 'ENOTDIR')) {
2172
2180
  this.statCache[abs] = false
@@ -2176,7 +2184,7 @@ GlobSync.prototype._stat = function (f) {
2176
2184
 
2177
2185
  if (lstat && lstat.isSymbolicLink()) {
2178
2186
  try {
2179
- stat = fs.statSync(abs)
2187
+ stat = this.fs.statSync(abs)
2180
2188
  } catch (er) {
2181
2189
  stat = lstat
2182
2190
  }