@unhead/vue 1.0.9 → 1.0.11

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
@@ -1017,10 +1017,12 @@ const useServerBodyAttrs = (attrs) => useHead({ bodyAttrs: attrs });
1017
1017
 
1018
1018
  function useHead(input, options = {}) {
1019
1019
  const head = injectHead();
1020
- const isBrowser = IsBrowser || !!head.resolvedOptions?.document;
1021
- if (options.mode === "server" && isBrowser || options.mode === "client" && !isBrowser)
1022
- return;
1023
- return isBrowser ? clientUseHead(input, options) : serverUseHead(input, options);
1020
+ if (head) {
1021
+ const isBrowser = IsBrowser || !!head.resolvedOptions?.document;
1022
+ if (options.mode === "server" && isBrowser || options.mode === "client" && !isBrowser)
1023
+ return;
1024
+ return isBrowser ? clientUseHead(input, options) : serverUseHead(input, options);
1025
+ }
1024
1026
  }
1025
1027
  const useTagTitle = (title) => useHead({ title });
1026
1028
  const useTitleTemplate = (titleTemplate) => useHead({ titleTemplate });
package/dist/index.mjs CHANGED
@@ -1015,10 +1015,12 @@ const useServerBodyAttrs = (attrs) => useHead({ bodyAttrs: attrs });
1015
1015
 
1016
1016
  function useHead(input, options = {}) {
1017
1017
  const head = injectHead();
1018
- const isBrowser = IsBrowser || !!head.resolvedOptions?.document;
1019
- if (options.mode === "server" && isBrowser || options.mode === "client" && !isBrowser)
1020
- return;
1021
- return isBrowser ? clientUseHead(input, options) : serverUseHead(input, options);
1018
+ if (head) {
1019
+ const isBrowser = IsBrowser || !!head.resolvedOptions?.document;
1020
+ if (options.mode === "server" && isBrowser || options.mode === "client" && !isBrowser)
1021
+ return;
1022
+ return isBrowser ? clientUseHead(input, options) : serverUseHead(input, options);
1023
+ }
1022
1024
  }
1023
1025
  const useTagTitle = (title) => useHead({ title });
1024
1026
  const useTitleTemplate = (titleTemplate) => useHead({ titleTemplate });
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@unhead/vue",
3
3
  "type": "module",
4
- "version": "1.0.9",
4
+ "version": "1.0.11",
5
5
  "packageManager": "pnpm@7.18.1",
6
6
  "author": "Harlan Wilton <harlan@harlanzw.com>",
7
7
  "license": "MIT",
@@ -34,11 +34,11 @@
34
34
  },
35
35
  "dependencies": {
36
36
  "hookable": "^5.4.2",
37
- "@unhead/schema": "1.0.9"
37
+ "@unhead/schema": "1.0.11"
38
38
  },
39
39
  "devDependencies": {
40
40
  "vue": "^3.2.45",
41
- "unhead": "1.0.9"
41
+ "unhead": "1.0.11"
42
42
  },
43
43
  "scripts": {
44
44
  "build": "unbuild .",