@unhead/dom 1.0.0 → 1.0.2

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
@@ -11,23 +11,7 @@ const HasElementTags = [
11
11
  ];
12
12
 
13
13
  const UniqueTags = ["base", "title", "titleTemplate", "bodyAttrs", "htmlAttrs"];
14
- const ArrayMetaProperties = [
15
- "og:image",
16
- "og:video",
17
- "og:audio",
18
- "og:locale:alternate",
19
- "video:actor",
20
- "video:director",
21
- "video:writer",
22
- "video:tag",
23
- "article:author",
24
- "article:tag",
25
- "book:tag",
26
- "book:author",
27
- "music:album",
28
- "music:musician"
29
- ];
30
- function tagDedupeKey(tag) {
14
+ function tagDedupeKey(tag, fn) {
31
15
  const { props, tag: tagName } = tag;
32
16
  if (UniqueTags.includes(tagName))
33
17
  return tagName;
@@ -41,7 +25,7 @@ function tagDedupeKey(tag) {
41
25
  for (const n of name) {
42
26
  if (typeof props[n] !== "undefined") {
43
27
  const val = String(props[n]);
44
- if (ArrayMetaProperties.findIndex((p) => val.startsWith(p)) !== -1)
28
+ if (fn && !fn(val))
45
29
  return false;
46
30
  return `${tagName}:${n}:${val}`;
47
31
  }
package/dist/index.mjs CHANGED
@@ -9,23 +9,7 @@ const HasElementTags = [
9
9
  ];
10
10
 
11
11
  const UniqueTags = ["base", "title", "titleTemplate", "bodyAttrs", "htmlAttrs"];
12
- const ArrayMetaProperties = [
13
- "og:image",
14
- "og:video",
15
- "og:audio",
16
- "og:locale:alternate",
17
- "video:actor",
18
- "video:director",
19
- "video:writer",
20
- "video:tag",
21
- "article:author",
22
- "article:tag",
23
- "book:tag",
24
- "book:author",
25
- "music:album",
26
- "music:musician"
27
- ];
28
- function tagDedupeKey(tag) {
12
+ function tagDedupeKey(tag, fn) {
29
13
  const { props, tag: tagName } = tag;
30
14
  if (UniqueTags.includes(tagName))
31
15
  return tagName;
@@ -39,7 +23,7 @@ function tagDedupeKey(tag) {
39
23
  for (const n of name) {
40
24
  if (typeof props[n] !== "undefined") {
41
25
  const val = String(props[n]);
42
- if (ArrayMetaProperties.findIndex((p) => val.startsWith(p)) !== -1)
26
+ if (fn && !fn(val))
43
27
  return false;
44
28
  return `${tagName}:${n}:${val}`;
45
29
  }
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@unhead/dom",
3
3
  "type": "module",
4
- "version": "1.0.0",
4
+ "version": "1.0.2",
5
5
  "packageManager": "pnpm@7.14.0",
6
6
  "author": "Harlan Wilton <harlan@harlanzw.com>",
7
7
  "license": "MIT",
@@ -30,10 +30,10 @@
30
30
  "dist"
31
31
  ],
32
32
  "dependencies": {
33
- "@unhead/schema": "1.0.0"
33
+ "@unhead/schema": "1.0.2"
34
34
  },
35
35
  "devDependencies": {
36
- "zhead": "^1.0.1"
36
+ "zhead": "^1.0.3"
37
37
  },
38
38
  "scripts": {
39
39
  "build": "unbuild .",