@nxtedition/lib 14.0.4 → 14.0.6
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 -6
package/package.json
CHANGED
package/util/template/index.js
CHANGED
|
@@ -3,7 +3,6 @@ const rxjs = require('rxjs')
|
|
|
3
3
|
const fp = require('lodash/fp')
|
|
4
4
|
const getNxtpressionsCompiler = require('./nextpressions')
|
|
5
5
|
const getJavascriptCompiler = require('./javascript')
|
|
6
|
-
const weakCache = require('../../weakCache')
|
|
7
6
|
const JSON5 = require('json5')
|
|
8
7
|
|
|
9
8
|
module.exports = (options) => {
|
|
@@ -76,7 +75,7 @@ module.exports = (options) => {
|
|
|
76
75
|
: null
|
|
77
76
|
}
|
|
78
77
|
|
|
79
|
-
const inner =
|
|
78
|
+
const inner = function inner(str) {
|
|
80
79
|
const templateStart = str.lastIndexOf('{{')
|
|
81
80
|
if (templateStart === -1) {
|
|
82
81
|
return null
|
|
@@ -103,7 +102,7 @@ module.exports = (options) => {
|
|
|
103
102
|
body: str.slice(bodyStart, bodyEnd),
|
|
104
103
|
post: str.slice(templateEnd),
|
|
105
104
|
}
|
|
106
|
-
}
|
|
105
|
+
}
|
|
107
106
|
|
|
108
107
|
function compileStringTemplate(str, args$) {
|
|
109
108
|
if (!fp.isString(str)) {
|
|
@@ -129,9 +128,10 @@ module.exports = (options) => {
|
|
|
129
128
|
}
|
|
130
129
|
|
|
131
130
|
return expr(args$).pipe(
|
|
132
|
-
rx.switchMap((body) =>
|
|
133
|
-
|
|
134
|
-
|
|
131
|
+
rx.switchMap((body) => {
|
|
132
|
+
const str = `${pre}${stringify(body, type !== 'js')}${post}`
|
|
133
|
+
return compileStringTemplate(str, args$) ?? rxjs.of(str)
|
|
134
|
+
})
|
|
135
135
|
)
|
|
136
136
|
}
|
|
137
137
|
|