@nxtedition/nxt-undici 6.4.3 → 6.4.5

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/index.js CHANGED
@@ -96,6 +96,10 @@ function wrapDispatch(dispatcher) {
96
96
  interceptors.responseError(),
97
97
  interceptors.query(),
98
98
  (dispatch) => (opts, handler) => {
99
+ if (!opts.origin) {
100
+ throw new TypeError('opts.origin is required')
101
+ }
102
+
99
103
  const headers = parseHeaders(opts.headers)
100
104
 
101
105
  // TODO (fix): Move to interceptor?
@@ -8,6 +8,8 @@ export default () => (dispatch) => (opts, handler) => {
8
8
  const callback = (err, origin) => {
9
9
  if (err) {
10
10
  handler.onError(err)
11
+ } else if (!origin) {
12
+ handler.onError(new Error('invalid origin: ' + origin))
11
13
  } else {
12
14
  dispatch({ ...opts, origin }, handler)
13
15
  }
@@ -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",
3
+ "version": "6.4.5",
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.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": "^22.13.10",
20
- "eslint": "^9.22.0",
21
- "eslint-plugin-n": "^17.16.2",
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": "^15.5.0",
23
+ "lint-staged": "^16.1.6",
24
24
  "pinst": "^3.0.0",
25
- "prettier": "^3.5.3",
26
- "send": "^1.1.0",
25
+ "prettier": "^3.6.2",
26
+ "send": "^1.2.0",
27
27
  "tap": "^21.1.0",
28
- "undici-types": "^7.5.0"
28
+ "undici-types": "^7.15.0"
29
29
  },
30
30
  "scripts": {
31
31
  "prepare": "husky",