muhammara 2.1.0 → 2.2.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.
Files changed (77) hide show
  1. package/CHANGELOG.md +13 -1
  2. package/node_modules/@mapbox/node-pre-gyp/CHANGELOG.md +3 -0
  3. package/node_modules/@mapbox/node-pre-gyp/package.json +6 -7
  4. package/node_modules/ansi-regex/package.json +1 -2
  5. package/node_modules/brace-expansion/package.json +2 -1
  6. package/node_modules/gauge/CHANGELOG.md +163 -0
  7. package/node_modules/gauge/LICENSE +13 -0
  8. package/node_modules/gauge/README.md +1 -1
  9. package/node_modules/gauge/{lib/base-theme.js → base-theme.js} +3 -7
  10. package/node_modules/gauge/{lib/error.js → error.js} +0 -0
  11. package/node_modules/gauge/{lib/has-color.js → has-color.js} +0 -0
  12. package/node_modules/gauge/{lib/index.js → index.js} +32 -89
  13. package/node_modules/gauge/package.json +42 -37
  14. package/node_modules/gauge/{lib/plumbing.js → plumbing.js} +1 -3
  15. package/node_modules/gauge/{lib/process.js → process.js} +0 -0
  16. package/node_modules/gauge/{lib/progress-bar.js → progress-bar.js} +5 -11
  17. package/node_modules/gauge/{lib/render-template.js → render-template.js} +24 -68
  18. package/node_modules/gauge/{lib/set-immediate.js → set-immediate.js} +0 -0
  19. package/node_modules/gauge/{lib/set-interval.js → set-interval.js} +0 -0
  20. package/node_modules/gauge/{lib/spin.js → spin.js} +0 -0
  21. package/node_modules/gauge/{lib/template-item.js → template-item.js} +6 -21
  22. package/node_modules/gauge/{lib/theme-set.js → theme-set.js} +23 -31
  23. package/node_modules/gauge/{lib/themes.js → themes.js} +13 -13
  24. package/node_modules/gauge/{lib/wide-truncate.js → wide-truncate.js} +3 -9
  25. package/node_modules/minimatch/README.md +22 -1
  26. package/node_modules/minimatch/minimatch.js +93 -69
  27. package/node_modules/minimatch/package.json +11 -10
  28. package/node_modules/minipass/index.js +6 -1
  29. package/node_modules/minipass/package.json +5 -5
  30. package/node_modules/node-fetch/lib/index.es.js +28 -2
  31. package/node_modules/node-fetch/lib/index.js +28 -2
  32. package/node_modules/node-fetch/lib/index.mjs +28 -2
  33. package/node_modules/node-fetch/package.json +13 -5
  34. package/node_modules/npmlog/LICENSE +15 -0
  35. package/node_modules/npmlog/{lib/log.js → log.js} +9 -9
  36. package/node_modules/npmlog/package.json +20 -31
  37. package/node_modules/object-assign/index.js +90 -0
  38. package/node_modules/object-assign/license +21 -0
  39. package/node_modules/object-assign/package.json +74 -0
  40. package/node_modules/object-assign/readme.md +61 -0
  41. package/node_modules/signal-exit/index.js +4 -2
  42. package/node_modules/signal-exit/package.json +5 -5
  43. package/package.json +1 -1
  44. package/src/deps/PDFWriter/CMakeLists.txt +8 -0
  45. package/src/deps/PDFWriter/DecryptionHelper.cpp +10 -8
  46. package/src/deps/PDFWriter/Deletable.h +46 -0
  47. package/src/deps/PDFWriter/DocumentContext.h +3 -3
  48. package/src/deps/PDFWriter/IDeletable.h +6 -0
  49. package/src/deps/PDFWriter/InputLZWDecodeStream.cpp +208 -0
  50. package/src/deps/PDFWriter/InputLZWDecodeStream.h +77 -0
  51. package/src/deps/PDFWriter/InputStreamSkipperStream.cpp +1 -1
  52. package/src/deps/PDFWriter/JPEGImageHandler.h +2 -2
  53. package/src/deps/PDFWriter/ObjectsContext.cpp +5 -0
  54. package/src/deps/PDFWriter/ObjectsContext.h +1 -0
  55. package/src/deps/PDFWriter/PDFDocumentHandler.cpp +19 -3
  56. package/src/deps/PDFWriter/PDFObject.cpp +13 -11
  57. package/src/deps/PDFWriter/PDFObject.h +7 -5
  58. package/src/deps/PDFWriter/PDFObjectParser.cpp +8 -0
  59. package/src/deps/PDFWriter/PDFObjectParser.h +6 -0
  60. package/src/deps/PDFWriter/PDFParser.cpp +25 -13
  61. package/src/deps/PDFWriter/PDFParserTokenizer.cpp +25 -24
  62. package/src/deps/PDFWriter/PDFParserTokenizer.h +1 -0
  63. package/src/deps/PDFWriter/PDFWriter.h +2 -2
  64. package/src/deps/PDFWriter/binding.gyp +2 -0
  65. package/node_modules/gauge/LICENSE.md +0 -20
  66. package/node_modules/gauge/lib/demo.js +0 -45
  67. package/node_modules/npmlog/LICENSE.md +0 -20
  68. package/src/deps/PDFWriter/InputPredictorPNGAverageStream.cpp +0 -120
  69. package/src/deps/PDFWriter/InputPredictorPNGAverageStream.h +0 -49
  70. package/src/deps/PDFWriter/InputPredictorPNGNoneStream.cpp +0 -109
  71. package/src/deps/PDFWriter/InputPredictorPNGNoneStream.h +0 -47
  72. package/src/deps/PDFWriter/InputPredictorPNGPaethStream.cpp +0 -136
  73. package/src/deps/PDFWriter/InputPredictorPNGPaethStream.h +0 -51
  74. package/src/deps/PDFWriter/InputPredictorPNGSubStream.cpp +0 -113
  75. package/src/deps/PDFWriter/InputPredictorPNGSubStream.h +0 -47
  76. package/src/deps/PDFWriter/InputPredictorPNGUpStream.cpp +0 -120
  77. package/src/deps/PDFWriter/InputPredictorPNGUpStream.h +0 -49
