@unhead/shared 1.3.8 → 1.3.9
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/dist/index.cjs +4 -4
- package/dist/index.mjs +4 -4
- package/package.json +2 -2
package/dist/index.cjs
CHANGED
|
@@ -584,15 +584,15 @@ function processTemplateParams(s, p) {
|
|
|
584
584
|
if (typeof s !== "string")
|
|
585
585
|
return s;
|
|
586
586
|
function sub(token) {
|
|
587
|
-
if (["s", "pageTitle"].includes(token))
|
|
588
|
-
return p.pageTitle;
|
|
589
587
|
let val;
|
|
590
|
-
if (
|
|
588
|
+
if (["s", "pageTitle"].includes(token)) {
|
|
589
|
+
val = p.pageTitle;
|
|
590
|
+
} else if (token.includes(".")) {
|
|
591
591
|
val = token.split(".").reduce((acc, key) => acc ? acc[key] || void 0 : void 0, p);
|
|
592
592
|
} else {
|
|
593
593
|
val = p[token];
|
|
594
594
|
}
|
|
595
|
-
return typeof val !== "undefined" ? val || "" : false;
|
|
595
|
+
return typeof val !== "undefined" ? (val || "").replace(/"/g, '\\"') : false;
|
|
596
596
|
}
|
|
597
597
|
let decoded = s;
|
|
598
598
|
try {
|
package/dist/index.mjs
CHANGED
|
@@ -582,15 +582,15 @@ function processTemplateParams(s, p) {
|
|
|
582
582
|
if (typeof s !== "string")
|
|
583
583
|
return s;
|
|
584
584
|
function sub(token) {
|
|
585
|
-
if (["s", "pageTitle"].includes(token))
|
|
586
|
-
return p.pageTitle;
|
|
587
585
|
let val;
|
|
588
|
-
if (
|
|
586
|
+
if (["s", "pageTitle"].includes(token)) {
|
|
587
|
+
val = p.pageTitle;
|
|
588
|
+
} else if (token.includes(".")) {
|
|
589
589
|
val = token.split(".").reduce((acc, key) => acc ? acc[key] || void 0 : void 0, p);
|
|
590
590
|
} else {
|
|
591
591
|
val = p[token];
|
|
592
592
|
}
|
|
593
|
-
return typeof val !== "undefined" ? val || "" : false;
|
|
593
|
+
return typeof val !== "undefined" ? (val || "").replace(/"/g, '\\"') : false;
|
|
594
594
|
}
|
|
595
595
|
let decoded = s;
|
|
596
596
|
try {
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@unhead/shared",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "1.3.
|
|
4
|
+
"version": "1.3.9",
|
|
5
5
|
"author": "Harlan Wilton <harlan@harlanzw.com>",
|
|
6
6
|
"license": "MIT",
|
|
7
7
|
"funding": "https://github.com/sponsors/harlan-zw",
|
|
@@ -34,7 +34,7 @@
|
|
|
34
34
|
"dist"
|
|
35
35
|
],
|
|
36
36
|
"dependencies": {
|
|
37
|
-
"@unhead/schema": "1.3.
|
|
37
|
+
"@unhead/schema": "1.3.9"
|
|
38
38
|
},
|
|
39
39
|
"devDependencies": {
|
|
40
40
|
"packrup": "^0.1.0"
|