@nxtedition/lib 23.14.2 → 23.15.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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nxtedition/lib",
3
- "version": "23.14.2",
3
+ "version": "23.15.1",
4
4
  "license": "MIT",
5
5
  "author": "Robert Nagy <robert.nagy@boffins.se>",
6
6
  "type": "module",
@@ -13,24 +13,25 @@ const wasmBuffer = readFileSync(wasmPath)
13
13
 
14
14
  initSync({ module: wasmBuffer })
15
15
 
16
- export function makeTemplateCompiler({ logger = globalThis.__nxt_lib_app?.logger, ...args }) {
16
+ const defaultFetchClient = new Agent({
17
+ connections: 128,
18
+ })
19
+
20
+ export function makeTemplateCompiler({
21
+ logger = globalThis.__nxt_lib_app?.logger,
22
+ dispatcher = defaultFetchClient,
23
+ platform,
24
+ ...args
25
+ }) {
26
+ const defaultOptions = { dispatcher }
17
27
  return commonMakeTemplateCompiler({
18
28
  ...args,
19
29
  logger,
20
30
  platform: {
21
31
  hasha: hashSync,
22
- fetch,
32
+ fetch: (resource, options) =>
33
+ request(resource, options ? { dispatcher, ...options } : defaultOptions),
34
+ ...platform,
23
35
  },
24
36
  })
25
37
  }
26
-
27
- const fetchClient = new Agent({
28
- connections: 128,
29
- })
30
-
31
- function fetch(resource, options) {
32
- return request(resource, {
33
- ...options,
34
- dispatcher: fetchClient,
35
- })
36
- }