fsevents 1.2.8 → 1.2.12

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 (187) hide show
  1. package/.travis.yml +1 -0
  2. package/binding.gyp +1 -9
  3. package/fsevents.cc +8 -11
  4. package/fsevents.js +1 -3
  5. package/node_modules/abbrev/package.json +1 -1
  6. package/node_modules/ansi-regex/package.json +1 -1
  7. package/node_modules/aproba/package.json +1 -1
  8. package/node_modules/are-we-there-yet/package.json +1 -1
  9. package/node_modules/balanced-match/package.json +1 -1
  10. package/node_modules/brace-expansion/package.json +1 -1
  11. package/node_modules/chownr/chownr.js +98 -19
  12. package/node_modules/chownr/package.json +13 -10
  13. package/node_modules/code-point-at/package.json +1 -1
  14. package/node_modules/concat-map/package.json +1 -1
  15. package/node_modules/console-control-strings/package.json +1 -1
  16. package/node_modules/core-util-is/package.json +1 -1
  17. package/node_modules/debug/README.md +0 -18
  18. package/node_modules/debug/dist/debug.js +2 -28
  19. package/node_modules/debug/node.js +1 -0
  20. package/node_modules/debug/package.json +12 -24
  21. package/node_modules/debug/src/browser.js +103 -187
  22. package/node_modules/debug/src/common.js +240 -257
  23. package/node_modules/debug/src/index.js +5 -3
  24. package/node_modules/debug/src/node.js +82 -165
  25. package/node_modules/deep-extend/package.json +1 -1
  26. package/node_modules/delegates/package.json +1 -1
  27. package/node_modules/detect-libc/package.json +2 -2
  28. package/node_modules/fs-minipass/index.js +2 -1
  29. package/node_modules/fs-minipass/package.json +13 -10
  30. package/node_modules/fs.realpath/package.json +1 -1
  31. package/node_modules/gauge/package.json +1 -1
  32. package/node_modules/glob/LICENSE +6 -0
  33. package/node_modules/glob/README.md +8 -1
  34. package/node_modules/glob/package.json +9 -6
  35. package/node_modules/has-unicode/package.json +1 -1
  36. package/node_modules/iconv-lite/package.json +1 -1
  37. package/node_modules/ignore-walk/README.md +1 -1
  38. package/node_modules/ignore-walk/index.js +9 -5
  39. package/node_modules/ignore-walk/package.json +11 -8
  40. package/node_modules/inflight/package.json +1 -1
  41. package/node_modules/inherits/inherits.js +2 -0
  42. package/node_modules/inherits/inherits_browser.js +18 -14
  43. package/node_modules/inherits/package.json +8 -8
  44. package/node_modules/ini/package.json +1 -1
  45. package/node_modules/is-fullwidth-code-point/package.json +1 -1
  46. package/node_modules/isarray/package.json +1 -1
  47. package/node_modules/minimatch/package.json +1 -1
  48. package/node_modules/minimist/.travis.yml +4 -0
  49. package/node_modules/minimist/example/parse.js +1 -1
  50. package/node_modules/minimist/index.js +112 -54
  51. package/node_modules/minimist/package.json +17 -14
  52. package/node_modules/minimist/readme.markdown +28 -6
  53. package/node_modules/{rc/node_modules/minimist → minimist}/test/all_bool.js +0 -0
  54. package/node_modules/{rc/node_modules/minimist → minimist}/test/bool.js +12 -0
  55. package/node_modules/minimist/test/dash.js +7 -0
  56. package/node_modules/minimist/test/default_bool.js +15 -0
  57. package/node_modules/minimist/test/dotted.js +6 -0
  58. package/node_modules/{rc/node_modules/minimist → minimist}/test/kv_short.js +0 -0
  59. package/node_modules/{rc/node_modules/minimist → minimist}/test/num.js +0 -0
  60. package/node_modules/minimist/test/parse.js +23 -144
  61. package/node_modules/minimist/test/parse_modified.js +1 -1
  62. package/node_modules/minimist/test/proto.js +44 -0
  63. package/node_modules/{rc/node_modules/minimist → minimist}/test/stop_early.js +0 -0
  64. package/node_modules/{rc/node_modules/minimist → minimist}/test/unknown.js +0 -0
  65. package/node_modules/minipass/README.md +486 -4
  66. package/node_modules/minipass/index.js +190 -28
  67. package/node_modules/minipass/package.json +17 -14
  68. package/node_modules/minizlib/README.md +36 -27
  69. package/node_modules/minizlib/constants.js +73 -4
  70. package/node_modules/minizlib/index.js +137 -152
  71. package/node_modules/minizlib/package.json +12 -12
  72. package/node_modules/mkdirp/package.json +17 -10
  73. package/node_modules/ms/index.js +2 -2
  74. package/node_modules/ms/package.json +6 -6
  75. package/node_modules/ms/readme.md +1 -1
  76. package/node_modules/needle/.github/workflows/nodejs.yml +27 -0
  77. package/node_modules/needle/README.md +5 -5
  78. package/node_modules/needle/lib/needle.js +11 -3
  79. package/node_modules/needle/package.json +8 -8
  80. package/node_modules/needle/test/compression_spec.js +18 -0
  81. package/node_modules/needle/test/headers_spec.js +1 -1
  82. package/node_modules/node-pre-gyp/CHANGELOG.md +11 -0
  83. package/node_modules/node-pre-gyp/lib/install.js +44 -14
  84. package/node_modules/node-pre-gyp/lib/util/abi_crosswalk.json +240 -0
  85. package/node_modules/node-pre-gyp/lib/util/napi.js +3 -2
  86. package/node_modules/node-pre-gyp/package.json +13 -13
  87. package/node_modules/nopt/lib/nopt.js +6 -1
  88. package/node_modules/nopt/package.json +15 -8
  89. package/node_modules/npm-bundled/index.js +13 -5
  90. package/node_modules/npm-bundled/package.json +9 -6
  91. package/node_modules/npm-normalize-package-bin/.github/settings.yml +2 -0
  92. package/node_modules/npm-normalize-package-bin/.npmignore +24 -0
  93. package/node_modules/npm-normalize-package-bin/LICENSE +15 -0
  94. package/node_modules/npm-normalize-package-bin/README.md +14 -0
  95. package/node_modules/npm-normalize-package-bin/index.js +60 -0
  96. package/node_modules/npm-normalize-package-bin/package-lock.json +3529 -0
  97. package/node_modules/npm-normalize-package-bin/package.json +58 -0
  98. package/node_modules/npm-normalize-package-bin/test/array.js +37 -0
  99. package/node_modules/npm-normalize-package-bin/test/nobin.js +35 -0
  100. package/node_modules/npm-normalize-package-bin/test/object.js +141 -0
  101. package/node_modules/npm-normalize-package-bin/test/string.js +37 -0
  102. package/node_modules/npm-packlist/index.js +55 -16
  103. package/node_modules/npm-packlist/package.json +18 -10
  104. package/node_modules/npmlog/package.json +1 -1
  105. package/node_modules/number-is-nan/package.json +1 -1
  106. package/node_modules/object-assign/package.json +1 -1
  107. package/node_modules/once/package.json +1 -1
  108. package/node_modules/os-homedir/package.json +1 -1
  109. package/node_modules/os-tmpdir/package.json +1 -1
  110. package/node_modules/osenv/package.json +1 -1
  111. package/node_modules/path-is-absolute/package.json +1 -1
  112. package/node_modules/process-nextick-args/index.js +2 -1
  113. package/node_modules/process-nextick-args/package.json +6 -6
  114. package/node_modules/rc/package.json +2 -2
  115. package/node_modules/readable-stream/.travis.yml +9 -30
  116. package/node_modules/readable-stream/lib/_stream_duplex.js +1 -1
  117. package/node_modules/readable-stream/lib/_stream_passthrough.js +1 -1
  118. package/node_modules/readable-stream/lib/_stream_readable.js +1 -1
  119. package/node_modules/readable-stream/lib/_stream_transform.js +1 -1
  120. package/node_modules/readable-stream/lib/_stream_writable.js +1 -1
  121. package/node_modules/readable-stream/package.json +6 -6
  122. package/node_modules/rimraf/package.json +7 -7
  123. package/node_modules/rimraf/rimraf.js +9 -1
  124. package/node_modules/safe-buffer/package.json +1 -1
  125. package/node_modules/safer-buffer/package.json +1 -1
  126. package/node_modules/sax/package.json +1 -1
  127. package/node_modules/semver/README.md +12 -11
  128. package/node_modules/semver/package.json +7 -7
  129. package/node_modules/set-blocking/package.json +1 -1
  130. package/node_modules/signal-exit/package.json +1 -1
  131. package/node_modules/string-width/package.json +1 -1
  132. package/node_modules/string_decoder/package.json +1 -1
  133. package/node_modules/strip-ansi/package.json +1 -1
  134. package/node_modules/strip-json-comments/package.json +1 -1
  135. package/node_modules/tar/lib/large-numbers.js +32 -27
  136. package/node_modules/tar/lib/mkdir.js +2 -2
  137. package/node_modules/tar/lib/parse.js +6 -1
  138. package/node_modules/tar/lib/read-entry.js +4 -0
  139. package/node_modules/tar/lib/write-entry.js +2 -2
  140. package/node_modules/tar/package.json +22 -18
  141. package/node_modules/util-deprecate/package.json +1 -1
  142. package/node_modules/wide-align/package.json +1 -1
  143. package/node_modules/wrappy/package.json +1 -1
  144. package/node_modules/yallist/package.json +11 -11
  145. package/node_modules/yallist/yallist.js +50 -0
  146. package/package.json +5 -15
  147. package/src/constants.cc +20 -20
  148. package/install.js +0 -7
  149. package/node_modules/mkdirp/.travis.yml +0 -8
  150. package/node_modules/mkdirp/examples/pow.js +0 -6
  151. package/node_modules/mkdirp/test/chmod.js +0 -41
  152. package/node_modules/mkdirp/test/clobber.js +0 -38
  153. package/node_modules/mkdirp/test/mkdirp.js +0 -28
  154. package/node_modules/mkdirp/test/opts_fs.js +0 -29
  155. package/node_modules/mkdirp/test/opts_fs_sync.js +0 -27
  156. package/node_modules/mkdirp/test/perm.js +0 -32
  157. package/node_modules/mkdirp/test/perm_sync.js +0 -36
  158. package/node_modules/mkdirp/test/race.js +0 -37
  159. package/node_modules/mkdirp/test/rel.js +0 -32
  160. package/node_modules/mkdirp/test/return.js +0 -25
  161. package/node_modules/mkdirp/test/return_sync.js +0 -24
  162. package/node_modules/mkdirp/test/root.js +0 -19
  163. package/node_modules/mkdirp/test/sync.js +0 -32
  164. package/node_modules/mkdirp/test/umask.js +0 -28
  165. package/node_modules/mkdirp/test/umask_sync.js +0 -32
  166. package/node_modules/needle/.npmignore +0 -6
  167. package/node_modules/needle/package-lock.json +0 -395
  168. package/node_modules/needle/test/keys/ssl.cert +0 -21
  169. package/node_modules/needle/test/keys/ssl.key +0 -27
  170. package/node_modules/nopt/.npmignore +0 -1
  171. package/node_modules/nopt/.travis.yml +0 -8
  172. package/node_modules/nopt/examples/my-program.js +0 -30
  173. package/node_modules/nopt/test/basic.js +0 -303
  174. package/node_modules/rc/node_modules/minimist/.travis.yml +0 -8
  175. package/node_modules/rc/node_modules/minimist/LICENSE +0 -18
  176. package/node_modules/rc/node_modules/minimist/example/parse.js +0 -2
  177. package/node_modules/rc/node_modules/minimist/index.js +0 -236
  178. package/node_modules/rc/node_modules/minimist/package.json +0 -73
  179. package/node_modules/rc/node_modules/minimist/readme.markdown +0 -91
  180. package/node_modules/rc/node_modules/minimist/test/dash.js +0 -31
  181. package/node_modules/rc/node_modules/minimist/test/default_bool.js +0 -35
  182. package/node_modules/rc/node_modules/minimist/test/dotted.js +0 -22
  183. package/node_modules/rc/node_modules/minimist/test/long.js +0 -31
  184. package/node_modules/rc/node_modules/minimist/test/parse.js +0 -197
  185. package/node_modules/rc/node_modules/minimist/test/parse_modified.js +0 -9
  186. package/node_modules/rc/node_modules/minimist/test/short.js +0 -67
  187. package/node_modules/rc/node_modules/minimist/test/whitespace.js +0 -8
