@nxtedition/nxt-undici 6.4.2 → 6.4.4
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/lib/request.js +18 -3
- package/lib/sqlite-cache-store.js +2 -2
- package/package.json +9 -9
package/lib/request.js
CHANGED
|
@@ -7,6 +7,10 @@ function noop() {}
|
|
|
7
7
|
|
|
8
8
|
export class RequestHandler {
|
|
9
9
|
constructor({ signal, method, body, highWaterMark }, resolve) {
|
|
10
|
+
if (isStream(body) && body.closed) {
|
|
11
|
+
body = null
|
|
12
|
+
}
|
|
13
|
+
|
|
10
14
|
try {
|
|
11
15
|
if (typeof resolve !== 'function') {
|
|
12
16
|
throw new InvalidArgumentError('invalid resolve')
|
|
@@ -179,7 +183,18 @@ export function request(dispatch, url, opts) {
|
|
|
179
183
|
path = url.search ? `${url.pathname}${url.search}` : url.pathname
|
|
180
184
|
}
|
|
181
185
|
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
186
|
+
return new Promise((resolve) =>
|
|
187
|
+
dispatch(
|
|
188
|
+
opts,
|
|
189
|
+
new RequestHandler(
|
|
190
|
+
{
|
|
191
|
+
...opts,
|
|
192
|
+
origin,
|
|
193
|
+
path,
|
|
194
|
+
body: isStream(opts.body) && opts.body.readableEnded ? null : opts.body,
|
|
195
|
+
},
|
|
196
|
+
resolve,
|
|
197
|
+
),
|
|
198
|
+
),
|
|
199
|
+
)
|
|
185
200
|
}
|
|
@@ -51,10 +51,10 @@ export class SqliteCacheStore {
|
|
|
51
51
|
#deleteExpiredValuesTime = getFastNow()
|
|
52
52
|
|
|
53
53
|
/**
|
|
54
|
-
* @param {import('undici-types/cache-interceptor.d.ts').default.SqliteCacheStoreOpts & { maxEntryCount?: number} | undefined} opts
|
|
54
|
+
* @param {import('undici-types/cache-interceptor.d.ts').default.SqliteCacheStoreOpts & { maxEntryCount?: number } | undefined} opts
|
|
55
55
|
*/
|
|
56
56
|
constructor(opts) {
|
|
57
|
-
this.#db = new DatabaseSync(opts?.location ?? ':memory:')
|
|
57
|
+
this.#db = new DatabaseSync(opts?.location ?? ':memory:', { timeout: 100, ...opts?.db })
|
|
58
58
|
|
|
59
59
|
this.#db.exec(`
|
|
60
60
|
PRAGMA journal_mode = WAL;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nxtedition/nxt-undici",
|
|
3
|
-
"version": "6.4.
|
|
3
|
+
"version": "6.4.4",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"author": "Robert Nagy <robert.nagy@boffins.se>",
|
|
6
6
|
"main": "lib/index.js",
|
|
@@ -9,23 +9,23 @@
|
|
|
9
9
|
"lib/*"
|
|
10
10
|
],
|
|
11
11
|
"dependencies": {
|
|
12
|
-
"@nxtedition/undici": "^11.0.
|
|
12
|
+
"@nxtedition/undici": "^11.0.2",
|
|
13
13
|
"cache-control-parser": "^2.0.6",
|
|
14
14
|
"fast-querystring": "^1.1.2",
|
|
15
15
|
"http-errors": "^2.0.0",
|
|
16
16
|
"xxhash-wasm": "^1.1.0"
|
|
17
17
|
},
|
|
18
18
|
"devDependencies": {
|
|
19
|
-
"@types/node": "^
|
|
20
|
-
"eslint": "^9.
|
|
21
|
-
"eslint-plugin-n": "^17.
|
|
19
|
+
"@types/node": "^24.3.1",
|
|
20
|
+
"eslint": "^9.35.0",
|
|
21
|
+
"eslint-plugin-n": "^17.21.3",
|
|
22
22
|
"husky": "^9.1.7",
|
|
23
|
-
"lint-staged": "^
|
|
23
|
+
"lint-staged": "^16.1.6",
|
|
24
24
|
"pinst": "^3.0.0",
|
|
25
|
-
"prettier": "^3.
|
|
26
|
-
"send": "^1.
|
|
25
|
+
"prettier": "^3.6.2",
|
|
26
|
+
"send": "^1.2.0",
|
|
27
27
|
"tap": "^21.1.0",
|
|
28
|
-
"undici-types": "^7.
|
|
28
|
+
"undici-types": "^7.15.0"
|
|
29
29
|
},
|
|
30
30
|
"scripts": {
|
|
31
31
|
"prepare": "husky",
|