undici 7.7.0 → 7.8.0

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.
@@ -477,7 +477,7 @@ This method returns any pending interceptors registered on a mock agent. A pendi
477
477
 
478
478
  Returns: `PendingInterceptor[]` (where `PendingInterceptor` is a `MockDispatch` with an additional `origin: string`)
479
479
 
480
- #### Example - List all pending inteceptors
480
+ #### Example - List all pending interceptors
481
481
 
482
482
  ```js
483
483
  const agent = new MockAgent()
@@ -115,6 +115,11 @@ module.exports = class SqliteCacheStore {
115
115
  this.#db = new DatabaseSync(opts?.location ?? ':memory:')
116
116
 
117
117
  this.#db.exec(`
118
+ PRAGMA journal_mode = WAL;
119
+ PRAGMA synchronous = NORMAL;
120
+ PRAGMA temp_store = memory;
121
+ PRAGMA optimize;
122
+
118
123
  CREATE TABLE IF NOT EXISTS cacheInterceptorV${VERSION} (
119
124
  -- Data specific to us
120
125
  id INTEGER PRIMARY KEY AUTOINCREMENT,
@@ -134,9 +139,8 @@ module.exports = class SqliteCacheStore {
134
139
  staleAt INTEGER NOT NULL
135
140
  );
136
141
 
137
- CREATE INDEX IF NOT EXISTS idx_cacheInterceptorV${VERSION}_url ON cacheInterceptorV${VERSION}(url);
138
- CREATE INDEX IF NOT EXISTS idx_cacheInterceptorV${VERSION}_method ON cacheInterceptorV${VERSION}(method);
139
- CREATE INDEX IF NOT EXISTS idx_cacheInterceptorV${VERSION}_deleteAt ON cacheInterceptorV${VERSION}(deleteAt);
142
+ CREATE INDEX IF NOT EXISTS idx_cacheInterceptorV${VERSION}_getValuesQuery ON cacheInterceptorV${VERSION}(url, method, deleteAt);
143
+ CREATE INDEX IF NOT EXISTS idx_cacheInterceptorV${VERSION}_deleteByUrlQuery ON cacheInterceptorV${VERSION}(deleteAt);
140
144
  `)
141
145
 
142
146
  this.#getValuesQuery = this.#db.prepare(`
@@ -346,7 +350,7 @@ module.exports = class SqliteCacheStore {
346
350
  }
347
351
 
348
352
  #prune () {
349
- if (this.size <= this.#maxCount) {
353
+ if (Number.isFinite(this.#maxCount) && this.size <= this.#maxCount) {
350
354
  return 0
351
355
  }
352
356
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "undici",
3
- "version": "7.7.0",
3
+ "version": "7.8.0",
4
4
  "description": "An HTTP/1.1 client, written from scratch for Node.js",
5
5
  "homepage": "https://undici.nodejs.org",
6
6
  "bugs": {
@@ -116,7 +116,7 @@
116
116
  "c8": "^10.0.0",
117
117
  "cross-env": "^7.0.3",
118
118
  "dns-packet": "^5.4.0",
119
- "esbuild": "^0.24.0",
119
+ "esbuild": "^0.25.2",
120
120
  "eslint": "^9.9.0",
121
121
  "fast-check": "^3.17.1",
122
122
  "https-pem": "^3.0.0",
@@ -1,6 +1,7 @@
1
1
  /// <reference types="node" />
2
2
 
3
3
  import type { Blob } from 'buffer'
4
+ import type { ReadableStream, WritableStream } from 'stream/web'
4
5
  import type { MessagePort } from 'worker_threads'
5
6
  import {
6
7
  EventInit,