unhead 1.6.2 → 1.7.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
@@ -67,6 +67,7 @@ const DedupePlugin = shared.defineHeadPlugin({
67
67
  newTags.push(...dupes);
68
68
  });
69
69
  ctx.tags = newTags;
70
+ ctx.tags = ctx.tags.filter((t) => !(t.tag === "meta" && (t.props.name || t.props.property) && !t.props.content));
70
71
  }
71
72
  }
72
73
  });
@@ -356,7 +357,10 @@ function CapoPlugin(options) {
356
357
  hooks: {
357
358
  "tags:beforeResolve": function({ tags }) {
358
359
  for (const tag of tags) {
359
- if (tag.tagPriority || tag.tagPosition && tag.tagPosition !== "head")
360
+ if (tag.tagPosition && tag.tagPosition !== "head")
361
+ continue;
362
+ tag.tagPriority = tag.tagPriority || shared.tagWeight(tag);
363
+ if (tag.tagPriority !== 100)
360
364
  continue;
361
365
  const isTruthy = (val) => val === "" || val === true;
362
366
  const isScript = tag.tag === "script";
package/dist/index.mjs CHANGED
@@ -66,6 +66,7 @@ const DedupePlugin = defineHeadPlugin({
66
66
  newTags.push(...dupes);
67
67
  });
68
68
  ctx.tags = newTags;
69
+ ctx.tags = ctx.tags.filter((t) => !(t.tag === "meta" && (t.props.name || t.props.property) && !t.props.content));
69
70
  }
70
71
  }
71
72
  });
@@ -355,7 +356,10 @@ function CapoPlugin(options) {
355
356
  hooks: {
356
357
  "tags:beforeResolve": function({ tags }) {
357
358
  for (const tag of tags) {
358
- if (tag.tagPriority || tag.tagPosition && tag.tagPosition !== "head")
359
+ if (tag.tagPosition && tag.tagPosition !== "head")
360
+ continue;
361
+ tag.tagPriority = tag.tagPriority || tagWeight(tag);
362
+ if (tag.tagPriority !== 100)
359
363
  continue;
360
364
  const isTruthy = (val) => val === "" || val === true;
361
365
  const isScript = tag.tag === "script";
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "unhead",
3
3
  "type": "module",
4
- "version": "1.6.2",
4
+ "version": "1.7.2",
5
5
  "author": "Harlan Wilton <harlan@harlanzw.com>",
6
6
  "license": "MIT",
7
7
  "funding": "https://github.com/sponsors/harlan-zw",
@@ -30,9 +30,9 @@
30
30
  ],
31
31
  "dependencies": {
32
32
  "hookable": "^5.5.3",
33
- "@unhead/dom": "1.6.2",
34
- "@unhead/schema": "1.6.2",
35
- "@unhead/shared": "1.6.2"
33
+ "@unhead/dom": "1.7.2",
34
+ "@unhead/schema": "1.7.2",
35
+ "@unhead/shared": "1.7.2"
36
36
  },
37
37
  "scripts": {
38
38
  "build": "unbuild .",