@unhead/dom 1.1.23 → 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 setAttrs = (ctx, newEntry = false, markSideEffect) => {
5
+ function setAttrs(ctx, newEntry = false, markSideEffect) {
6
6
  const { tag, $el } = ctx;
7
7
  if (!$el)
8
8
  return;
@@ -32,7 +32,7 @@ const setAttrs = (ctx, newEntry = false, markSideEffect) => {
32
32
  else if (tag.innerHTML && tag.innerHTML !== $el.innerHTML)
33
33
  $el.innerHTML = tag.innerHTML;
34
34
  }
35
- };
35
+ }
36
36
 
37
37
  let prevHash = false;
38
38
  async function renderDOMHead(head, options = {}) {
@@ -179,7 +179,7 @@ async function debouncedRenderDOMHead(head, options = {}) {
179
179
  return exports.domUpdatePromise = exports.domUpdatePromise || new Promise((resolve) => delayFn(() => resolve(doDomUpdate())));
180
180
  }
181
181
 
182
- const PatchDomOnEntryUpdatesPlugin = (options) => {
182
+ function PatchDomOnEntryUpdatesPlugin(options) {
183
183
  return shared.defineHeadPlugin({
184
184
  hooks: {
185
185
  "entries:updated": function(head) {
@@ -192,7 +192,7 @@ const PatchDomOnEntryUpdatesPlugin = (options) => {
192
192
  }
193
193
  }
194
194
  });
195
- };
195
+ }
196
196
 
197
197
  function maybeGetSSRHash(document) {
198
198
  return document?.head.querySelector('meta[name="unhead:ssr"]')?.getAttribute("content") || false;
package/dist/index.d.ts CHANGED
@@ -29,12 +29,12 @@ declare function debouncedRenderDOMHead<T extends Unhead<any>>(head: T, options?
29
29
  interface TriggerDomPatchingOnUpdatesPluginOptions extends RenderDomHeadOptions {
30
30
  delayFn?: (fn: () => void) => void;
31
31
  }
32
- declare const PatchDomOnEntryUpdatesPlugin: (options?: TriggerDomPatchingOnUpdatesPluginOptions) => _unhead_schema.HeadPlugin;
32
+ declare function PatchDomOnEntryUpdatesPlugin(options?: TriggerDomPatchingOnUpdatesPluginOptions): _unhead_schema.HeadPlugin;
33
33
 
34
34
  /**
35
35
  * Set attributes on a DOM element, while adding entry side effects.
36
36
  */
37
- declare const setAttrs: (ctx: DomRenderTagContext, newEntry?: boolean, markSideEffect?: ((ctx: DomRenderTagContext, k: string, fn: () => void) => void) | undefined) => void;
37
+ declare function setAttrs(ctx: DomRenderTagContext, newEntry?: boolean, markSideEffect?: (ctx: DomRenderTagContext, k: string, fn: () => void) => void): void;
38
38
 
39
39
  declare function maybeGetSSRHash(document: Document): string | false;
40
40
 
package/dist/index.mjs CHANGED
@@ -1,6 +1,6 @@
1
1
  import { TagsWithInnerContent, computeHashes, hashTag, HasElementTags, tagDedupeKey, defineHeadPlugin } from '@unhead/shared';
2
2
 
3
- const setAttrs = (ctx, newEntry = false, markSideEffect) => {
3
+ function setAttrs(ctx, newEntry = false, markSideEffect) {
4
4
  const { tag, $el } = ctx;
5
5
  if (!$el)
6
6
  return;
@@ -30,7 +30,7 @@ const setAttrs = (ctx, newEntry = false, markSideEffect) => {
30
30
  else if (tag.innerHTML && tag.innerHTML !== $el.innerHTML)
31
31
  $el.innerHTML = tag.innerHTML;
32
32
  }
33
- };
33
+ }
34
34
 
35
35
  let prevHash = false;
36
36
  async function renderDOMHead(head, options = {}) {
@@ -177,7 +177,7 @@ async function debouncedRenderDOMHead(head, options = {}) {
177
177
  return domUpdatePromise = domUpdatePromise || new Promise((resolve) => delayFn(() => resolve(doDomUpdate())));
178
178
  }
179
179
 
180
- const PatchDomOnEntryUpdatesPlugin = (options) => {
180
+ function PatchDomOnEntryUpdatesPlugin(options) {
181
181
  return defineHeadPlugin({
182
182
  hooks: {
183
183
  "entries:updated": function(head) {
@@ -190,7 +190,7 @@ const PatchDomOnEntryUpdatesPlugin = (options) => {
190
190
  }
191
191
  }
192
192
  });
193
- };
193
+ }
194
194
 
195
195
  function maybeGetSSRHash(document) {
196
196
  return document?.head.querySelector('meta[name="unhead:ssr"]')?.getAttribute("content") || false;
package/package.json CHANGED
@@ -1,8 +1,8 @@
1
1
  {
2
2
  "name": "@unhead/dom",
3
3
  "type": "module",
4
- "version": "1.1.23",
5
- "packageManager": "pnpm@7.28.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.23",
34
- "@unhead/shared": "1.1.23"
33
+ "@unhead/schema": "1.1.26",
34
+ "@unhead/shared": "1.1.26"
35
35
  },
36
36
  "scripts": {
37
37
  "build": "unbuild .",