@nxtedition/nxt-undici 1.0.11 → 1.0.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.
- package/lib/index.js +16 -11
- package/package.json +1 -1
package/lib/index.js
CHANGED
|
@@ -102,18 +102,23 @@ class Readable extends stream.Readable {
|
|
|
102
102
|
return Buffer.concat(buffers)
|
|
103
103
|
}
|
|
104
104
|
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
105
|
+
dump() {
|
|
106
|
+
return new Promise((resolve) => {
|
|
107
|
+
if (this.closed) {
|
|
108
|
+
resolve(null)
|
|
109
|
+
} else {
|
|
110
|
+
let n = 0
|
|
111
|
+
this.on('close', () => resolve(null))
|
|
112
|
+
.on('error', () => {})
|
|
113
|
+
.on('data', (chunk) => {
|
|
114
|
+
n += chunk.length
|
|
115
|
+
if (n > 128 * 1024) {
|
|
116
|
+
this.destroy()
|
|
117
|
+
}
|
|
118
|
+
})
|
|
119
|
+
.resume()
|
|
113
120
|
}
|
|
114
|
-
}
|
|
115
|
-
// Do nothing...
|
|
116
|
-
}
|
|
121
|
+
})
|
|
117
122
|
}
|
|
118
123
|
}
|
|
119
124
|
|