(asPath: string, kind: ScrollPositionKind)
| 10 | let activeRestoration: (() => void) | undefined; |
| 11 | |
| 12 | const getScrollKey = (asPath: string, kind: ScrollPositionKind): string => { |
| 13 | if (typeof window === 'undefined') { |
| 14 | return `${kind}:${asPath}`; |
| 15 | } |
| 16 | |
| 17 | const url = new URL(asPath, window.location.origin); |
| 18 | const historyKey = (window.history.state as { key?: string } | null)?.key; |
| 19 | return `${kind}:${url.pathname}${url.search}${url.hash}:${historyKey ?? ''}`; |
| 20 | }; |
| 21 | |
| 22 | export const getHistoryEntryKey = (): string => |
| 23 | getScrollKey(window.location.href, 'page'); |
no outgoing calls
no test coverage detected