@nexrender/core 1.46.4 → 1.46.5
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": "@nexrender/core",
|
|
3
|
-
"version": "1.46.
|
|
3
|
+
"version": "1.46.5",
|
|
4
4
|
"main": "src/index.js",
|
|
5
5
|
"author": "Inlife",
|
|
6
6
|
"homepage": "https://www.nexrender.com",
|
|
@@ -36,5 +36,5 @@
|
|
|
36
36
|
"publishConfig": {
|
|
37
37
|
"access": "public"
|
|
38
38
|
},
|
|
39
|
-
"gitHead": "
|
|
39
|
+
"gitHead": "197c84f1799c2c147c70b06b0568ae5ecbb1a2a5"
|
|
40
40
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
const
|
|
1
|
+
const nexEscape = str => {
|
|
2
2
|
str = JSON.stringify(str)
|
|
3
3
|
str = str.substring(1, str.length-1)
|
|
4
4
|
str = `'${str.replace(/'/g, '\\\'')}'`
|
|
@@ -7,12 +7,12 @@ const escape = str => {
|
|
|
7
7
|
|
|
8
8
|
const selectLayers = (job, { composition, layerName, layerIndex }, callbackString) => {
|
|
9
9
|
const method = layerName ? 'selectLayersByName' : 'selectLayersByIndex';
|
|
10
|
-
const compo = composition === undefined ? 'null' :
|
|
11
|
-
const value = layerName ?
|
|
10
|
+
const compo = composition === undefined ? 'null' : nexEscape(composition);
|
|
11
|
+
const value = layerName ? nexEscape(layerName) : layerIndex;
|
|
12
12
|
return (`nexrender.${method}(${compo}, ${value}, ${callbackString}, null, ${job.template.continueOnMissing});`);
|
|
13
13
|
}
|
|
14
14
|
|
|
15
15
|
module.exports = {
|
|
16
|
-
|
|
16
|
+
nexEscape,
|
|
17
17
|
selectLayers,
|
|
18
|
-
}
|
|
18
|
+
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
const { selectLayers } = require('./helpers')
|
|
1
|
+
const { selectLayers, nexEscape } = require('./helpers')
|
|
2
2
|
|
|
3
3
|
const renderIf = (value, string) => {
|
|
4
|
-
const encoded = typeof value == 'string' ?
|
|
4
|
+
const encoded = typeof value == 'string' ? nexEscape(value) : JSON.stringify(value);
|
|
5
5
|
return value === undefined ? '' : string.replace('$value', () => encoded);
|
|
6
6
|
}
|
|
7
7
|
|
|
@@ -19,4 +19,4 @@ const wrapData = (job, settings, { property, value, expression, ...asset }) => (
|
|
|
19
19
|
}`)}
|
|
20
20
|
})();\n`)
|
|
21
21
|
|
|
22
|
-
module.exports = wrapData
|
|
22
|
+
module.exports = wrapData
|