@unhead/ssr 1.1.25 → 1.1.26

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
@@ -2,7 +2,7 @@
2
2
 
3
3
  const shared = require('@unhead/shared');
4
4
 
5
- const propsToString = (props) => {
5
+ function propsToString(props) {
6
6
  const handledAttributes = [];
7
7
  for (const [key, value] of Object.entries(props)) {
8
8
  if (value === false || value == null)
@@ -13,7 +13,7 @@ const propsToString = (props) => {
13
13
  handledAttributes.push(attribute);
14
14
  }
15
15
  return handledAttributes.length > 0 ? ` ${handledAttributes.join(" ")}` : "";
16
- };
16
+ }
17
17
 
18
18
  function encodeInnerHtml(str) {
19
19
  return str.replace(/[&<>"'/]/g, (char) => {
@@ -35,7 +35,7 @@ function encodeInnerHtml(str) {
35
35
  }
36
36
  });
37
37
  }
38
- const tagToString = (tag) => {
38
+ function tagToString(tag) {
39
39
  const attrs = propsToString(tag.props);
40
40
  const openTag = `<${tag.tag}${attrs}>`;
41
41
  if (!shared.TagsWithInnerContent.includes(tag.tag))
@@ -44,7 +44,7 @@ const tagToString = (tag) => {
44
44
  if (tag.textContent)
45
45
  content = encodeInnerHtml(String(tag.textContent));
46
46
  return shared.SelfClosingTags.includes(tag.tag) ? openTag : `${openTag}${content}</${tag.tag}>`;
47
- };
47
+ }
48
48
 
49
49
  function ssrRenderTags(tags) {
50
50
  const schema = { htmlAttrs: {}, bodyAttrs: {}, tags: { head: [], bodyClose: [], bodyOpen: [] } };
package/dist/index.d.ts CHANGED
@@ -3,10 +3,10 @@ export { SSRHeadPayload } from '@unhead/schema';
3
3
 
4
4
  declare function renderSSRHead<T extends {}>(head: Unhead<T>): Promise<SSRHeadPayload>;
5
5
 
6
- declare const propsToString: (props: Record<string, any>) => string;
6
+ declare function propsToString(props: Record<string, any>): string;
7
7
 
8
8
  declare function encodeInnerHtml(str: string): string;
9
- declare const tagToString: <T extends HeadTag>(tag: T) => string;
9
+ declare function tagToString<T extends HeadTag>(tag: T): string;
10
10
 
11
11
  declare function ssrRenderTags<T extends HeadTag>(tags: T[]): {
12
12
  headTags: string;
package/dist/index.mjs CHANGED
@@ -1,6 +1,6 @@
1
1
  import { TagsWithInnerContent, SelfClosingTags, computeHashes } from '@unhead/shared';
2
2
 
3
- const propsToString = (props) => {
3
+ function propsToString(props) {
4
4
  const handledAttributes = [];
5
5
  for (const [key, value] of Object.entries(props)) {
6
6
  if (value === false || value == null)
@@ -11,7 +11,7 @@ const propsToString = (props) => {
11
11
  handledAttributes.push(attribute);
12
12
  }
13
13
  return handledAttributes.length > 0 ? ` ${handledAttributes.join(" ")}` : "";
14
- };
14
+ }
15
15
 
16
16
  function encodeInnerHtml(str) {
17
17
  return str.replace(/[&<>"'/]/g, (char) => {
@@ -33,7 +33,7 @@ function encodeInnerHtml(str) {
33
33
  }
34
34
  });
35
35
  }
36
- const tagToString = (tag) => {
36
+ function tagToString(tag) {
37
37
  const attrs = propsToString(tag.props);
38
38
  const openTag = `<${tag.tag}${attrs}>`;
39
39
  if (!TagsWithInnerContent.includes(tag.tag))
@@ -42,7 +42,7 @@ const tagToString = (tag) => {
42
42
  if (tag.textContent)
43
43
  content = encodeInnerHtml(String(tag.textContent));
44
44
  return SelfClosingTags.includes(tag.tag) ? openTag : `${openTag}${content}</${tag.tag}>`;
45
- };
45
+ }
46
46
 
47
47
  function ssrRenderTags(tags) {
48
48
  const schema = { htmlAttrs: {}, bodyAttrs: {}, tags: { head: [], bodyClose: [], bodyOpen: [] } };
package/package.json CHANGED
@@ -1,8 +1,8 @@
1
1
  {
2
2
  "name": "@unhead/ssr",
3
3
  "type": "module",
4
- "version": "1.1.25",
5
- "packageManager": "pnpm@7.30.0",
4
+ "version": "1.1.26",
5
+ "packageManager": "pnpm@7.32.0",
6
6
  "author": "Harlan Wilton <harlan@harlanzw.com>",
7
7
  "license": "MIT",
8
8
  "funding": "https://github.com/sponsors/harlan-zw",
@@ -30,8 +30,8 @@
30
30
  "dist"
31
31
  ],
32
32
  "dependencies": {
33
- "@unhead/schema": "1.1.25",
34
- "@unhead/shared": "1.1.25"
33
+ "@unhead/schema": "1.1.26",
34
+ "@unhead/shared": "1.1.26"
35
35
  },
36
36
  "scripts": {
37
37
  "build": "unbuild .",