@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 +1 -1
- package/util/template/index.js +6 -5
package/package.json
CHANGED
package/util/template/index.js
CHANGED
|
@@ -51,7 +51,9 @@ export function makeTemplateCompiler({ ds, proxify }) {
|
|
|
51
51
|
}
|
|
52
52
|
|
|
53
53
|
const hashTemplate = (template, prefix) => {
|
|
54
|
-
if (
|
|
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
|
-
|
|
240
|
-
|
|
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$) {
|