Skip to content

Commit 8090c2c

Browse files
committed
fix(RouterTrace): Correct types after RouteInfo simplification
1 parent 8ff7656 commit 8090c2c

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

src/lib/RouterTrace/RouterTrace.svelte

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,9 @@
33
import { routePatternsKey, RouterEngine } from '$lib/kernel/RouterEngine.svelte.js';
44
import { resolveHashValue } from '$lib/kernel/resolveHashValue.js';
55
import { getRouterContext } from '$lib/Router/Router.svelte';
6-
import type { PatternRouteInfo } from '$lib/types.js';
76
import type { HTMLTableAttributes } from 'svelte/elements';
87
import { assertAllowedRoutingMode } from '$lib/utils.js';
8+
import type { Hash } from '$lib/types.js';
99
1010
type Props = Omit<HTMLTableAttributes, 'children'> & {
1111
/**
@@ -34,7 +34,7 @@
3434
* Unlike other components, the `RouterTrace` component does not need a hash value if a router engine object is
3535
* provided in its stead via the `router` property.
3636
*/
37-
hash?: boolean | string;
37+
hash?: Hash;
3838
/**
3939
* Sets the router engine to trace.
4040
*/
@@ -127,12 +127,12 @@
127127
{#each Object.entries(router.routeStatus) as [key, status]}
128128
<tr>
129129
<td>{key}</td>
130-
{#if typeof (router.routes[key] as PatternRouteInfo).pattern === 'string'}
130+
{#if typeof router.routes[key].path === 'string'}
131131
<td>
132-
<pre>{(router.routes[key] as PatternRouteInfo).pattern}</pre>
132+
<pre>{router.routes[key].path}</pre>
133133
</td>
134134
{/if}
135-
<td colspan={typeof (router.routes[key] as PatternRouteInfo).pattern === 'string' ? 1 : 2}>
135+
<td colspan={typeof router.routes[key].path === 'string' ? 1 : 2}>
136136
<code>{routePatterns.get(key)?.regex}</code>
137137
</td>
138138
<td>

0 commit comments

Comments
 (0)