@@ -1,10 +1,10 @@
1
1
  module.exports = minimatch
2
2
  minimatch.Minimatch = Minimatch
3
3
 
4
- var path = { sep: '/' }
5
- try {
6
- path = require('path')
7
- } catch (er) {}
4
+ var path = (function () { try { return require('path') } catch (e) {}}()) || {
5
+ sep: '/'
6
+ }
7
+ minimatch.sep = path.sep
8
8
 
9
9
  var GLOBSTAR = minimatch.GLOBSTAR = Minimatch.GLOBSTAR = {}
10
10
  var expand = require('brace-expansion')
@@ -56,43 +56,64 @@ function filter (pattern, options) {
56
56
  }
57
57
 
58
58
  function ext (a, b) {
59
- a = a || {}
60
59
  b = b || {}
61
60
  var t = {}
62
- Object.keys(b).forEach(function (k) {
63
- t[k] = b[k]
64
- })
65
61
  Object.keys(a).forEach(function (k) {
66
62
  t[k] = a[k]
67
63
  })
64
+ Object.keys(b).forEach(function (k) {
65
+ t[k] = b[k]
66
+ })
68
67
  return t
69
68
  }
70
69
 
71
70
  minimatch.defaults = function (def) {
72
- if (!def || !Object.keys(def).length) return minimatch
71
+ if (!def || typeof def !== 'object' || !Object.keys(def).length) {
72
+ return minimatch
73
+ }
73
74
 
74
75
  var orig = minimatch
75
76
 
76
77
  var m = function minimatch (p, pattern, options) {
77
- return orig.minimatch(p, pattern, ext(def, options))
78
+ return orig(p, pattern, ext(def, options))
78
79
  }
79
80
 
80
81
  m.Minimatch = function Minimatch (pattern, options) {
81
82
  return new orig.Minimatch(pattern, ext(def, options))
82
83
  }
84
+ m.Minimatch.defaults = function defaults (options) {
85
+ return orig.defaults(ext(def, options)).Minimatch
86
+ }
87
+
88
+ m.filter = function filter (pattern, options) {
89
+ return orig.filter(pattern, ext(def, options))
90
+ }
91
+
92
+ m.defaults = function defaults (options) {
93
+ return orig.defaults(ext(def, options))
94
+ }
95
+
96
+ m.makeRe = function makeRe (pattern, options) {
97
+ return orig.makeRe(pattern, ext(def, options))
98
+ }
99
+
100
+ m.braceExpand = function braceExpand (pattern, options) {
101
+ return orig.braceExpand(pattern, ext(def, options))
102
+ }
103
+
104
+ m.match = function (list, pattern, options) {
105
+ return orig.match(list, pattern, ext(def, options))
106
+ }
83
107
 
84
108
  return m
85
109
  }
86
110
 
