@nxtedition/lib 19.6.2 → 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 +16 -0
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.2",
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
@@ -101,6 +101,22 @@ export class Sequence {
101
101
  }
102
102
  }
103
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
118
+ }
119
+
104
120
  toString() {
105
121
  if (!this.#value) {
106
122
  let count = 0