@nxtedition/lib 19.8.0 → 19.8.1
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/couch.js +13 -3
- package/package.json +1 -1
package/couch.js
CHANGED
|
@@ -1139,7 +1139,9 @@ class PromiseOutput {
|
|
|
1139
1139
|
#stats = {
|
|
1140
1140
|
connect: -1,
|
|
1141
1141
|
headers: -1,
|
|
1142
|
-
|
|
1142
|
+
data: -1,
|
|
1143
|
+
complete: -1,
|
|
1144
|
+
error: -1,
|
|
1143
1145
|
}
|
|
1144
1146
|
|
|
1145
1147
|
constructor({ resolve, reject }) {
|
|
@@ -1165,14 +1167,18 @@ class PromiseOutput {
|
|
|
1165
1167
|
}
|
|
1166
1168
|
|
|
1167
1169
|
onData(data) {
|
|
1168
|
-
if (this.#stats.
|
|
1169
|
-
this.#stats.
|
|
1170
|
+
if (this.#stats.data === -1) {
|
|
1171
|
+
this.#stats.data = performance.now() - this.#startTime - this.#stats.headers
|
|
1170
1172
|
}
|
|
1171
1173
|
|
|
1172
1174
|
this.#str += this.#decoder.decode(data, { stream: true })
|
|
1173
1175
|
}
|
|
1174
1176
|
|
|
1175
1177
|
onComplete() {
|
|
1178
|
+
if (this.#stats.complete === -1) {
|
|
1179
|
+
this.#stats.complete = performance.now() - this.#startTime - this.#stats.data
|
|
1180
|
+
}
|
|
1181
|
+
|
|
1176
1182
|
this.#str += this.#decoder.decode(undefined, { stream: false })
|
|
1177
1183
|
|
|
1178
1184
|
this.#resolve(
|
|
@@ -1181,6 +1187,10 @@ class PromiseOutput {
|
|
|
1181
1187
|
}
|
|
1182
1188
|
|
|
1183
1189
|
onError(err) {
|
|
1190
|
+
if (this.#stats.error === -1) {
|
|
1191
|
+
this.#stats.error = performance.now() - this.#startTime - this.#stats.data
|
|
1192
|
+
}
|
|
1193
|
+
|
|
1184
1194
|
this.#reject(err)
|
|
1185
1195
|
}
|
|
1186
1196
|
}
|