@unhead/vue 0.7.1 → 1.0.1

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
@@ -14,23 +14,7 @@ const HasElementTags$1 = [
14
14
  ];
15
15
 
16
16
  const UniqueTags$1 = ["base", "title", "titleTemplate", "bodyAttrs", "htmlAttrs"];
17
- const ArrayMetaProperties$1 = [
18
- "og:image",
19
- "og:video",
20
- "og:audio",
21
- "og:locale:alternate",
22
- "video:actor",
23
- "video:director",
24
- "video:writer",
25
- "video:tag",
26
- "article:author",
27
- "article:tag",
28
- "book:tag",
29
- "book:author",
30
- "music:album",
31
- "music:musician"
32
- ];
33
- function tagDedupeKey$1(tag) {
17
+ function tagDedupeKey$1(tag, fn) {
34
18
  const { props, tag: tagName } = tag;
35
19
  if (UniqueTags$1.includes(tagName))
36
20
  return tagName;
@@ -44,7 +28,7 @@ function tagDedupeKey$1(tag) {
44
28
  for (const n of name) {
45
29
  if (typeof props[n] !== "undefined") {
46
30
  const val = String(props[n]);
47
- if (ArrayMetaProperties$1.findIndex((p) => val.startsWith(p)) !== -1)
31
+ if (fn && !fn(val))
48
32
  return false;
49
33
  return `${tagName}:${n}:${val}`;
50
34
  }
@@ -302,23 +286,7 @@ const sortTags = (aTag, bTag) => {
302
286
  };
303
287
 
304
288
  const UniqueTags = ["base", "title", "titleTemplate", "bodyAttrs", "htmlAttrs"];
305
- const ArrayMetaProperties = [
306
- "og:image",
307
- "og:video",
308
- "og:audio",
309
- "og:locale:alternate",
310
- "video:actor",
311
- "video:director",
312
- "video:writer",
313
- "video:tag",
314
- "article:author",
315
- "article:tag",
316
- "book:tag",
317
- "book:author",
318
- "music:album",
319
- "music:musician"
320
- ];
321
- function tagDedupeKey(tag) {
289
+ function tagDedupeKey(tag, fn) {
322
290
  const { props, tag: tagName } = tag;
323
291
  if (UniqueTags.includes(tagName))
324
292
  return tagName;
@@ -332,7 +300,7 @@ function tagDedupeKey(tag) {
332
300
  for (const n of name) {
333
301
  if (typeof props[n] !== "undefined") {
334
302
  const val = String(props[n]);
335
- if (ArrayMetaProperties.findIndex((p) => val.startsWith(p)) !== -1)
303
+ if (fn && !fn(val))
336
304
  return false;
337
305
  return `${tagName}:${n}:${val}`;
338
306
  }
package/dist/index.mjs CHANGED
@@ -12,23 +12,7 @@ const HasElementTags$1 = [
12
12
  ];
13
13
 
14
14
  const UniqueTags$1 = ["base", "title", "titleTemplate", "bodyAttrs", "htmlAttrs"];
15
- const ArrayMetaProperties$1 = [
16
- "og:image",
17
- "og:video",
18
- "og:audio",
19
- "og:locale:alternate",
20
- "video:actor",
21
- "video:director",
22
- "video:writer",
23
- "video:tag",
24
- "article:author",
25
- "article:tag",
26
- "book:tag",
27
- "book:author",
28
- "music:album",
29
- "music:musician"
30
- ];
31
- function tagDedupeKey$1(tag) {
15
+ function tagDedupeKey$1(tag, fn) {
32
16
  const { props, tag: tagName } = tag;
33
17
  if (UniqueTags$1.includes(tagName))
34
18
  return tagName;
@@ -42,7 +26,7 @@ function tagDedupeKey$1(tag) {
42
26
  for (const n of name) {
43
27
  if (typeof props[n] !== "undefined") {
44
28
  const val = String(props[n]);
45
- if (ArrayMetaProperties$1.findIndex((p) => val.startsWith(p)) !== -1)
29
+ if (fn && !fn(val))
46
30
  return false;
47
31
  return `${tagName}:${n}:${val}`;
48
32
  }
@@ -300,23 +284,7 @@ const sortTags = (aTag, bTag) => {
300
284
  };
301
285
 
302
286
  const UniqueTags = ["base", "title", "titleTemplate", "bodyAttrs", "htmlAttrs"];
303
- const ArrayMetaProperties = [
304
- "og:image",
305
- "og:video",
306
- "og:audio",
307
- "og:locale:alternate",
308
- "video:actor",
309
- "video:director",
310
- "video:writer",
311
- "video:tag",
312
- "article:author",
313
- "article:tag",
314
- "book:tag",
315
- "book:author",
316
- "music:album",
317
- "music:musician"
318
- ];
319
- function tagDedupeKey(tag) {
287
+ function tagDedupeKey(tag, fn) {
320
288
  const { props, tag: tagName } = tag;
321
289
  if (UniqueTags.includes(tagName))
322
290
  return tagName;
@@ -330,7 +298,7 @@ function tagDedupeKey(tag) {
330
298
  for (const n of name) {
331
299
  if (typeof props[n] !== "undefined") {
332
300
  const val = String(props[n]);
333
- if (ArrayMetaProperties.findIndex((p) => val.startsWith(p)) !== -1)
301
+ if (fn && !fn(val))
334
302
  return false;
335
303
  return `${tagName}:${n}:${val}`;
336
304
  }
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@unhead/vue",
3
3
  "type": "module",
4
- "version": "0.7.1",
4
+ "version": "1.0.1",
5
5
  "packageManager": "pnpm@7.14.0",
6
6
  "author": "Harlan Wilton <harlan@harlanzw.com>",
7
7
  "license": "MIT",
@@ -33,11 +33,11 @@
33
33
  "vue": ">=2.7 || >=3"
34
34
  },
35
35
  "dependencies": {
36
- "@unhead/schema": "0.7.1",
36
+ "@unhead/schema": "1.0.1",
37
37
  "hookable": "^5.4.1"
38
38
  },
39
39
  "devDependencies": {
40
- "unhead": "0.7.1",
40
+ "unhead": "1.0.1",
41
41
  "vue": "^3.2.45"
42
42
  },
43
43
  "scripts": {