@nxtedition/lib 26.3.8 → 26.4.1

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/cache.js CHANGED
@@ -170,6 +170,21 @@ export class AsyncCache {
170
170
  return this.#refresh(args)
171
171
  }
172
172
 
173
+ /**
174
+ * @param {string} key
175
+ */
176
+ delete(key) {
177
+ this.#delete(key)
178
+ }
179
+
180
+ /**
181
+ * @param {string} key
182
+ * @param {V} value
183
+ */
184
+ set(key, value) {
185
+ this.#set(key, value)
186
+ }
187
+
173
188
  purgeStale() {
174
189
  try {
175
190
  this.#lru?.purgeStale()
package/http.js CHANGED
@@ -360,6 +360,7 @@ export async function requestMiddleware(ctx, next) {
360
360
  if (res.writableEnded || res.destroyed || res.stream?.destroyed) {
361
361
  // Do nothing..
362
362
  } else {
363
+ res.on('error', noop)
363
364
  res.destroy()
364
365
  ctx.logger?.warn('request destroyed')
365
366
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nxtedition/lib",
3
- "version": "26.3.8",
3
+ "version": "26.4.1",
4
4
  "license": "MIT",
5
5
  "author": "Robert Nagy <robert.nagy@boffins.se>",
6
6
  "type": "module",
@@ -18,23 +18,22 @@ export interface TemplateCompiler {
18
18
  template: Nxtpression<ReturnValue, Context> | string,
19
19
  args$?: Context | rx.Observable<Context>,
20
20
  options?: FirstValueFromConfig,
21
- ) => Promise<ResolveNxtpressionDeep<Nxtpression<ReturnValue, Context>>>
21
+ ) => Promise<unknown>
22
22
 
23
23
  onResolveTemplate: <ReturnValue, Context>(
24
24
  template: Nxtpression<ReturnValue, Context> | string,
25
25
  args$?: Context | rx.Observable<Context>,
26
- ) => rx.Observable<ResolveNxtpressionDeep<Nxtpression<ReturnValue, Context>>>
26
+ ) => rx.Observable<unknown>
27
27
 
28
28
  compileTemplate: <ReturnValue, Context>(
29
29
  template: Nxtpression<ReturnValue, Context> | string,
30
- ) => null | ((args$?: Context | rx.Observable<Context>) => rx.Observable<ReturnValue>)
30
+ ) => null | ((args$?: Context | rx.Observable<Context>) => rx.Observable<unknown>)
31
31
 
32
32
  isTemplate: (value: unknown) => value is Nxtpression
33
33
  }
34
34
 
35
35
  export type Nxtpression<ReturnValue = string, Context extends object = object> =
36
- // eslint-disable-next-line @typescript-eslint/no-wrapper-object-types
37
- | (String & {
36
+ | {
38
37
  /**
39
38
  * TS-HACK: this property doesn't really exist on the nxtpression string,
40
39
  * it is only here to make sure the generic Context won't get stripped.
@@ -46,7 +45,7 @@ export type Nxtpression<ReturnValue = string, Context extends object = object> =
46
45
  * it is only here to make sure the generic Context won't get stripped.
47
46
  */
48
47
  __returnValue: ReturnValue
49
- })
48
+ }
50
49
  | string
51
50
  | ReturnValue
52
51