({
href,
encodedState,
lastEncodedState,
}: CameraHashUpdateOptions)
| 19 | } |
| 20 | |
| 21 | export function getNextCameraHashUpdate({ |
| 22 | href, |
| 23 | encodedState, |
| 24 | lastEncodedState, |
| 25 | }: CameraHashUpdateOptions): CameraHashUpdate | null { |
| 26 | if (encodedState === lastEncodedState) return null; |
| 27 | |
| 28 | const url = new URL(href); |
| 29 | url.hash = encodedState; |
| 30 | |
| 31 | return { |
| 32 | encodedState, |
| 33 | url: url.toString(), |
| 34 | }; |
| 35 | } |
| 36 | |
| 37 | export async function decodeCameraStateFromHash(hash: string): Promise<CameraViewState | null> { |
| 38 | const hashContent = hash.startsWith('#') ? hash.slice(1) : hash; |
no outgoing calls
no test coverage detected