fsevents 1.2.3 → 1.2.10
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.
Potentially problematic release.
This version of fsevents might be problematic. Click here for more details.
- package/.travis.yml +2 -3
- package/fsevents.cc +14 -26
- package/node_modules/abbrev/package.json +13 -14
- package/node_modules/ansi-regex/package.json +13 -14
- package/node_modules/aproba/package.json +13 -14
- package/node_modules/are-we-there-yet/CHANGES.md +6 -0
- package/node_modules/are-we-there-yet/package.json +19 -20
- package/node_modules/are-we-there-yet/tracker-stream.js +1 -0
- package/node_modules/balanced-match/package.json +13 -14
- package/node_modules/brace-expansion/package.json +13 -14
- package/node_modules/chownr/chownr.js +113 -40
- package/node_modules/chownr/package.json +22 -20
- package/node_modules/code-point-at/package.json +13 -14
- package/node_modules/concat-map/package.json +8 -9
- package/node_modules/console-control-strings/package.json +14 -14
- package/node_modules/core-util-is/package.json +13 -14
- package/node_modules/debug/CHANGELOG.md +34 -1
- package/node_modules/debug/README.md +188 -63
- package/node_modules/debug/dist/debug.js +886 -0
- package/node_modules/debug/package.json +34 -33
- package/node_modules/debug/src/browser.js +77 -82
- package/node_modules/debug/src/common.js +249 -0
- package/node_modules/debug/src/index.js +5 -3
- package/node_modules/debug/src/node.js +72 -146
- package/node_modules/deep-extend/CHANGELOG.md +28 -3
- package/node_modules/deep-extend/LICENSE +1 -1
- package/node_modules/deep-extend/README.md +2 -1
- package/node_modules/deep-extend/lib/deep-extend.js +11 -5
- package/node_modules/deep-extend/package.json +26 -28
- package/node_modules/delegates/package.json +13 -14
- package/node_modules/detect-libc/package.json +13 -14
- package/node_modules/fs-minipass/index.js +2 -1
- package/node_modules/fs-minipass/package.json +24 -22
- package/node_modules/fs.realpath/package.json +13 -14
- package/node_modules/gauge/package.json +13 -14
- package/node_modules/glob/LICENSE +6 -0
- package/node_modules/glob/README.md +8 -1
- package/node_modules/glob/package.json +21 -19
- package/node_modules/has-unicode/package.json +13 -14
- package/node_modules/iconv-lite/Changelog.md +16 -0
- package/node_modules/iconv-lite/encodings/sbcs-codec.js +2 -2
- package/node_modules/iconv-lite/encodings/sbcs-data.js +5 -0
- package/node_modules/iconv-lite/lib/extend-node.js +1 -1
- package/node_modules/iconv-lite/lib/index.d.ts +2 -2
- package/node_modules/iconv-lite/package.json +19 -20
- package/node_modules/ignore-walk/README.md +1 -1
- package/node_modules/ignore-walk/index.js +9 -5
- package/node_modules/ignore-walk/package.json +22 -20
- package/node_modules/inflight/package.json +13 -14
- package/node_modules/inherits/inherits.js +2 -0
- package/node_modules/inherits/inherits_browser.js +18 -14
- package/node_modules/inherits/package.json +20 -20
- package/node_modules/ini/package.json +13 -14
- package/node_modules/is-fullwidth-code-point/package.json +13 -14
- package/node_modules/isarray/package.json +13 -14
- package/node_modules/minimatch/package.json +14 -14
- package/node_modules/minimist/package.json +8 -9
- package/node_modules/minipass/LICENSE +15 -0
- package/node_modules/minipass/README.md +567 -7
- package/node_modules/minipass/index.js +255 -22
- package/node_modules/minipass/package.json +26 -22
- package/node_modules/minizlib/README.md +36 -27
- package/node_modules/minizlib/constants.js +73 -4
- package/node_modules/minizlib/index.js +188 -232
- package/node_modules/minizlib/package.json +19 -20
- package/node_modules/mkdirp/package.json +14 -14
- package/node_modules/ms/index.js +29 -19
- package/node_modules/ms/package.json +22 -23
- package/node_modules/ms/readme.md +18 -9
- package/node_modules/needle/README.md +3 -3
- package/node_modules/needle/examples/multipart-stream.js +1 -1
- package/node_modules/needle/lib/auth.js +1 -1
- package/node_modules/needle/lib/cookies.js +12 -10
- package/node_modules/needle/lib/multipart.js +1 -1
- package/node_modules/needle/lib/needle.js +20 -6
- package/node_modules/needle/package.json +26 -27
- package/node_modules/needle/test/basic_auth_spec.js +1 -1
- package/node_modules/needle/test/cookies_spec.js +2 -2
- package/node_modules/needle/test/errors_spec.js +4 -4
- package/node_modules/needle/test/headers_spec.js +1 -1
- package/node_modules/needle/test/long_string_spec.js +1 -1
- package/node_modules/needle/test/output_spec.js +1 -1
- package/node_modules/needle/test/post_data_spec.js +20 -20
- package/node_modules/needle/test/proxy_spec.js +1 -1
- package/node_modules/needle/test/url_spec.js +11 -3
- package/node_modules/needle/test/utils/test.js +1 -1
- package/node_modules/node-pre-gyp/CHANGELOG.md +34 -3
- package/node_modules/node-pre-gyp/README.md +53 -21
- package/node_modules/node-pre-gyp/appveyor.yml +2 -9
- package/node_modules/node-pre-gyp/contributing.md +2 -2
- package/node_modules/node-pre-gyp/lib/build.js +1 -1
- package/node_modules/node-pre-gyp/lib/install.js +46 -12
- package/node_modules/node-pre-gyp/lib/node-pre-gyp.js +1 -1
- package/node_modules/node-pre-gyp/lib/package.js +5 -2
- package/node_modules/node-pre-gyp/lib/pre-binding.js +5 -5
- package/node_modules/node-pre-gyp/lib/rebuild.js +1 -1
- package/node_modules/node-pre-gyp/lib/reinstall.js +1 -1
- package/node_modules/node-pre-gyp/lib/util/abi_crosswalk.json +148 -0
- package/node_modules/node-pre-gyp/lib/util/handle_gyp_opts.js +5 -2
- package/node_modules/node-pre-gyp/lib/util/napi.js +70 -22
- package/node_modules/node-pre-gyp/lib/util/versioning.js +7 -6
- package/node_modules/node-pre-gyp/package.json +16 -20
- package/node_modules/nopt/package.json +13 -14
- package/node_modules/npm-bundled/LICENSE +15 -0
- package/node_modules/npm-bundled/README.md +2 -0
- package/node_modules/npm-bundled/index.js +29 -7
- package/node_modules/npm-bundled/package.json +21 -19
- package/node_modules/npm-normalize-package-bin/.github/settings.yml +2 -0
- package/node_modules/npm-normalize-package-bin/.npmignore +24 -0
- package/node_modules/npm-normalize-package-bin/LICENSE +15 -0
- package/node_modules/npm-normalize-package-bin/README.md +14 -0
- package/node_modules/npm-normalize-package-bin/index.js +60 -0
- package/node_modules/npm-normalize-package-bin/package-lock.json +3529 -0
- package/node_modules/npm-normalize-package-bin/package.json +57 -0
- package/node_modules/npm-normalize-package-bin/test/array.js +37 -0
- package/node_modules/npm-normalize-package-bin/test/nobin.js +35 -0
- package/node_modules/npm-normalize-package-bin/test/object.js +141 -0
- package/node_modules/npm-normalize-package-bin/test/string.js +37 -0
- package/node_modules/npm-packlist/index.js +90 -21
- package/node_modules/npm-packlist/package.json +27 -21
- package/node_modules/npmlog/package.json +13 -14
- package/node_modules/number-is-nan/package.json +13 -14
- package/node_modules/object-assign/package.json +13 -14
- package/node_modules/once/package.json +14 -14
- package/node_modules/os-homedir/package.json +13 -14
- package/node_modules/os-tmpdir/package.json +13 -14
- package/node_modules/osenv/package.json +13 -14
- package/node_modules/path-is-absolute/package.json +13 -14
- package/node_modules/process-nextick-args/index.js +2 -1
- package/node_modules/process-nextick-args/package.json +17 -18
- package/node_modules/rc/node_modules/minimist/package.json +13 -14
- package/node_modules/rc/package.json +18 -19
- package/node_modules/readable-stream/package.json +13 -14
- package/node_modules/rimraf/package.json +22 -20
- package/node_modules/rimraf/rimraf.js +9 -1
- package/node_modules/safe-buffer/index.d.ts +187 -0
- package/node_modules/safe-buffer/package.json +23 -21
- package/node_modules/safer-buffer/package.json +13 -14
- package/node_modules/sax/package.json +13 -14
- package/node_modules/semver/CHANGELOG.md +39 -0
- package/node_modules/semver/README.md +43 -19
- package/node_modules/semver/bin/semver +92 -75
- package/node_modules/semver/package.json +25 -20
- package/node_modules/semver/semver.js +922 -763
- package/node_modules/set-blocking/package.json +13 -14
- package/node_modules/signal-exit/package.json +13 -14
- package/node_modules/string-width/package.json +14 -14
- package/node_modules/string_decoder/package.json +13 -14
- package/node_modules/strip-ansi/package.json +14 -14
- package/node_modules/strip-json-comments/package.json +13 -14
- package/node_modules/tar/README.md +7 -2
- package/node_modules/tar/lib/header.js +20 -4
- package/node_modules/tar/lib/large-numbers.js +32 -27
- package/node_modules/tar/lib/mkdir.js +2 -2
- package/node_modules/tar/lib/mode-fix.js +14 -0
- package/node_modules/tar/lib/pack.js +1 -0
- package/node_modules/tar/lib/parse.js +7 -1
- package/node_modules/tar/lib/read-entry.js +4 -0
- package/node_modules/tar/lib/unpack.js +67 -6
- package/node_modules/tar/lib/write-entry.js +25 -6
- package/node_modules/tar/package.json +33 -30
- package/node_modules/util-deprecate/package.json +13 -14
- package/node_modules/wide-align/package.json +19 -20
- package/node_modules/wrappy/package.json +14 -14
- package/node_modules/yallist/iterator.js +5 -5
- package/node_modules/yallist/package.json +19 -19
- package/node_modules/yallist/yallist.js +52 -2
- package/package.json +6 -9
- package/src/async.cc +2 -2
- package/src/constants.cc +20 -20
- package/src/thread.cc +5 -6
- package/.npmignore +0 -1
- package/build/.target.mk +0 -53
- package/build/Makefile +0 -352
- package/build/Release/.deps/Release/.node.d +0 -1
- package/build/Release/.deps/Release/fse.node.d +0 -1
- package/build/Release/.deps/Release/obj.target/action_after_build.stamp.d +0 -1
- package/build/Release/.deps/Release/obj.target/fse/fsevents.o.d +0 -65
- package/build/Release/.deps/Users/eshanker/Code/fsevents/lib/binding/Release/node-v48-darwin-x64/fse.node.d +0 -1
- package/build/Release/.node +0 -0
- package/build/Release/fse.node +0 -0
- package/build/Release/obj.target/action_after_build.stamp +0 -0
- package/build/Release/obj.target/fse/fsevents.o +0 -0
- package/build/action_after_build.target.mk +0 -32
- package/build/binding.Makefile +0 -6
- package/build/fse.target.mk +0 -179
- package/build/gyp-mac-tool +0 -611
- package/build/stage/v1.1.2/fse-v1.1.2-node-v48-darwin-x64.tar.gz +0 -0
- package/lib/binding/Release/node-v11-darwin-x64/fse.node +0 -0
- package/lib/binding/Release/node-v46-darwin-x64/fse.node +0 -0
- package/lib/binding/Release/node-v47-darwin-x64/fse.node +0 -0
- package/lib/binding/Release/node-v48-darwin-x64/fse.node +0 -0
- package/lib/binding/Release/node-v57-darwin-x64/fse.node +0 -0
- package/node_modules/are-we-there-yet/CHANGES.md~ +0 -27
- package/node_modules/debug/.coveralls.yml +0 -1
- package/node_modules/debug/.eslintrc +0 -11
- package/node_modules/debug/.npmignore +0 -9
- package/node_modules/debug/.travis.yml +0 -14
- package/node_modules/debug/Makefile +0 -50
- package/node_modules/debug/component.json +0 -19
- package/node_modules/debug/karma.conf.js +0 -70
- package/node_modules/debug/src/debug.js +0 -202
- package/node_modules/debug/src/inspector-log.js +0 -15
- package/node_modules/iconv-lite/.travis.yml +0 -23
- package/node_modules/rc/.npmignore +0 -3
- package/node_modules/safe-buffer/.travis.yml +0 -7
- package/node_modules/safe-buffer/test.js +0 -101
- package/src/locking.cc +0 -27
@@ -2,16 +2,24 @@
|
|
2
2
|
|
3
3
|
const assert = require('assert')
|
4
4
|
const Buffer = require('buffer').Buffer
|
5
|
-
const
|
5
|
+
const realZlib = require('zlib')
|
6
6
|
|
7
7
|
const constants = exports.constants = require('./constants.js')
|
8
|
-
const
|
8
|
+
const Minipass = require('minipass')
|
9
|
+
|
10
|
+
const OriginalBufferConcat = Buffer.concat
|
9
11
|
|
10
12
|
class ZlibError extends Error {
|
11
|
-
constructor (
|
12
|
-
super('zlib: ' +
|
13
|
-
this.
|
14
|
-
this.
|
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)
|
15
23
|
}
|
16
24
|
|
17
25
|
get name () {
|
@@ -19,153 +27,51 @@ class ZlibError extends Error {
|
|
19
27
|
}
|
20
28
|
}
|
21
29
|
|
22
|
-
// translation table for return codes.
|
23
|
-
const codes = new Map([
|
24
|
-
[constants.Z_OK, 'Z_OK'],
|
25
|
-
[constants.Z_STREAM_END, 'Z_STREAM_END'],
|
26
|
-
[constants.Z_NEED_DICT, 'Z_NEED_DICT'],
|
27
|
-
[constants.Z_ERRNO, 'Z_ERRNO'],
|
28
|
-
[constants.Z_STREAM_ERROR, 'Z_STREAM_ERROR'],
|
29
|
-
[constants.Z_DATA_ERROR, 'Z_DATA_ERROR'],
|
30
|
-
[constants.Z_MEM_ERROR, 'Z_MEM_ERROR'],
|
31
|
-
[constants.Z_BUF_ERROR, 'Z_BUF_ERROR'],
|
32
|
-
[constants.Z_VERSION_ERROR, 'Z_VERSION_ERROR']
|
33
|
-
])
|
34
|
-
|
35
|
-
const validFlushFlags = new Set([
|
36
|
-
constants.Z_NO_FLUSH,
|
37
|
-
constants.Z_PARTIAL_FLUSH,
|
38
|
-
constants.Z_SYNC_FLUSH,
|
39
|
-
constants.Z_FULL_FLUSH,
|
40
|
-
constants.Z_FINISH,
|
41
|
-
constants.Z_BLOCK
|
42
|
-
])
|
43
|
-
|
44
|
-
const strategies = new Set([
|
45
|
-
constants.Z_FILTERED,
|
46
|
-
constants.Z_HUFFMAN_ONLY,
|
47
|
-
constants.Z_RLE,
|
48
|
-
constants.Z_FIXED,
|
49
|
-
constants.Z_DEFAULT_STRATEGY
|
50
|
-
])
|
51
|
-
|
52
30
|
// the Zlib class they all inherit from
|
53
31
|
// This thing manages the queue of requests, and returns
|
54
32
|
// true or false if there is anything in the queue when
|
55
33
|
// you call the .write() method.
|
56
34
|
const _opts = Symbol('opts')
|
57
|
-
const _chunkSize = Symbol('chunkSize')
|
58
35
|
const _flushFlag = Symbol('flushFlag')
|
59
|
-
const
|
36
|
+
const _finishFlushFlag = Symbol('finishFlushFlag')
|
37
|
+
const _fullFlushFlag = Symbol('fullFlushFlag')
|
60
38
|
const _handle = Symbol('handle')
|
61
|
-
const
|
62
|
-
const
|
63
|
-
const _offset = Symbol('offset')
|
39
|
+
const _onError = Symbol('onError')
|
40
|
+
const _sawError = Symbol('sawError')
|
64
41
|
const _level = Symbol('level')
|
65
42
|
const _strategy = Symbol('strategy')
|
66
43
|
const _ended = Symbol('ended')
|
67
|
-
const
|
44
|
+
const _defaultFullFlush = Symbol('_defaultFullFlush')
|
68
45
|
|
69
|
-
class
|
46
|
+
class ZlibBase extends Minipass {
|
70
47
|
constructor (opts, mode) {
|
48
|
+
if (!opts || typeof opts !== 'object')
|
49
|
+
throw new TypeError('invalid options for ZlibBase constructor')
|
50
|
+
|
71
51
|
super(opts)
|
72
52
|
this[_ended] = false
|
73
|
-
this[_opts] = opts
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
}
|
81
|
-
|
82
|
-
|
83
|
-
this[_finishFlush] = typeof opts.finishFlush !== 'undefined' ?
|
84
|
-
opts.finishFlush : constants.Z_FINISH
|
85
|
-
|
86
|
-
if (opts.chunkSize) {
|
87
|
-
if (opts.chunkSize < constants.Z_MIN_CHUNK) {
|
88
|
-
throw new RangeError('Invalid chunk size: ' + opts.chunkSize)
|
89
|
-
}
|
90
|
-
}
|
91
|
-
|
92
|
-
if (opts.windowBits) {
|
93
|
-
if (opts.windowBits < constants.Z_MIN_WINDOWBITS ||
|
94
|
-
opts.windowBits > constants.Z_MAX_WINDOWBITS) {
|
95
|
-
throw new RangeError('Invalid windowBits: ' + opts.windowBits)
|
96
|
-
}
|
53
|
+
this[_opts] = opts
|
54
|
+
|
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)
|
97
63
|
}
|
98
64
|
|
99
|
-
|
100
|
-
|
101
|
-
opts.level > constants.Z_MAX_LEVEL) {
|
102
|
-
throw new RangeError('Invalid compression level: ' + opts.level)
|
103
|
-
}
|
104
|
-
}
|
105
|
-
|
106
|
-
if (opts.memLevel) {
|
107
|
-
if (opts.memLevel < constants.Z_MIN_MEMLEVEL ||
|
108
|
-
opts.memLevel > constants.Z_MAX_MEMLEVEL) {
|
109
|
-
throw new RangeError('Invalid memLevel: ' + opts.memLevel)
|
110
|
-
}
|
111
|
-
}
|
112
|
-
|
113
|
-
if (opts.strategy && !(strategies.has(opts.strategy)))
|
114
|
-
throw new TypeError('Invalid strategy: ' + opts.strategy)
|
115
|
-
|
116
|
-
if (opts.dictionary) {
|
117
|
-
if (!(opts.dictionary instanceof Buffer)) {
|
118
|
-
throw new TypeError('Invalid dictionary: it should be a Buffer instance')
|
119
|
-
}
|
120
|
-
}
|
121
|
-
|
122
|
-
this[_handle] = new binding.Zlib(mode)
|
123
|
-
|
124
|
-
this[_hadError] = false
|
125
|
-
this[_handle].onerror = (message, errno) => {
|
65
|
+
this[_onError] = (err) => {
|
66
|
+
this[_sawError] = true
|
126
67
|
// there is no way to cleanly recover.
|
127
68
|
// continuing only obscures problems.
|
128
69
|
this.close()
|
129
|
-
this
|
130
|
-
|
131
|
-
const error = new ZlibError(message, errno)
|
132
|
-
this.emit('error', error)
|
133
|
-
}
|
134
|
-
|
135
|
-
const level = typeof opts.level === 'number' ? opts.level
|
136
|
-
: constants.Z_DEFAULT_COMPRESSION
|
137
|
-
|
138
|
-
var strategy = typeof opts.strategy === 'number' ? opts.strategy
|
139
|
-
: constants.Z_DEFAULT_STRATEGY
|
140
|
-
|
141
|
-
this[_writeState] = new Uint32Array(2);
|
142
|
-
const window = opts.windowBits || constants.Z_DEFAULT_WINDOWBITS
|
143
|
-
const memLevel = opts.memLevel || constants.Z_DEFAULT_MEMLEVEL
|
144
|
-
|
145
|
-
// API changed in node v9
|
146
|
-
/* istanbul ignore next */
|
147
|
-
if (/^v[0-8]\./.test(process.version)) {
|
148
|
-
this[_handle].init(window,
|
149
|
-
level,
|
150
|
-
memLevel,
|
151
|
-
strategy,
|
152
|
-
opts.dictionary)
|
153
|
-
} else {
|
154
|
-
this[_handle].init(window,
|
155
|
-
level,
|
156
|
-
memLevel,
|
157
|
-
strategy,
|
158
|
-
this[_writeState],
|
159
|
-
() => {},
|
160
|
-
opts.dictionary)
|
70
|
+
this.emit('error', err)
|
161
71
|
}
|
162
72
|
|
163
|
-
this[
|
164
|
-
this
|
165
|
-
this[_level] = level
|
166
|
-
this[_strategy] = strategy
|
167
|
-
|
168
|
-
this.once('end', this.close)
|
73
|
+
this[_handle].on('error', er => this[_onError](new ZlibError(er)))
|
74
|
+
this.once('end', () => this.close)
|
169
75
|
}
|
170
76
|
|
171
77
|
close () {
|
@@ -176,57 +82,26 @@ class Zlib extends MiniPass {
|
|
176
82
|
}
|
177
83
|
}
|
178
84
|
|
179
|
-
|
180
|
-
if (!this[
|
181
|
-
throw new Error('cannot switch params when binding is closed')
|
182
|
-
|
183
|
-
// no way to test this without also not supporting params at all
|
184
|
-
/* istanbul ignore if */
|
185
|
-
if (!this[_handle].params)
|
186
|
-
throw new Error('not supported in this implementation')
|
187
|
-
|
188
|
-
if (level < constants.Z_MIN_LEVEL ||
|
189
|
-
level > constants.Z_MAX_LEVEL) {
|
190
|
-
throw new RangeError('Invalid compression level: ' + level)
|
191
|
-
}
|
192
|
-
|
193
|
-
if (!(strategies.has(strategy)))
|
194
|
-
throw new TypeError('Invalid strategy: ' + strategy)
|
195
|
-
|
196
|
-
if (this[_level] !== level || this[_strategy] !== strategy) {
|
197
|
-
this.flush(constants.Z_SYNC_FLUSH)
|
85
|
+
reset () {
|
86
|
+
if (!this[_sawError]) {
|
198
87
|
assert(this[_handle], 'zlib binding closed')
|
199
|
-
this[_handle].
|
200
|
-
/* istanbul ignore else */
|
201
|
-
if (!this[_hadError]) {
|
202
|
-
this[_level] = level
|
203
|
-
this[_strategy] = strategy
|
204
|
-
}
|
88
|
+
return this[_handle].reset()
|
205
89
|
}
|
206
90
|
}
|
207
91
|
|
208
|
-
|
209
|
-
assert(this[_handle], 'zlib binding closed')
|
210
|
-
return this[_handle].reset()
|
211
|
-
}
|
212
|
-
|
213
|
-
flush (kind) {
|
214
|
-
if (kind === undefined)
|
215
|
-
kind = constants.Z_FULL_FLUSH
|
216
|
-
|
92
|
+
flush (flushFlag) {
|
217
93
|
if (this.ended)
|
218
94
|
return
|
219
95
|
|
220
|
-
|
221
|
-
|
222
|
-
this.write(Buffer.alloc(0))
|
223
|
-
this[_flushFlag] = flushFlag
|
96
|
+
if (typeof flushFlag !== 'number')
|
97
|
+
flushFlag = this[_fullFlushFlag]
|
98
|
+
this.write(Object.assign(Buffer.alloc(0), { [_flushFlag]: flushFlag }))
|
224
99
|
}
|
225
100
|
|
226
101
|
end (chunk, encoding, cb) {
|
227
102
|
if (chunk)
|
228
103
|
this.write(chunk, encoding)
|
229
|
-
this.flush(this[
|
104
|
+
this.flush(this[_finishFlushFlag])
|
230
105
|
this[_ended] = true
|
231
106
|
return super.end(null, null, cb)
|
232
107
|
}
|
@@ -242,66 +117,61 @@ class Zlib extends MiniPass {
|
|
242
117
|
cb = encoding, encoding = 'utf8'
|
243
118
|
|
244
119
|
if (typeof chunk === 'string')
|
245
|
-
chunk =
|
246
|
-
|
247
|
-
let availInBefore = chunk && chunk.length
|
248
|
-
let availOutBefore = this[_chunkSize] - this[_offset]
|
249
|
-
let inOff = 0 // the offset of the input buffer
|
250
|
-
const flushFlag = this[_flushFlag]
|
251
|
-
let writeReturn = true
|
120
|
+
chunk = Buffer.from(chunk, encoding)
|
252
121
|
|
122
|
+
if (this[_sawError])
|
123
|
+
return
|
253
124
|
assert(this[_handle], 'zlib binding closed')
|
254
|
-
do {
|
255
|
-
let res = this[_handle].writeSync(
|
256
|
-
flushFlag,
|
257
|
-
chunk, // in
|
258
|
-
inOff, // in_off
|
259
|
-
availInBefore, // in_len
|
260
|
-
this[_buffer], // out
|
261
|
-
this[_offset], //out_off
|
262
|
-
availOutBefore // out_len
|
263
|
-
)
|
264
|
-
|
265
|
-
if (this[_hadError])
|
266
|
-
break
|
267
|
-
|
268
|
-
// API changed in v9
|
269
|
-
/* istanbul ignore next */
|
270
|
-
let availInAfter = res ? res[0] : this[_writeState][1]
|
271
|
-
/* istanbul ignore next */
|
272
|
-
let availOutAfter = res ? res[1] : this[_writeState][0]
|
273
|
-
|
274
|
-
const have = availOutBefore - availOutAfter
|
275
|
-
assert(have >= 0, 'have should not go down')
|
276
|
-
|
277
|
-
if (have > 0) {
|
278
|
-
const out = this[_buffer].slice(
|
279
|
-
this[_offset], this[_offset] + have
|
280
|
-
)
|
281
|
-
|
282
|
-
this[_offset] += have
|
283
|
-
// serve some output to the consumer.
|
284
|
-
writeReturn = super.write(out) && writeReturn
|
285
|
-
}
|
286
125
|
|
287
|
-
|
288
|
-
|
289
|
-
|
290
|
-
|
291
|
-
|
126
|
+
// _processChunk tries to .close() the native handle after it's done, so we
|
127
|
+
// intercept that by temporarily making it a no-op.
|
128
|
+
const nativeHandle = this[_handle]._handle
|
129
|
+
const originalNativeClose = nativeHandle.close
|
130
|
+
nativeHandle.close = () => {}
|
131
|
+
const originalClose = this[_handle].close
|
132
|
+
this[_handle].close = () => {}
|
133
|
+
// It also calls `Buffer.concat()` at the end, which may be convenient
|
134
|
+
// for some, but which we are not interested in as it slows us down.
|
135
|
+
Buffer.concat = (args) => args
|
136
|
+
let result
|
137
|
+
try {
|
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
|
143
|
+
} catch (err) {
|
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()
|
146
|
+
Buffer.concat = OriginalBufferConcat
|
147
|
+
this[_onError](new ZlibError(err))
|
148
|
+
} finally {
|
149
|
+
if (this[_handle]) {
|
150
|
+
// Core zlib resets `_handle` to null after attempting to close the
|
151
|
+
// native handle. Our no-op handler prevented actual closure, but we
|
152
|
+
// need to restore the `._handle` property.
|
153
|
+
this[_handle]._handle = nativeHandle
|
154
|
+
nativeHandle.close = originalNativeClose
|
155
|
+
this[_handle].close = originalClose
|
156
|
+
// `_processChunk()` adds an 'error' listener. If we don't remove it
|
157
|
+
// after each call, these handlers start piling up.
|
158
|
+
this[_handle].removeAllListeners('error')
|
292
159
|
}
|
160
|
+
}
|
293
161
|
|
294
|
-
|
295
|
-
|
296
|
-
|
297
|
-
//
|
298
|
-
//
|
299
|
-
|
300
|
-
|
301
|
-
|
162
|
+
let writeReturn
|
163
|
+
if (result) {
|
164
|
+
if (Array.isArray(result) && result.length > 0) {
|
165
|
+
// The first buffer is always `handle._outBuffer`, which would be
|
166
|
+
// re-used for later invocations; so, we always have to copy that one.
|
167
|
+
writeReturn = super.write(Buffer.from(result[0]))
|
168
|
+
for (let i = 1; i < result.length; i++) {
|
169
|
+
writeReturn = super.write(result[i])
|
170
|
+
}
|
171
|
+
} else {
|
172
|
+
writeReturn = super.write(Buffer.from(result))
|
302
173
|
}
|
303
|
-
|
304
|
-
} while (!this[_hadError])
|
174
|
+
}
|
305
175
|
|
306
176
|
if (cb)
|
307
177
|
cb()
|
@@ -309,49 +179,124 @@ class Zlib extends MiniPass {
|
|
309
179
|
}
|
310
180
|
}
|
311
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
|
+
|
312
232
|
// minimal 2-byte header
|
313
233
|
class Deflate extends Zlib {
|
314
234
|
constructor (opts) {
|
315
|
-
super(opts,
|
235
|
+
super(opts, 'Deflate')
|
316
236
|
}
|
317
237
|
}
|
318
238
|
|
319
239
|
class Inflate extends Zlib {
|
320
240
|
constructor (opts) {
|
321
|
-
super(opts,
|
241
|
+
super(opts, 'Inflate')
|
322
242
|
}
|
323
243
|
}
|
324
244
|
|
325
245
|
// gzip - bigger header, same deflate compression
|
326
246
|
class Gzip extends Zlib {
|
327
247
|
constructor (opts) {
|
328
|
-
super(opts,
|
248
|
+
super(opts, 'Gzip')
|
329
249
|
}
|
330
250
|
}
|
331
251
|
|
332
252
|
class Gunzip extends Zlib {
|
333
253
|
constructor (opts) {
|
334
|
-
super(opts,
|
254
|
+
super(opts, 'Gunzip')
|
335
255
|
}
|
336
256
|
}
|
337
257
|
|
338
258
|
// raw - no header
|
339
259
|
class DeflateRaw extends Zlib {
|
340
260
|
constructor (opts) {
|
341
|
-
super(opts,
|
261
|
+
super(opts, 'DeflateRaw')
|
342
262
|
}
|
343
263
|
}
|
344
264
|
|
345
265
|
class InflateRaw extends Zlib {
|
346
266
|
constructor (opts) {
|
347
|
-
super(opts,
|
267
|
+
super(opts, 'InflateRaw')
|
348
268
|
}
|
349
269
|
}
|
350
270
|
|
351
271
|
// auto-detect header.
|
352
272
|
class Unzip extends Zlib {
|
353
273
|
constructor (opts) {
|
354
|
-
super(opts,
|
274
|
+
super(opts, 'Unzip')
|
275
|
+
}
|
276
|
+
}
|
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')
|
355
300
|
}
|
356
301
|
}
|
357
302
|
|
@@ -362,3 +307,14 @@ exports.Gunzip = Gunzip
|
|
362
307
|
exports.DeflateRaw = DeflateRaw
|
363
308
|
exports.InflateRaw = InflateRaw
|
364
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,30 +1,27 @@
|
|
1
1
|
{
|
2
|
-
"
|
3
|
-
|
4
|
-
"minizlib@1.1.0",
|
5
|
-
"/Users/eshanker/Code/fsevents"
|
6
|
-
]
|
7
|
-
],
|
8
|
-
"_from": "minizlib@1.1.0",
|
9
|
-
"_id": "minizlib@1.1.0",
|
2
|
+
"_from": "minizlib@^1.2.1",
|
3
|
+
"_id": "minizlib@1.3.3",
|
10
4
|
"_inBundle": false,
|
11
|
-
"_integrity": "sha512-
|
5
|
+
"_integrity": "sha512-6ZYMOEnmVsdCeTJVE0W9ZD+pVnE8h9Hma/iOwwRDsdQoePpoX56/8B6z3P9VNwppJuBKNRuFDRNRqRWexT9G9Q==",
|
12
6
|
"_location": "/minizlib",
|
13
7
|
"_phantomChildren": {},
|
14
8
|
"_requested": {
|
15
|
-
"type": "
|
9
|
+
"type": "range",
|
16
10
|
"registry": true,
|
17
|
-
"raw": "minizlib
|
11
|
+
"raw": "minizlib@^1.2.1",
|
18
12
|
"name": "minizlib",
|
19
13
|
"escapedName": "minizlib",
|
20
|
-
"rawSpec": "1.1
|
14
|
+
"rawSpec": "^1.2.1",
|
21
15
|
"saveSpec": null,
|
22
|
-
"fetchSpec": "1.1
|
16
|
+
"fetchSpec": "^1.2.1"
|
23
17
|
},
|
24
|
-
"_requiredBy": [
|
25
|
-
|
26
|
-
|
27
|
-
"
|
18
|
+
"_requiredBy": [
|
19
|
+
"/tar"
|
20
|
+
],
|
21
|
+
"_resolved": "https://registry.npmjs.org/minizlib/-/minizlib-1.3.3.tgz",
|
22
|
+
"_shasum": "2290de96818a34c29551c8a8d301216bd65a861d",
|
23
|
+
"_spec": "minizlib@^1.2.1",
|
24
|
+
"_where": "/Users/pipobscure/fsevents/node_modules/tar",
|
28
25
|
"author": {
|
29
26
|
"name": "Isaac Z. Schlueter",
|
30
27
|
"email": "i@izs.me",
|
@@ -33,12 +30,14 @@
|
|
33
30
|
"bugs": {
|
34
31
|
"url": "https://github.com/isaacs/minizlib/issues"
|
35
32
|
},
|
33
|
+
"bundleDependencies": false,
|
36
34
|
"dependencies": {
|
37
|
-
"minipass": "^2.
|
35
|
+
"minipass": "^2.9.0"
|
38
36
|
},
|
37
|
+
"deprecated": false,
|
39
38
|
"description": "A small fast zlib stream built on [minipass](http://npm.im/minipass) and Node.js's zlib binding.",
|
40
39
|
"devDependencies": {
|
41
|
-
"tap": "^
|
40
|
+
"tap": "^12.0.1"
|
42
41
|
},
|
43
42
|
"files": [
|
44
43
|
"index.js",
|
@@ -68,5 +67,5 @@
|
|
68
67
|
"preversion": "npm test",
|
69
68
|
"test": "tap test/*.js --100 -J"
|
70
69
|
},
|
71
|
-
"version": "1.
|
70
|
+
"version": "1.3.3"
|
72
71
|
}
|
@@ -1,30 +1,28 @@
|
|
1
1
|
{
|
2
|
-
"
|
3
|
-
[
|
4
|
-
"mkdirp@0.5.1",
|
5
|
-
"/Users/eshanker/Code/fsevents"
|
6
|
-
]
|
7
|
-
],
|
8
|
-
"_from": "mkdirp@0.5.1",
|
2
|
+
"_from": "mkdirp@^0.5.1",
|
9
3
|
"_id": "mkdirp@0.5.1",
|
10
4
|
"_inBundle": false,
|
11
5
|
"_integrity": "sha1-MAV0OOrGz3+MR2fzhkjWaX11yQM=",
|
12
6
|
"_location": "/mkdirp",
|
13
7
|
"_phantomChildren": {},
|
14
8
|
"_requested": {
|
15
|
-
"type": "
|
9
|
+
"type": "range",
|
16
10
|
"registry": true,
|
17
|
-
"raw": "mkdirp
|
11
|
+
"raw": "mkdirp@^0.5.1",
|
18
12
|
"name": "mkdirp",
|
19
13
|
"escapedName": "mkdirp",
|
20
|
-
"rawSpec": "0.5.1",
|
14
|
+
"rawSpec": "^0.5.1",
|
21
15
|
"saveSpec": null,
|
22
|
-
"fetchSpec": "0.5.1"
|
16
|
+
"fetchSpec": "^0.5.1"
|
23
17
|
},
|
24
|
-
"_requiredBy": [
|
18
|
+
"_requiredBy": [
|
19
|
+
"/node-pre-gyp",
|
20
|
+
"/tar"
|
21
|
+
],
|
25
22
|
"_resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-0.5.1.tgz",
|
26
|
-
"
|
27
|
-
"
|
23
|
+
"_shasum": "30057438eac6cf7f8c4767f38648d6697d75c903",
|
24
|
+
"_spec": "mkdirp@^0.5.1",
|
25
|
+
"_where": "/Users/pipobscure/fsevents/node_modules/node-pre-gyp",
|
28
26
|
"author": {
|
29
27
|
"name": "James Halliday",
|
30
28
|
"email": "mail@substack.net",
|
@@ -36,9 +34,11 @@
|
|
36
34
|
"bugs": {
|
37
35
|
"url": "https://github.com/substack/node-mkdirp/issues"
|
38
36
|
},
|
37
|
+
"bundleDependencies": false,
|
39
38
|
"dependencies": {
|
40
39
|
"minimist": "0.0.8"
|
41
40
|
},
|
41
|
+
"deprecated": false,
|
42
42
|
"description": "Recursively mkdir, like `mkdir -p`",
|
43
43
|
"devDependencies": {
|
44
44
|
"mock-fs": "2 >=2.7.0",
|