@nxtedition/lib 21.0.17 → 21.0.18

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": "21.0.17",
3
+ "version": "21.0.18",
4
4
  "license": "MIT",
5
5
  "author": "Robert Nagy <robert.nagy@boffins.se>",
6
6
  "type": "module",
@@ -51,7 +51,9 @@ export function makeTemplateCompiler({ ds, proxify }) {
51
51
  }
52
52
 
53
53
  const hashTemplate = (template, prefix) => {
54
- if (fp.isPlainObject(template)) {
54
+ if (typeof template === 'string') {
55
+ return isTemplate(template) ? objectHash([prefix, template]) : ''
56
+ } else if (fp.isPlainObject(template)) {
55
57
  let hashes
56
58
  for (const key of Object.keys(template)) {
57
59
  const hash = hashTemplate(template[key], key)
@@ -71,8 +73,6 @@ export function makeTemplateCompiler({ ds, proxify }) {
71
73
  }
72
74
  }
73
75
  return hashes ? objectHash([prefix, hashes]) : ''
74
- } else if (isTemplate(template)) {
75
- return objectHash([prefix, template])
76
76
  } else {
77
77
  return ''
78
78
  }
@@ -236,8 +236,9 @@ export function makeTemplateCompiler({ ds, proxify }) {
236
236
  return resolver ? (args$) => resolver(template, args$) : null
237
237
  }
238
238
 
239
- async function resolveTemplate(template, args$, options) {
240
- return firstValueFrom(onResolveTemplate(template, args$), options)
239
+ function resolveTemplate(template, args$, options) {
240
+ const expr = _compileTemplate(template)
241
+ return expr ? firstValueFrom(expr(template, args$), options) : template
241
242
  }
242
243
 
243
244
  function onResolveTemplate(template, args$) {