87
111
  Minimatch.defaults = function (def) {
88
- if (!def || !Object.keys(def).length) return Minimatch
89
112
  return minimatch.defaults(def).Minimatch
90
113
  }
91
114
 
92
115
  function minimatch (p, pattern, options) {
93
- if (typeof pattern !== 'string') {
94
- throw new TypeError('glob pattern string required')
95
- }
116
+ assertValidPattern(pattern)
96
117
 
97
118
  if (!options) options = {}
98
119
 
@@ -101,9 +122,6 @@ function minimatch (p, pattern, options) {
101
122
  return false
102
123
  }
103
124
 
104
- // "" only matches ""
105
- if (pattern.trim() === '') return p === ''
106
-
107
125
  return new Minimatch(pattern, options).match(p)
108
126
  }
109
127
 
@@ -112,15 +130,14 @@ function Minimatch (pattern, options) {
112
130
  return new Minimatch(pattern, options)
113
131
  }
114
132
 
115
- if (typeof pattern !== 'string') {
116
- throw new TypeError('glob pattern string required')
117
- }
133
+ assertValidPattern(pattern)
118
134
 
119
135
  if (!options) options = {}
136
+
120
137
  pattern = pattern.trim()
121
138
 
122
139
  // windows support: need to use /, not \
123
- if (path.sep !== '/') {
140
+ if (!options.allowWindowsEscape && path.sep !== '/') {
124
141
  pattern = pattern.split(path.sep).join('/')
125
142
  }
126
143
 
@@ -131,6 +148,7 @@ function Minimatch (pattern, options) {
131
148
  this.negate = false
132
149
  this.comment = false
133
150
  this.empty = false
151
+ this.partial = !!options.partial
134
152
 
135
153
  // make the set of regexps etc.
136
154
  this.make()
@@ -140,9 +158,6 @@ Minimatch.prototype.debug = function () {}
140
158
 
141
159
  Minimatch.prototype.make = make
142
160
  function make () {
143
- // don't do it more than once.
144
- if (this._made) return
145
-
146
161
  var pattern = this.pattern
147
162
  var options = this.options
148
163
 
@@ -162,7 +177,7 @@ function make () {
162
177
  // step 2: expand braces
163
178
  var set = this.globSet = this.braceExpand()
164
179
 
165
- if (options.debug) this.debug = console.error
180
+ if (options.debug) this.debug = function debug() { console.error.apply(console, arguments) }
166
181
 
167
182
  this.debug(this.pattern, set)
168
183
 
@@ -242,12 +257,11 @@ function braceExpand (pattern, options) {
242
257
  pattern = typeof pattern === 'undefined'
243
258
  ? this.pattern : pattern
244
259
 
245
- if (typeof pattern === 'undefined') {
246
- throw new TypeError('undefined pattern')
247
- }
260
+ assertValidPattern(pattern)
248
261
 
249
- if (options.nobrace ||
250
- !pattern.match(/\{.*\}/)) {
262
+ // Thanks to Yeting Li <https://github.com/yetingli> for
263
+ // improving this regexp to avoid a ReDOS vulnerability.
264
+ if (options.nobrace || !/\{(?:(?!\{).)*\}/.test(pattern)) {
251
265
  // shortcut. no need to expand.
252
266
  return [pattern]
253
267
  }
@@ -255,6 +269,17 @@ function braceExpand (pattern, options) {
255
269
  return expand(pattern)
256
270
  }
257
271
 
272
+ var MAX_PATTERN_LENGTH = 1024 * 64
273
+ var assertValidPattern = function (pattern) {
274
+ if (typeof pattern !== 'string') {
275
+ throw new TypeError('invalid pattern')
276
+ }
277
+
278
+ if (pattern.length > MAX_PATTERN_LENGTH) {
279
+ throw new TypeError('pattern is too long')
280
+ }
281
+ }
282
+
258
283
  // parse a component of the expanded set.
259
284
  // At this point, no pattern may contain "/" in it
260
285
  // so we're going to return a 2d array, where each entry is the full
@@ -269,14 +294,17 @@ function braceExpand (pattern, options) {
269
294
  Minimatch.prototype.parse = parse
270
295
  var SUBPARSE = {}
271
296
  function parse (pattern, isSub) {
272
- if (pattern.length > 1024 * 64) {
273
- throw new TypeError('pattern is too long')
274
- }
297
+ assertValidPattern(pattern)
275
298
 
276
299
  var options = this.options
277
300
 
278
301
  // shortcuts
279
- if (!options.noglobstar && pattern === '**') return GLOBSTAR
302
+ if (pattern === '**') {
303
+ if (!options.noglobstar)
304
+ return GLOBSTAR
305
+ else
306
+ pattern = '*'
307
+ }
280
308
  if (pattern === '') return ''
281
309
 
282
310
  var re = ''
@@ -332,10 +360,12 @@ function parse (pattern, isSub) {
332
360
  }
333
361
 
334
362
  switch (c) {
335
- case '/':
363
+ /* istanbul ignore next */
364
+ case '/': {
336
365
  // completely not allowed, even escaped.
337
366
  // Should already be path-split by now.
338
367
  return false
368
+ }
339
369
 
340
370
  case '\\':
341
371
  clearStateChar()
@@ -454,25 +484,23 @@ function parse (pattern, isSub) {
454
484
 
455
485
  // handle the case where we left a class open.
456
486
  // "[z-a]" is valid, equivalent to "\[z-a\]"
457
- if (inClass) {
458
- // split where the last [ was, make sure we don't have
459
- // an invalid re. if so, re-walk the contents of the
460
- // would-be class to re-translate any characters that
461
- // were passed through as-is
462
- // TODO: It would probably be faster to determine this
463
- // without a try/catch and a new RegExp, but it's tricky
464
- // to do safely. For now, this is safe and works.
465
- var cs = pattern.substring(classStart + 1, i)
466
- try {
467
- RegExp('[' + cs + ']')
468
- } catch (er) {
469
- // not a valid class!
470
- var sp = this.parse(cs, SUBPARSE)
471
- re = re.substr(0, reClassStart) + '\\[' + sp[0] + '\\]'
472
- hasMagic = hasMagic || sp[1]
473
- inClass = false
474
- continue
475
- }
487
+ // split where the last [ was, make sure we don't have
488
+ // an invalid re. if so, re-walk the contents of the
489
+ // would-be class to re-translate any characters that
490
+ // were passed through as-is
491
+ // TODO: It would probably be faster to determine this
492
+ // without a try/catch and a new RegExp, but it's tricky
493
+ // to do safely. For now, this is safe and works.
494
+ var cs = pattern.substring(classStart + 1, i)
495
+ try {
496
+ RegExp('[' + cs + ']')
497
+ } catch (er) {
498
+ // not a valid class!
499
+ var sp = this.parse(cs, SUBPARSE)
500
+ re = re.substr(0, reClassStart) + '\\[' + sp[0] + '\\]'
501
+ hasMagic = hasMagic || sp[1]
502
+ inClass = false
503
+ continue
476
504
  }
477
505
 
478
506
  // finish up the class.
@@ -556,9 +584,7 @@ function parse (pattern, isSub) {
556
584
  // something that could conceivably capture a dot
557
585
  var addPatternStart = false
558
586
  switch (re.charAt(0)) {
559
- case '.':
560
- case '[':
561
- case '(': addPatternStart = true
587
+ case '[': case '.': case '(': addPatternStart = true
562
588
  }
563
589
 
564
590
  // Hack to work around lack of negative lookbehind in JS
@@ -620,7 +646,7 @@ function parse (pattern, isSub) {
620
646
  var flags = options.nocase ? 'i' : ''
621
647
  try {
622
648
  var regExp = new RegExp('^' + re + '$', flags)
623
- } catch (er) {
649
+ } catch (er) /* istanbul ignore next - should be impossible */ {
624
650
  // If it was an invalid regular expression, then it can't match
625
651
  // anything. This trick looks for a character after the end of
626
652
  // the string, which is of course impossible, except in multi-line
@@ -678,7 +704,7 @@ function makeRe () {
678
704
 
679
705
  try {
680
706
  this.regexp = new RegExp(re, flags)
681
- } catch (ex) {
707
+ } catch (ex) /* istanbul ignore next - should be impossible */ {
682
708
  this.regexp = false
683
709
  }
684
710
  return this.regexp
@@ -696,8 +722,8 @@ minimatch.match = function (list, pattern, options) {
696
722
  return list
697
723
  }
698
724
 
699
- Minimatch.prototype.match = match
700
- function match (f, partial) {
725
+ Minimatch.prototype.match = function match (f, partial) {
726
+ if (typeof partial === 'undefined') partial = this.partial
701
727
  this.debug('match', f, this.pattern)
702
728
  // short-circuit in the case of busted things.
703
729
  // comments, etc.
@@ -779,6 +805,7 @@ Minimatch.prototype.matchOne = function (file, pattern, partial) {
779
805
 
780
806
  // should be impossible.
781
807
  // some invalid regexp stuff in the set.
808
+ /* istanbul ignore if */
782
809
  if (p === false) return false
783
810
 
784
811
  if (p === GLOBSTAR) {
@@ -852,6 +879,7 @@ Minimatch.prototype.matchOne = function (file, pattern, partial) {
852
879
  // no match was found.
853
880
  // However, in partial mode, we can't say this is necessarily over.
854
881
  // If there's more *pattern* left, then
882
+ /* istanbul ignore if */
855
883
  if (partial) {
856
884
  // ran out of file
857
885
  this.debug('\n>>> no match, partial?', file, fr, pattern, pr)
@@ -865,11 +893,7 @@ Minimatch.prototype.matchOne = function (file, pattern, partial) {
865
893
  // patterns with magic have been turned into regexps.
866
894
  var hit
867
895
  if (typeof p === 'string') {
868
- if (options.nocase) {
869
- hit = f.toLowerCase() === p.toLowerCase()
870
- } else {
871
- hit = f === p
872
- }
896
+ hit = f === p
873
897
  this.debug('string match', p, f, hit)
874
898
  } else {
875
899
  hit = f.match(p)
@@ -900,16 +924,16 @@ Minimatch.prototype.matchOne = function (file, pattern, partial) {
900
924
  // this is ok if we're doing the match as part of
901
925
  // a glob fs traversal.
902
926
  return partial
903
- } else if (pi === pl) {
927
+ } else /* istanbul ignore else */ if (pi === pl) {
904
928
  // ran out of pattern, still have file left.
905
929
  // this is only acceptable if we're on the very last
906
930
  // empty segment of a file with a trailing slash.
907
931
  // a/* should match a/b/
908
- var emptyFileEnd = (fi === fl - 1) && (file[fi] === '')
909
- return emptyFileEnd
932
+ return (fi === fl - 1) && (file[fi] === '')
910
933
  }
911
934
 
912
935
  // should be unreachable.
936
+ /* istanbul ignore next */
913
937
  throw new Error('wtf?')
914
938
  }
915
939
 
@@ -1,8 +1,8 @@
1
1
  {
2
2
  "_from": "minimatch@^3.0.4",
3
- "_id": "minimatch@3.0.4",
3
+ "_id": "minimatch@3.1.2",
4
4
  "_inBundle": false,
5
- "_integrity": "sha512-yJHVQEhyqPLUTgt9B83PXu6W3rx4MvvHvSUvToogpwoGDOUQ+yDrR0HRot+yOCdCO7u4hX3pWft6kWBBcqh0UA==",
5
+ "_integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==",
6
6
  "_location": "/minimatch",
7
7
  "_phantomChildren": {},
8
8
  "_requested": {
@@ -16,12 +16,10 @@
16
16
  "fetchSpec": "^3.0.4"
17
17
  },
18
18
  "_requiredBy": [
19
- "/glob",
20
- "/mocha",
21
- "/mocha/glob"
19
+ "/glob"
22
20
  ],
23
- "_resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.0.4.tgz",
24
- "_shasum": "5166e286457f03306064be5497e8dbb0c3d32083",
21
+ "_resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz",
22
+ "_shasum": "19cd194bfd3e428f049a70817c038d89ab4be35b",
25
23
  "_spec": "minimatch@^3.0.4",
26
24
  "_where": "/home/runner/work/MuhammaraJS/MuhammaraJS/node_modules/glob",
27
25
  "author": {
@@ -39,7 +37,7 @@
39
37
  "deprecated": false,
40
38
  "description": "a glob matcher in javascript",
41
39
  "devDependencies": {
42
- "tap": "^10.3.2"
40
+ "tap": "^15.1.6"
43
41
  },
44
42
  "engines": {
45
43
  "node": "*"
@@ -51,6 +49,9 @@
51
49
  "license": "ISC",
52
50
  "main": "minimatch.js",
53
51
  "name": "minimatch",
52
+ "publishConfig": {
53
+ "tag": "v3-legacy"
54
+ },
54
55
  "repository": {
55
56
  "type": "git",
56
57
  "url": "git://github.com/isaacs/minimatch.git"
@@ -59,7 +60,7 @@
59
60
  "postpublish": "git push origin --all; git push origin --tags",
60
61
  "postversion": "npm publish",
61
62
  "preversion": "npm test",
62
- "test": "tap test/*.js --cov"
63
+ "test": "tap"
63
64
  },
64
- "version": "3.0.4"
65
+ "version": "3.1.2"
65
66
  }
@@ -165,7 +165,12 @@ module.exports = class Minipass extends Stream {
165
165
  // because we're mid-write, so that'd be bad.
166
166
  if (this[BUFFERLENGTH] !== 0)
167
167
  this[FLUSH](true)
168
- this.emit('data', chunk)
168
+
169
+ // if we are still flowing after flushing the buffer we can emit the
170
+ // chunk otherwise we have to buffer it.
171
+ this.flowing
172
+ ? this.emit('data', chunk)
173
+ : this[BUFFERPUSH](chunk)
169
174
  } else
170
175
  this[BUFFERPUSH](chunk)
171
176
 
@@ -1,8 +1,8 @@
1
1
  {
2
2
  "_from": "minipass@^3.0.0",
3
- "_id": "minipass@3.1.5",
3
+ "_id": "minipass@3.1.6",
4
4
  "_inBundle": false,
5
- "_integrity": "sha512-+8NzxD82XQoNKNrl1d/FSi+X8wAEWR+sbYAfIvub4Nz0d22plFG72CEVVaufV8PNf4qSslFTD8VMOxNVhHCjTw==",
5
+ "_integrity": "sha512-rty5kpw9/z8SX9dmxblFA6edItUmwJgMeYDZRrwlIVN27i8gysGbznJwUggw2V/FVqFSDdWy040ZPS811DYAqQ==",
6
6
  "_location": "/minipass",
7
7
  "_phantomChildren": {},
8
8
  "_requested": {
@@ -20,8 +20,8 @@
20
20
  "/minizlib",
21
21
  "/tar"
22
22
  ],
23
- "_resolved": "https://registry.npmjs.org/minipass/-/minipass-3.1.5.tgz",
24
- "_shasum": "71f6251b0a33a49c01b3cf97ff77eda030dff732",
23
+ "_resolved": "https://registry.npmjs.org/minipass/-/minipass-3.1.6.tgz",
24
+ "_shasum": "3b8150aa688a711a1521af5e8779c1d3bb4f45ee",
25
25
  "_spec": "minipass@^3.0.0",
26
26
  "_where": "/home/runner/work/MuhammaraJS/MuhammaraJS/node_modules/tar",
27
27
  "author": {
@@ -70,5 +70,5 @@
70
70
  "tap": {
71
71
  "check-coverage": true
72
72
  },
73
- "version": "3.1.5"
73
+ "version": "3.1.6"
74
74
  }
@@ -1401,9 +1401,17 @@ AbortError.prototype = Object.create(Error.prototype);
1401
1401
  AbortError.prototype.constructor = AbortError;
1402
1402
  AbortError.prototype.name = 'AbortError';
1403
1403
 
1404
+ const URL$1 = Url.URL || whatwgUrl.URL;
1405
+
1404
1406
  // fix an issue where "PassThrough", "resolve" aren't a named export for node <10
1405
1407
  const PassThrough$1 = Stream.PassThrough;
1406
- const resolve_url = Url.resolve;
1408
+
1409
+ const isDomainOrSubdomain = function isDomainOrSubdomain(destination, original) {
1410
+ const orig = new URL$1(original).hostname;
1411
+ const dest = new URL$1(destination).hostname;
1412
+
1413
+ return orig === dest || orig[orig.length - dest.length - 1] === '.' && orig.endsWith(dest);
1414
+ };
1407
1415
 
1408
1416
  /**
1409
1417
  * Fetch function
@@ -1491,7 +1499,19 @@ function fetch(url, opts) {
1491
1499
  const location = headers.get('Location');
1492
1500
 
1493
1501
  // HTTP fetch step 5.3
1494
- const locationURL = location === null ? null : resolve_url(request.url, location);
1502
+ let locationURL = null;
1503
+ try {
1504
+ locationURL = location === null ? null : new URL$1(location, request.url).toString();
1505
+ } catch (err) {
1506
+ // error here can only be invalid URL in Location: header
1507
+ // do not throw when options.redirect == manual
1508
+ // let the user extract the errorneous redirect URL
1509
+ if (request.redirect !== 'manual') {
1510
+ reject(new FetchError(`uri requested responds with an invalid redirect URL: ${location}`, 'invalid-redirect'));
1511
+ finalize();
1512
+ return;
1513
+ }
1514
+ }
1495
1515
 
1496
1516
  // HTTP fetch step 5.5
1497
1517
  switch (request.redirect) {
@@ -1539,6 +1559,12 @@ function fetch(url, opts) {
1539
1559
  size: request.size
1540
1560
  };
1541
1561
 
1562
+ if (!isDomainOrSubdomain(request.url, locationURL)) {
1563
+ for (const name of ['authorization', 'www-authenticate', 'cookie', 'cookie2']) {
1564
+ requestOpts.headers.delete(name);
1565
+ }
1566
+ }
1567
+
1542
1568
  // HTTP-redirect fetch step 9
1543
1569
  if (res.statusCode !== 303 && request.body && getTotalBytes(request) === null) {
1544
1570
  reject(new FetchError('Cannot follow redirect with body being a readable stream', 'unsupported-redirect'));
@@ -1405,9 +1405,17 @@ AbortError.prototype = Object.create(Error.prototype);
1405
1405
  AbortError.prototype.constructor = AbortError;
1406
1406
  AbortError.prototype.name = 'AbortError';
1407
1407
 
1408
+ const URL$1 = Url.URL || whatwgUrl.URL;
1409
+
1408
1410
  // fix an issue where "PassThrough", "resolve" aren't a named export for node <10
1409
1411
  const PassThrough$1 = Stream.PassThrough;
1410
- const resolve_url = Url.resolve;
1412
+
1413
+ const isDomainOrSubdomain = function isDomainOrSubdomain(destination, original) {
1414
+ const orig = new URL$1(original).hostname;
1415
+ const dest = new URL$1(destination).hostname;
1416
+
1417
+ return orig === dest || orig[orig.length - dest.length - 1] === '.' && orig.endsWith(dest);
1418
+ };
1411
1419
 
1412
1420
  /**
1413
1421
  * Fetch function
@@ -1495,7 +1503,19 @@ function fetch(url, opts) {
1495
1503
  const location = headers.get('Location');
1496
1504
 
1497
1505
  // HTTP fetch step 5.3
1498
- const locationURL = location === null ? null : resolve_url(request.url, location);
1506
+ let locationURL = null;
1507
+ try {
1508
+ locationURL = location === null ? null : new URL$1(location, request.url).toString();
1509
+ } catch (err) {
1510
+ // error here can only be invalid URL in Location: header
1511
+ // do not throw when options.redirect == manual
1512
+ // let the user extract the errorneous redirect URL
1513
+ if (request.redirect !== 'manual') {
1514
+ reject(new FetchError(`uri requested responds with an invalid redirect URL: ${location}`, 'invalid-redirect'));
1515
+ finalize();
1516
+ return;
1517
+ }
1518
+ }
1499
1519
 
1500
1520
  // HTTP fetch step 5.5
1501
1521
  switch (request.redirect) {
@@ -1543,6 +1563,12 @@ function fetch(url, opts) {
1543
1563
  size: request.size
1544
1564
  };
1545
1565
 
1566
+ if (!isDomainOrSubdomain(request.url, locationURL)) {
1567
+ for (const name of ['authorization', 'www-authenticate', 'cookie', 'cookie2']) {
1568
+ requestOpts.headers.delete(name);
1569
+ }
1570
+ }
1571
+
1546
1572
  // HTTP-redirect fetch step 9
1547
1573
  if (res.statusCode !== 303 && request.body && getTotalBytes(request) === null) {
1548
1574
  reject(new FetchError('Cannot follow redirect with body being a readable stream', 'unsupported-redirect'));
@@ -1399,9 +1399,17 @@ AbortError.prototype = Object.create(Error.prototype);
1399
1399
  AbortError.prototype.constructor = AbortError;
1400
1400
  AbortError.prototype.name = 'AbortError';
1401
1401
 
1402
+ const URL$1 = Url.URL || whatwgUrl.URL;
1403
+
1402
1404
  // fix an issue where "PassThrough", "resolve" aren't a named export for node <10
1403
1405
  const PassThrough$1 = Stream.PassThrough;
1404
- const resolve_url = Url.resolve;
1406
+
1407
+ const isDomainOrSubdomain = function isDomainOrSubdomain(destination, original) {
1408
+ const orig = new URL$1(original).hostname;
1409
+ const dest = new URL$1(destination).hostname;
1410
+
1411
+ return orig === dest || orig[orig.length - dest.length - 1] === '.' && orig.endsWith(dest);
1412
+ };
1405
1413
 
1406
1414
  /**
1407
1415
  * Fetch function
@@ -1489,7 +1497,19 @@ function fetch(url, opts) {
1489
1497
  const location = headers.get('Location');
1490
1498
 
1491
1499
  // HTTP fetch step 5.3
1492
- const locationURL = location === null ? null : resolve_url(request.url, location);
1500
+ let locationURL = null;
1501
+ try {
1502
+ locationURL = location === null ? null : new URL$1(location, request.url).toString();
1503
+ } catch (err) {
1504
+ // error here can only be invalid URL in Location: header
1505
+ // do not throw when options.redirect == manual
1506
+ // let the user extract the errorneous redirect URL
1507
+ if (request.redirect !== 'manual') {
1508
+ reject(new FetchError(`uri requested responds with an invalid redirect URL: ${location}`, 'invalid-redirect'));
1509
+ finalize();
1510
+ return;
1511
+ }
1512
+ }
1493
1513
 
1494
1514
  // HTTP fetch step 5.5
1495
1515
  switch (request.redirect) {
@@ -1537,6 +1557,12 @@ function fetch(url, opts) {
1537
1557
  size: request.size
1538
1558
  };
1539
1559
 
1560
+ if (!isDomainOrSubdomain(request.url, locationURL)) {
1561
+ for (const name of ['authorization', 'www-authenticate', 'cookie', 'cookie2']) {
1562
+ requestOpts.headers.delete(name);
1563
+ }
1564
+ }
1565
+
1540
1566
  // HTTP-redirect fetch step 9
1541
1567
  if (res.statusCode !== 303 && request.body && getTotalBytes(request) === null) {
1542
1568
  reject(new FetchError('Cannot follow redirect with body being a readable stream', 'unsupported-redirect'));
@@ -1,8 +1,8 @@
1
1
  {
2
2
  "_from": "node-fetch@^2.6.5",
3
- "_id": "node-fetch@2.6.6",
3
+ "_id": "node-fetch@2.6.7",
4
4
  "_inBundle": false,
5
- "_integrity": "sha512-Z8/6vRlTUChSdIgMa51jxQ4lrw/Jy5SOW10ObaA47/RElsAN2c5Pn8bTgFGWn/ibwzXTE8qwr1Yzx28vsecXEA==",
5
+ "_integrity": "sha512-ZjMPFEfVx5j+y2yF35Kzx5sF7kDzxuDj6ziH4FFbOp87zKDZNx8yExJIb05OGF4Nlt9IHFIMBkRl41VdvcNdbQ==",
6
6
  "_location": "/node-fetch",
7
7
  "_phantomChildren": {},
8
8
  "_requested": {
@@ -18,8 +18,8 @@
18
18
  "_requiredBy": [
19
19
  "/@mapbox/node-pre-gyp"
20
20
  ],
21
- "_resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-2.6.6.tgz",
22
- "_shasum": "1751a7c01834e8e1697758732e9efb6eeadfaf89",
21
+ "_resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-2.6.7.tgz",
22
+ "_shasum": "24de9fba827e3b4ae44dc8b20256a379160052ad",
23
23
  "_spec": "node-fetch@^2.6.5",
24
24
  "_where": "/home/runner/work/MuhammaraJS/MuhammaraJS/node_modules/@mapbox/node-pre-gyp",
25
25
  "author": {
@@ -80,6 +80,14 @@
80
80
  "main": "lib/index.js",
81
81
  "module": "lib/index.mjs",
82
82
  "name": "node-fetch",
83
+ "peerDependencies": {
84
+ "encoding": "^0.1.0"
85
+ },
86
+ "peerDependenciesMeta": {
87
+ "encoding": {
88
+ "optional": true
89
+ }
90
+ },
83
91
  "repository": {
84
92
  "type": "git",
85
93
  "url": "git+https://github.com/bitinn/node-fetch.git"
@@ -91,5 +99,5 @@
91
99
  "report": "cross-env BABEL_ENV=coverage nyc --reporter lcov --reporter text mocha -R spec test/test.js",
92
100
  "test": "cross-env BABEL_ENV=test mocha --require babel-register --throw-deprecation test/test.js"
93
101
  },
94
- "version": "2.6.6"
102
+ "version": "2.6.7"
95
103
  }
@@ -0,0 +1,15 @@
1
+ The ISC License
2
+
3
+ Copyright (c) Isaac Z. Schlueter and Contributors
4
+
5
+ Permission to use, copy, modify, and/or distribute this software for any
6
+ purpose with or without fee is hereby granted, provided that the above
7
+ copyright notice and this permission notice appear in all copies.
8
+
9
+ THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
10
+ WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
11
+ MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
12
+ ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
13
+ WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
14
+ ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR
15
+ IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.