@unhead/shared 1.3.4 → 1.3.7

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 CHANGED
@@ -500,17 +500,8 @@ async function normaliseTag(tagName, input, e) {
500
500
  tag[k] = e[k];
501
501
  }
502
502
  });
503
- ["innerHTML", "textContent"].forEach((k) => {
504
- if (tag.tag === "script" && typeof tag[k] === "string" && ["application/ld+json", "application/json"].includes(tag.props.type)) {
505
- try {
506
- tag[k] = JSON.parse(tag[k]);
507
- } catch (e2) {
508
- tag[k] = "";
509
- }
510
- }
511
- if (typeof tag[k] === "object")
512
- tag[k] = JSON.stringify(tag[k]);
513
- });
503
+ if (tag.tag === "script" && typeof tag.innerHTML === "object")
504
+ tag.innerHTML = JSON.stringify(tag.innerHTML);
514
505
  if (tag.props.class)
515
506
  tag.props.class = normaliseClassProp(tag.props.class);
516
507
  if (tag.props.content && Array.isArray(tag.props.content))
package/dist/index.mjs CHANGED
@@ -498,17 +498,8 @@ async function normaliseTag(tagName, input, e) {
498
498
  tag[k] = e[k];
499
499
  }
500
500
  });
501
- ["innerHTML", "textContent"].forEach((k) => {
502
- if (tag.tag === "script" && typeof tag[k] === "string" && ["application/ld+json", "application/json"].includes(tag.props.type)) {
503
- try {
504
- tag[k] = JSON.parse(tag[k]);
505
- } catch (e2) {
506
- tag[k] = "";
507
- }
508
- }
509
- if (typeof tag[k] === "object")
510
- tag[k] = JSON.stringify(tag[k]);
511
- });
501
+ if (tag.tag === "script" && typeof tag.innerHTML === "object")
502
+ tag.innerHTML = JSON.stringify(tag.innerHTML);
512
503
  if (tag.props.class)
513
504
  tag.props.class = normaliseClassProp(tag.props.class);
514
505
  if (tag.props.content && Array.isArray(tag.props.content))
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@unhead/shared",
3
3
  "type": "module",
4
- "version": "1.3.4",
4
+ "version": "1.3.7",
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.4"
37
+ "@unhead/schema": "1.3.7"
38
38
  },
39
39
  "devDependencies": {
40
40
  "packrup": "^0.1.0"