@nxtedition/lib 19.6.1 → 19.6.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.
Files changed (3) hide show
  1. package/http.js +1 -0
  2. package/package.json +1 -1
  3. package/sequence.js +20 -2
package/http.js CHANGED
@@ -80,6 +80,7 @@ export async function request(ctx, next) {
80
80
  // TODO (fix): Use 'end' once we can trust that
81
81
  // 'end' or 'error' will always be emitted.
82
82
  .on('close', function () {
83
+ this.log.debug('request closed')
83
84
  resolve(null)
84
85
  ac.abort()
85
86
  })
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nxtedition/lib",
3
- "version": "19.6.1",
3
+ "version": "19.6.3",
4
4
  "license": "MIT",
5
5
  "author": "Robert Nagy <robert.nagy@boffins.se>",
6
6
  "type": "module",
package/sequence.js CHANGED
@@ -95,8 +95,26 @@ export class Sequence {
95
95
  set(index, sequence) {
96
96
  assert(Number.isFinite(index) && index >= 0 && index < this.#parts.length)
97
97
  assert(Number.isFinite(sequence) && sequence >= 0)
98
- this.#parts[index * 2 + 1] = sequence
99
- this.#value = undefined
98
+ if (this.#parts[index * 2 + 1] !== sequence) {
99
+ this.#parts[index * 2 + 1] = sequence
100
+ this.#value = undefined
101
+ }
102
+ }
103
+
104
+ compare(other) {
105
+ assert(other instanceof Sequence)
106
+
107
+ if (this.#parts.length !== other.#parts.length) {
108
+ return this.#parts.length - other.#parts.length
109
+ }
110
+
111
+ for (let n = 0; n < this.#parts.length; n++) {
112
+ if (this.#parts[n] !== other.#parts[n]) {
113
+ return this.#parts[n] < other.#parts[n] ? -1 : 1
114
+ }
115
+ }
116
+
117
+ return 0
100
118
  }
101
119
 
102
120
  toString() {