@nxtedition/lib 20.4.1 → 20.4.3

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/app.js CHANGED
@@ -36,6 +36,7 @@ export function makeApp(appConfig, onTerminate) {
36
36
  let logger
37
37
  let trace
38
38
 
39
+ /** @type {Array<rxjs.Subscription|Function|AsyncFunction|Disposable|AsyncDisposable>} */
39
40
  const destroyers = []
40
41
 
41
42
  if (net.setDefaultAutoSelectFamily) {
package/http.js CHANGED
@@ -165,7 +165,7 @@ export class ServerResponse extends http.ServerResponse {
165
165
  connect: -1,
166
166
  headers: -1,
167
167
  data: -1,
168
- complete: -1,
168
+ end: -1,
169
169
  }
170
170
 
171
171
  get timing() {
@@ -216,7 +216,8 @@ export class ServerResponse extends http.ServerResponse {
216
216
  this.#timing.headers = this.#timing.data
217
217
  }
218
218
 
219
- this.#timing.complete = performance.now() - this.#created
219
+ this.#timing.end = performance.now() - this.#now
220
+ this.#now += this.#timing.end
220
221
  }
221
222
 
222
223
  return super.end(chunk, encoding, callback)
@@ -224,8 +225,9 @@ export class ServerResponse extends http.ServerResponse {
224
225
 
225
226
  destroy(err) {
226
227
  if (!this.destroyed) {
227
- if (this.#timing.complete === -1) {
228
- this.#timing.complete = performance.now() - this.#created
228
+ if (this.#timing.end === -1) {
229
+ this.#timing.end = performance.now() - this.#now
230
+ this.#now += this.#timing.end
229
231
  }
230
232
  }
231
233
 
@@ -240,7 +242,7 @@ export class Http2ServerResponse extends http2.Http2ServerResponse {
240
242
  connect: -1,
241
243
  headers: -1,
242
244
  data: -1,
243
- complete: -1,
245
+ end: -1,
244
246
  }
245
247
 
246
248
  get timing() {
@@ -291,7 +293,8 @@ export class Http2ServerResponse extends http2.Http2ServerResponse {
291
293
  this.#timing.headers = this.#timing.data
292
294
  }
293
295
 
294
- this.#timing.complete = performance.now() - this.#created
296
+ this.#timing.end = performance.now() - this.#now
297
+ this.#now += this.#timing.end
295
298
  }
296
299
 
297
300
  return super.end(chunk, encoding, callback)
@@ -299,8 +302,9 @@ export class Http2ServerResponse extends http2.Http2ServerResponse {
299
302
 
300
303
  destroy(err) {
301
304
  if (!this.destroyed) {
302
- if (this.#timing.complete === -1) {
303
- this.#timing.complete = performance.now() - this.#created
305
+ if (this.#timing.end === -1) {
306
+ this.#timing.end = performance.now() - this.#now
307
+ this.#now += this.#timing.end
304
308
  }
305
309
  }
306
310
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nxtedition/lib",
3
- "version": "20.4.1",
3
+ "version": "20.4.3",
4
4
  "license": "MIT",
5
5
  "author": "Robert Nagy <robert.nagy@boffins.se>",
6
6
  "type": "module",
package/serializers.js CHANGED
@@ -30,8 +30,7 @@ function getTiming(obj) {
30
30
  connect: timing.connect ?? -1,
31
31
  headers: timing.headers ?? -1,
32
32
  data: timing.data ?? -1,
33
- complete: timing.complete ?? -1,
34
- error: timing.error ?? -1,
33
+ end: timing.end ?? timing.complete ?? timing.error ?? -1,
35
34
  }
36
35
  }
37
36