@@ -5,15 +5,21 @@ const Buffer = require('buffer').Buffer
5
5
  const realZlib = require('zlib')
6
6
 
7
7
  const constants = exports.constants = require('./constants.js')
8
- const MiniPass = require('minipass')
8
+ const Minipass = require('minipass')
9
9
 
10
10
  const OriginalBufferConcat = Buffer.concat
11
11
 
12
12
  class ZlibError extends Error {
13
- constructor (msg, errno) {
14
- super('zlib: ' + msg)
15
- this.errno = errno
16
- this.code = codes.get(errno)
13
+ constructor (err) {
14
+ super('zlib: ' + err.message)
15
+ this.code = err.code
16
+ this.errno = err.errno
17
+ /* istanbul ignore if */
18
+ if (!this.code)
19
+ this.code = 'ZLIB_ERROR'
20
+
21
+ this.message = 'zlib: ' + err.message
22
+ Error.captureStackTrace(this, this.constructor)
17
23
  }
18
24
 
19
25
  get name () {
@@ -21,126 +27,51 @@ class ZlibError extends Error {
21
27
  }
22
28
  }
23
29
 
24
- // translation table for return codes.
25
- const codes = new Map([
26
- [constants.Z_OK, 'Z_OK'],
27
- [constants.Z_STREAM_END, 'Z_STREAM_END'],
28
- [constants.Z_NEED_DICT, 'Z_NEED_DICT'],
29
- [constants.Z_ERRNO, 'Z_ERRNO'],
30
- [constants.Z_STREAM_ERROR, 'Z_STREAM_ERROR'],
31
- [constants.Z_DATA_ERROR, 'Z_DATA_ERROR'],
32
- [constants.Z_MEM_ERROR, 'Z_MEM_ERROR'],
33
- [constants.Z_BUF_ERROR, 'Z_BUF_ERROR'],
34
- [constants.Z_VERSION_ERROR, 'Z_VERSION_ERROR']
35
- ])
36
-
37
- const validFlushFlags = new Set([
38
- constants.Z_NO_FLUSH,
39
- constants.Z_PARTIAL_FLUSH,
40
- constants.Z_SYNC_FLUSH,
41
- constants.Z_FULL_FLUSH,
42
- constants.Z_FINISH,
43
- constants.Z_BLOCK
44
- ])
45
-
46
- const strategies = new Set([
47
- constants.Z_FILTERED,
48
- constants.Z_HUFFMAN_ONLY,
49
- constants.Z_RLE,
50
- constants.Z_FIXED,
51
- constants.Z_DEFAULT_STRATEGY
52
- ])
53
-
54
30
  // the Zlib class they all inherit from
55
31
  // This thing manages the queue of requests, and returns
56
32
  // true or false if there is anything in the queue when
57
33
  // you call the .write() method.
58
34
  const _opts = Symbol('opts')
59
35
  const _flushFlag = Symbol('flushFlag')
60
- const _finishFlush = Symbol('finishFlush')
36
+ const _finishFlushFlag = Symbol('finishFlushFlag')
37
+ const _fullFlushFlag = Symbol('fullFlushFlag')
61
38
  const _handle = Symbol('handle')
62
39
  const _onError = Symbol('onError')
40
+ const _sawError = Symbol('sawError')
63
41
  const _level = Symbol('level')
64
42
  const _strategy = Symbol('strategy')
65
43
  const _ended = Symbol('ended')
44
+ const _defaultFullFlush = Symbol('_defaultFullFlush')
66
45
 
67
- class Zlib extends MiniPass {
46
+ class ZlibBase extends Minipass {
68
47
  constructor (opts, mode) {
48
+ if (!opts || typeof opts !== 'object')
49
+ throw new TypeError('invalid options for ZlibBase constructor')
50
+
69
51
  super(opts)
70
52
  this[_ended] = false
71
- this[_opts] = opts = opts || {}
72
- if (opts.flush && !validFlushFlags.has(opts.flush)) {
73
- throw new TypeError('Invalid flush flag: ' + opts.flush)
74
- }
75
- if (opts.finishFlush && !validFlushFlags.has(opts.finishFlush)) {
76
- throw new TypeError('Invalid flush flag: ' + opts.finishFlush)
77
- }
78
-
79
- this[_flushFlag] = opts.flush || constants.Z_NO_FLUSH
80
- this[_finishFlush] = typeof opts.finishFlush !== 'undefined' ?
81
- opts.finishFlush : constants.Z_FINISH
82
-
83
- if (opts.chunkSize) {
84
- if (opts.chunkSize < constants.Z_MIN_CHUNK) {
85
- throw new RangeError('Invalid chunk size: ' + opts.chunkSize)
86
- }
87
- }
88
-
89
- if (opts.windowBits) {
90
- if (opts.windowBits < constants.Z_MIN_WINDOWBITS ||
91
- opts.windowBits > constants.Z_MAX_WINDOWBITS) {
92
- throw new RangeError('Invalid windowBits: ' + opts.windowBits)
93
- }
94
- }
95
-
96
- if (opts.level) {
97
- if (opts.level < constants.Z_MIN_LEVEL ||
98
- opts.level > constants.Z_MAX_LEVEL) {
99
- throw new RangeError('Invalid compression level: ' + opts.level)
100
- }
101
- }
53
+ this[_opts] = opts
102
54
 
103
- if (opts.memLevel) {
104
- if (opts.memLevel < constants.Z_MIN_MEMLEVEL ||
105
- opts.memLevel > constants.Z_MAX_MEMLEVEL) {
106
- throw new RangeError('Invalid memLevel: ' + opts.memLevel)
107
- }
108
- }
109
-
110
- if (opts.strategy && !(strategies.has(opts.strategy)))
111
- throw new TypeError('Invalid strategy: ' + opts.strategy)
112
-
113
- if (opts.dictionary) {
114
- if (!(opts.dictionary instanceof Buffer)) {
115
- throw new TypeError('Invalid dictionary: it should be a Buffer instance')
116
- }
55
+ this[_flushFlag] = opts.flush
56
+ this[_finishFlushFlag] = opts.finishFlush
57
+ // this will throw if any options are invalid for the class selected
58
+ try {
59
+ this[_handle] = new realZlib[mode](opts)
60
+ } catch (er) {
61
+ // make sure that all errors get decorated properly
62
+ throw new ZlibError(er)
117
63
  }
118
64
 
119
- this[_handle] = new realZlib[mode](opts)
120
-
121
65
  this[_onError] = (err) => {
66
+ this[_sawError] = true
122
67
  // there is no way to cleanly recover.
123
68
  // continuing only obscures problems.
124
69
  this.close()
125
-
126
- const error = new ZlibError(err.message, err.errno)
127
- this.emit('error', error)
70
+ this.emit('error', err)
128
71
  }
129
- this[_handle].on('error', this[_onError])
130
72
 
131
- const level = typeof opts.level === 'number' ? opts.level
132
- : constants.Z_DEFAULT_COMPRESSION
133
-
134
- var strategy = typeof opts.strategy === 'number' ? opts.strategy
135
- : constants.Z_DEFAULT_STRATEGY
136
-
137
- // API changed in node v9
138
- /* istanbul ignore next */
139
-
140
- this[_level] = level
141
- this[_strategy] = strategy
142
-
143
- this.once('end', this.close)
73
+ this[_handle].on('error', er => this[_onError](new ZlibError(er)))
74
+ this.once('end', () => this.close)
144
75
  }
145
76
 
146
77
  close () {
@@ -151,66 +82,26 @@ class Zlib extends MiniPass {
151
82
  }
152
83
  }
153
84
 
154
- params (level, strategy) {
155
- if (!this[_handle])
156
- throw new Error('cannot switch params when binding is closed')
157
-
158
- // no way to test this without also not supporting params at all
159
- /* istanbul ignore if */
160
- if (!this[_handle].params)
161
- throw new Error('not supported in this implementation')
162
-
163
- if (level < constants.Z_MIN_LEVEL ||
164
- level > constants.Z_MAX_LEVEL) {
165
- throw new RangeError('Invalid compression level: ' + level)
166
- }
167
-
168
- if (!(strategies.has(strategy)))
169
- throw new TypeError('Invalid strategy: ' + strategy)
170
-
171
- if (this[_level] !== level || this[_strategy] !== strategy) {
172
- this.flush(constants.Z_SYNC_FLUSH)
85
+ reset () {
86
+ if (!this[_sawError]) {
173
87
  assert(this[_handle], 'zlib binding closed')
174
- // .params() calls .flush(), but the latter is always async in the
175
- // core zlib. We override .flush() temporarily to intercept that and
176
- // flush synchronously.
177
- const origFlush = this[_handle].flush
178
- this[_handle].flush = (flushFlag, cb) => {
179
- this[_handle].flush = origFlush
180
- this.flush(flushFlag)
181
- cb()
182
- }
183
- this[_handle].params(level, strategy)
184
- /* istanbul ignore else */
185
- if (this[_handle]) {
186
- this[_level] = level
187
- this[_strategy] = strategy
188
- }
88
+ return this[_handle].reset()
189
89
  }
190
90
  }
191
91
 
192
- reset () {
193
- assert(this[_handle], 'zlib binding closed')
194
- return this[_handle].reset()
195
- }
196
-
197
- flush (kind) {
198
- if (kind === undefined)
199
- kind = constants.Z_FULL_FLUSH
200
-
92
+ flush (flushFlag) {
201
93
  if (this.ended)
202
94
  return
203
95
 
204
- const flushFlag = this[_flushFlag]
205
- this[_flushFlag] = kind
206
- this.write(Buffer.alloc(0))
207
- this[_flushFlag] = flushFlag
96
+ if (typeof flushFlag !== 'number')
97
+ flushFlag = this[_fullFlushFlag]
98
+ this.write(Object.assign(Buffer.alloc(0), { [_flushFlag]: flushFlag }))
208
99
  }
209
100
 
210
101
  end (chunk, encoding, cb) {
211
102
  if (chunk)
212
103
  this.write(chunk, encoding)
213
- this.flush(this[_finishFlush])
104
+ this.flush(this[_finishFlushFlag])
214
105
  this[_ended] = true
215
106
  return super.end(null, null, cb)
216
107
  }
@@ -228,6 +119,8 @@ class Zlib extends MiniPass {
228
119
  if (typeof chunk === 'string')
229
120
  chunk = Buffer.from(chunk, encoding)
230
121
 
122
+ if (this[_sawError])
123
+ return
231
124
  assert(this[_handle], 'zlib binding closed')
232
125
 
233
126
  // _processChunk tries to .close() the native handle after it's done, so we
@@ -242,11 +135,17 @@ class Zlib extends MiniPass {
242
135
  Buffer.concat = (args) => args
243
136
  let result
244
137
  try {
245
- result = this[_handle]._processChunk(chunk, this[_flushFlag])
138
+ const flushFlag = typeof chunk[_flushFlag] === 'number'
139
+ ? chunk[_flushFlag] : this[_flushFlag]
140
+ result = this[_handle]._processChunk(chunk, flushFlag)
141
+ // if we don't throw, reset it back how it was
142
+ Buffer.concat = OriginalBufferConcat
246
143
  } catch (err) {
247
- this[_onError](err)
248
- } finally {
144
+ // or if we do, put Buffer.concat() back before we emit error
145
+ // Error events call into user code, which may call Buffer.concat()
249
146
  Buffer.concat = OriginalBufferConcat
147
+ this[_onError](new ZlibError(err))
148
+ } finally {
250
149
  if (this[_handle]) {
251
150
  // Core zlib resets `_handle` to null after attempting to close the
252
151
  // native handle. Our no-op handler prevented actual closure, but we
@@ -280,6 +179,56 @@ class Zlib extends MiniPass {
280
179
  }
281
180
  }
282
181
 
182
+ class Zlib extends ZlibBase {
183
+ constructor (opts, mode) {
184
+ opts = opts || {}
185
+
186
+ opts.flush = opts.flush || constants.Z_NO_FLUSH
187
+ opts.finishFlush = opts.finishFlush || constants.Z_FINISH
188
+ super(opts, mode)
189
+
190
+ this[_fullFlushFlag] = constants.Z_FULL_FLUSH
191
+ this[_level] = opts.level
192
+ this[_strategy] = opts.strategy
193
+ }
194
+
195
+ params (level, strategy) {
196
+ if (this[_sawError])
197
+ return
198
+
199
+ if (!this[_handle])
200
+ throw new Error('cannot switch params when binding is closed')
201
+
202
+ // no way to test this without also not supporting params at all
203
+ /* istanbul ignore if */
204
+ if (!this[_handle].params)
205
+ throw new Error('not supported in this implementation')
206
+
207
+ if (this[_level] !== level || this[_strategy] !== strategy) {
208
+ this.flush(constants.Z_SYNC_FLUSH)
209
+ assert(this[_handle], 'zlib binding closed')
210
+ // .params() calls .flush(), but the latter is always async in the
211
+ // core zlib. We override .flush() temporarily to intercept that and
212
+ // flush synchronously.
213
+ const origFlush = this[_handle].flush
214
+ this[_handle].flush = (flushFlag, cb) => {
215
+ this.flush(flushFlag)
216
+ cb()
217
+ }
218
+ try {
219
+ this[_handle].params(level, strategy)
220
+ } finally {
221
+ this[_handle].flush = origFlush
222
+ }
223
+ /* istanbul ignore else */
224
+ if (this[_handle]) {
225
+ this[_level] = level
226
+ this[_strategy] = strategy
227
+ }
228
+ }
229
+ }
230
+ }
231
+
283
232
  // minimal 2-byte header
284
233
  class Deflate extends Zlib {
285
234
  constructor (opts) {
@@ -326,6 +275,31 @@ class Unzip extends Zlib {
326
275
  }
327
276
  }
328
277
 
278
+ class Brotli extends ZlibBase {
279
+ constructor (opts, mode) {
280
+ opts = opts || {}
281
+
282
+ opts.flush = opts.flush || constants.BROTLI_OPERATION_PROCESS
283
+ opts.finishFlush = opts.finishFlush || constants.BROTLI_OPERATION_FINISH
284
+
285
+ super(opts, mode)
286
+
287
+ this[_fullFlushFlag] = constants.BROTLI_OPERATION_FLUSH
288
+ }
289
+ }
290
+
291
+ class BrotliCompress extends Brotli {
292
+ constructor (opts) {
293
+ super(opts, 'BrotliCompress')
294
+ }
295
+ }
296
+
297
+ class BrotliDecompress extends Brotli {
298
+ constructor (opts) {
299
+ super(opts, 'BrotliDecompress')
300
+ }
301
+ }
302
+
329
303
  exports.Deflate = Deflate
330
304
  exports.Inflate = Inflate
331
305
  exports.Gzip = Gzip
@@ -333,3 +307,14 @@ exports.Gunzip = Gunzip
333
307
  exports.DeflateRaw = DeflateRaw
334
308
  exports.InflateRaw = InflateRaw
335
309
  exports.Unzip = Unzip
310
+ /* istanbul ignore else */
311
+ if (typeof realZlib.BrotliCompress === 'function') {
312
+ exports.BrotliCompress = BrotliCompress
313
+ exports.BrotliDecompress = BrotliDecompress
314
+ } else {
315
+ exports.BrotliCompress = exports.BrotliDecompress = class {
316
+ constructor () {
317
+ throw new Error('Brotli is not supported in this version of Node.js')
318
+ }
319
+ }
320
+ }
@@ -1,27 +1,27 @@
1
1
  {
2
- "_from": "minizlib@^1.1.1",
3
- "_id": "minizlib@1.2.1",
2
+ "_from": "minizlib@^1.2.1",
3
+ "_id": "minizlib@1.3.3",
4
4
  "_inBundle": false,
5
- "_integrity": "sha512-7+4oTUOWKg7AuL3vloEWekXY2/D20cevzsrNT2kGWm+39J9hGTCBv8VI5Pm5lXZ/o3/mdR4f8rflAPhnQb8mPA==",
5
+ "_integrity": "sha512-6ZYMOEnmVsdCeTJVE0W9ZD+pVnE8h9Hma/iOwwRDsdQoePpoX56/8B6z3P9VNwppJuBKNRuFDRNRqRWexT9G9Q==",
6
6
  "_location": "/minizlib",
7
7
  "_phantomChildren": {},
8
8
  "_requested": {
9
9
  "type": "range",
10
10
  "registry": true,
11
- "raw": "minizlib@^1.1.1",
11
+ "raw": "minizlib@^1.2.1",
12
12
  "name": "minizlib",
13
13
  "escapedName": "minizlib",
14
- "rawSpec": "^1.1.1",
14
+ "rawSpec": "^1.2.1",
15
15
  "saveSpec": null,
16
- "fetchSpec": "^1.1.1"
16
+ "fetchSpec": "^1.2.1"
17
17
  },
18
18
  "_requiredBy": [
19
19
  "/tar"
20
20
  ],
21
- "_resolved": "https://registry.npmjs.org/minizlib/-/minizlib-1.2.1.tgz",
22
- "_shasum": "dd27ea6136243c7c880684e8672bb3a45fd9b614",
23
- "_spec": "minizlib@^1.1.1",
24
- "_where": "/Users/pipobscure/fsevents/node_modules/tar",
21
+ "_resolved": "https://registry.npmjs.org/minizlib/-/minizlib-1.3.3.tgz",
22
+ "_shasum": "2290de96818a34c29551c8a8d301216bd65a861d",
23
+ "_spec": "minizlib@^1.2.1",
24
+ "_where": "/Users/user/Developer/personal/fsevents/node_modules/tar",
25
25
  "author": {
26
26
  "name": "Isaac Z. Schlueter",
27
27
  "email": "i@izs.me",
@@ -32,7 +32,7 @@
32
32
  },
33
33
  "bundleDependencies": false,
34
34
  "dependencies": {
35
- "minipass": "^2.2.1"
35
+ "minipass": "^2.9.0"
36
36
  },
37
37
  "deprecated": false,
38
38
  "description": "A small fast zlib stream built on [minipass](http://npm.im/minipass) and Node.js's zlib binding.",
@@ -67,5 +67,5 @@
67
67
  "preversion": "npm test",
68
68
  "test": "tap test/*.js --100 -J"
69
69
  },
70
- "version": "1.2.1"
70
+ "version": "1.3.3"
71
71
  }
@@ -1,8 +1,8 @@
1
1
  {
2
2
  "_from": "mkdirp@^0.5.1",
3
- "_id": "mkdirp@0.5.1",
3
+ "_id": "mkdirp@0.5.3",
4
4
  "_inBundle": false,
5
- "_integrity": "sha1-MAV0OOrGz3+MR2fzhkjWaX11yQM=",
5
+ "_integrity": "sha512-P+2gwrFqx8lhew375MQHHeTlY8AuOJSrGf0R5ddkEndUkmwpgUob/vQuBD1V22/Cw1/lJr4x+EjllSezBThzBg==",
6
6
  "_location": "/mkdirp",
7
7
  "_phantomChildren": {},
8
8
  "_requested": {
@@ -19,10 +19,10 @@
19
19
  "/node-pre-gyp",
20
20
  "/tar"
21
21
  ],
22
- "_resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-0.5.1.tgz",
23
- "_shasum": "30057438eac6cf7f8c4767f38648d6697d75c903",
22
+ "_resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-0.5.3.tgz",
23
+ "_shasum": "5a514b7179259287952881e94410ec5465659f8c",
24
24
  "_spec": "mkdirp@^0.5.1",
25
- "_where": "/Users/pipobscure/fsevents/node_modules/node-pre-gyp",
25
+ "_where": "/Users/user/Developer/personal/fsevents/node_modules/node-pre-gyp",
26
26
  "author": {
27
27
  "name": "James Halliday",
28
28
  "email": "mail@substack.net",
@@ -36,14 +36,18 @@
36
36
  },
37
37
  "bundleDependencies": false,
38
38
  "dependencies": {
39
- "minimist": "0.0.8"
39
+ "minimist": "^1.2.5"
40
40
  },
41
- "deprecated": false,
41
+ "deprecated": "Legacy versions of mkdirp are no longer supported. Please update to mkdirp 1.x. (Note that the API surface has changed to use Promises in 1.x.)",
42
42
  "description": "Recursively mkdir, like `mkdir -p`",
43
43
  "devDependencies": {
44
- "mock-fs": "2 >=2.7.0",
45
- "tap": "1"
44
+ "mock-fs": "^3.7.0",
45
+ "tap": "^5.4.2"
46
46
  },
47
+ "files": [
48
+ "bin",
49
+ "index.js"
50
+ ],
47
51
  "homepage": "https://github.com/substack/node-mkdirp#readme",
48
52
  "keywords": [
49
53
  "mkdir",
@@ -52,6 +56,9 @@
52
56
  "license": "MIT",
53
57
  "main": "index.js",
54
58
  "name": "mkdirp",
59
+ "publishConfig": {
60
+ "tag": "legacy"
61
+ },
55
62
  "repository": {
56
63
  "type": "git",
57
64
  "url": "git+https://github.com/substack/node-mkdirp.git"
@@ -59,5 +66,5 @@
59
66
  "scripts": {
60
67
  "test": "tap test/*.js"
61
68
  },
62
- "version": "0.5.1"
69
+ "version": "0.5.3"
63
70
  }
@@ -28,7 +28,7 @@ module.exports = function(val, options) {
28
28
  var type = typeof val;
29
29
  if (type === 'string' && val.length > 0) {
30
30
  return parse(val);
31
- } else if (type === 'number' && isNaN(val) === false) {
31
+ } else if (type === 'number' && isFinite(val)) {
32
32
  return options.long ? fmtLong(val) : fmtShort(val);
33
33
  }
34
34
  throw new Error(
@@ -50,7 +50,7 @@ function parse(str) {
50
50
  if (str.length > 100) {
51
51
  return;
52
52
  }
53
- var match = /^((?:\d+)?\-?\d?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(
53
+ var match = /^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(
54
54
  str
55
55
  );
56
56
  if (!match) {
@@ -1,8 +1,8 @@
1
1
  {
2
2
  "_from": "ms@^2.1.1",
3
- "_id": "ms@2.1.1",
3
+ "_id": "ms@2.1.2",
4
4
  "_inBundle": false,
5
- "_integrity": "sha512-tgp+dl5cGk28utYktBsrFqA7HKgrhgPsg6Z/EfhWI4gl1Hwq8B/GmY/0oXZ6nF8hDVesS/FpnYaD/kOWhYQvyg==",
5
+ "_integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==",
6
6
  "_location": "/ms",
7
7
  "_phantomChildren": {},
8
8
  "_requested": {
@@ -18,10 +18,10 @@
18
18
  "_requiredBy": [
19
19
  "/debug"
20
20
  ],
21
- "_resolved": "https://registry.npmjs.org/ms/-/ms-2.1.1.tgz",
22
- "_shasum": "30a5864eb3ebb0a66f2ebe6d727af06a09d86e0a",
21
+ "_resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz",
22
+ "_shasum": "d09d1f357b443f493382a8eb3ccd183872ae6009",
23
23
  "_spec": "ms@^2.1.1",
24
- "_where": "/Users/pipobscure/fsevents/node_modules/debug",
24
+ "_where": "/Users/user/Developer/personal/fsevents/node_modules/debug",
25
25
  "bugs": {
26
26
  "url": "https://github.com/zeit/ms/issues"
27
27
  },
@@ -65,5 +65,5 @@
65
65
  "precommit": "lint-staged",
66
66
  "test": "mocha tests.js"
67
67
  },
68
- "version": "2.1.1"
68
+ "version": "2.1.2"
69
69
  }
@@ -1,7 +1,7 @@
1
1
  # ms
2
2
 
3
3
  [![Build Status](https://travis-ci.org/zeit/ms.svg?branch=master)](https://travis-ci.org/zeit/ms)
4
- [![Slack Channel](http://zeit-slackin.now.sh/badge.svg)](https://zeit.chat/)
4
+ [![Join the community on Spectrum](https://withspectrum.github.io/badge/badge.svg)](https://spectrum.chat/zeit)
5
5
 
6
6
  Use this package to easily convert various time formats to milliseconds.
7
7
 
@@ -0,0 +1,27 @@
1
+ name: Node CI
2
+ on: [push]
3
+
4
+ jobs:
5
+ build:
6
+ runs-on: ubuntu-latest
7
+
8
+ strategy:
9
+ matrix:
10
+ node-version: [0.10.0, 4.x, 6.x, 8.x, 10.x, 12.x]
11
+
12
+ steps:
13
+ - uses: actions/checkout@v1
14
+ - name: Use Node.js ${{ matrix.node-version }}
15
+ uses: actions/setup-node@v1
16
+ with:
17
+ node-version: ${{ matrix.node-version }}
18
+ - name: npm install, build, and test
19
+ run: |
20
+ npm install
21
+ mkdir -p test/keys
22
+ openssl genrsa -out test/keys/ssl.key 2048
23
+ openssl req -new -key test/keys/ssl.key -subj "/C=US/ST=Denial/L=Springfield/O=Dis/CN=www.example.com" -x509 -days 999 -out test/keys/ssl.cert
24
+ npm run build --if-present
25
+ npm test
26
+ env:
27
+ CI: true
@@ -51,7 +51,7 @@ With only two real dependencies, Needle supports:
51
51
  - Basic & Digest authentication with auto-detection
52
52
  - Multipart form-data (e.g. file uploads)
53
53
  - HTTP Proxy forwarding, optionally with authentication
54
- - Streaming gzip or deflate decompression
54
+ - Streaming gzip, deflate, and brotli decompression
55
55
  - Automatic XML & JSON parsing
56
56
  - 301/302/303 redirect following, with fine-grained tuning, and
57
57
  - Streaming non-UTF-8 charset decoding, via `iconv-lite`
@@ -91,7 +91,7 @@ needle.get('ifconfig.me/all.json', function(error, response, body) {
91
91
 
92
92
  // no callback, using streams
93
93
  var out = fs.createWriteStream('logo.png');
94
- needle.get('https://google.com/images/logo.png').pipe(out).on('finish', function() {
94
+ needle.get('https://google.com/images/logo.png').pipe(out).on('done', function() {
95
95
  console.log('Pipe finished!');
96
96
  });
97
97
  ```
@@ -105,7 +105,7 @@ Response pipeline
105
105
 
106
106
  Depending on the response's Content-Type, Needle will either attempt to parse JSON or XML streams, or, if a text response was received, will ensure that the final encoding you get is UTF-8.
107
107
 
108
- You can also request a gzip/deflated response, which, if sent by the server, will be processed before parsing or decoding is performed.
108
+ You can also request a gzip/deflated/brotli response, which, if sent by the server, will be processed before parsing or decoding is performed. (Note: brotli is only supported on Node 10.16.0 or above, and will not be requested or processed on earlier versions.)
109
109
 
110
110
  ```js
111
111
  needle.get('http://stackoverflow.com/feeds', { compressed: true }, function(err, resp) {
@@ -118,7 +118,7 @@ Or in anti-callback mode, using a few other options:
118
118
 
119
119
  ```js
120
120
  var options = {
121
- compressed : true, // sets 'Accept-Encoding' to 'gzip,deflate'
121
+ compressed : true, // sets 'Accept-Encoding' to 'gzip, deflate, br'
122
122
  follow_max : 5, // follow up to five redirects
123
123
  rejectUnauthorized : true // verify SSL certificate
124
124
  }
@@ -392,7 +392,7 @@ needle.get('foobar.com', { agent: myAgent });
392
392
  Regarding the 'Connection' header
393
393
  ---------------------------------
394
394
 
395
- Unless you're running an old version of Node (< 0.11.4), by default Needle won't set the Connection header on requests, yielding Node's default behaviour of keeping the connection alive with the target server. This speeds up inmensely the process of sending several requests to the same host.
395
+ Unless you're running an old version of Node (< 0.11.4), by default Needle won't set the Connection header on requests, yielding Node's default behaviour of keeping the connection alive with the target server. This speeds up immensely the process of sending several requests to the same host.
396
396
 
397
397
  On older versions, however, this has the unwanted behaviour of preventing the runtime from exiting, either because of a bug or 'feature' that was changed on 0.11.4. To overcome this Needle does set the 'Connection' header to 'close' on those versions, however this also means that making new requests to the same host doesn't benefit from Keep-Alive.
398
398