@nekm/svelte-core 1.0.15 → 1.0.16

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.
@@ -13,17 +13,19 @@
13
13
  * Base domain to the production site. If the current domain does not match
14
14
  * this, then Google Analytics will send debug data only.
15
15
  */
16
- readonly productionDomain?: string;
16
+ readonly productionDomain?: string | URL;
17
17
  }
18
18
 
19
19
  const { id, productionDomain }: GoogleAnalyticsProps = $props();
20
20
 
21
+ const productionDomainStr = productionDomain instanceof URL ? productionDomain.hostname : productionDomain;
22
+
21
23
  function createConfig() {
22
- if (!productionDomain) {
24
+ if (!productionDomainStr) {
23
25
  return {};
24
26
  }
25
27
 
26
- return page.url.hostname !== productionDomain ? { debug_mode: true } : {};
28
+ return page.url.hostname !== productionDomainStr ? { debug_mode: true } : {};
27
29
  }
28
30
 
29
31
  onMount(() => {
@@ -7,7 +7,7 @@ export interface GoogleAnalyticsProps {
7
7
  * Base domain to the production site. If the current domain does not match
8
8
  * this, then Google Analytics will send debug data only.
9
9
  */
10
- readonly productionDomain?: string;
10
+ readonly productionDomain?: string | URL;
11
11
  }
12
12
  declare const GoogleAnalytics: import("svelte").Component<GoogleAnalyticsProps, {}, "">;
13
13
  type GoogleAnalytics = ReturnType<typeof GoogleAnalytics>;
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@nekm/svelte-core",
3
3
  "description": "Code I find myself re-writing over-and-over, Svelte edition.",
4
- "version": "1.0.15",
4
+ "version": "1.0.16",
5
5
  "scripts": {
6
6
  "dev": "vite dev",
7
7
  "build": "vite build && npm run prepack",