(
state: PersistedUiState,
udid: string,
options: { forceFit?: boolean } = {},
)
| 223 | } |
| 224 | |
| 225 | export function viewportStateForUDID( |
| 226 | state: PersistedUiState, |
| 227 | udid: string, |
| 228 | options: { forceFit?: boolean } = {}, |
| 229 | ): PersistedViewportState { |
| 230 | const viewportState = state.viewportByUDID?.[udid] ?? DEFAULT_VIEWPORT_STATE; |
| 231 | if (!options.forceFit) { |
| 232 | return viewportState; |
| 233 | } |
| 234 | return { |
| 235 | ...viewportState, |
| 236 | pan: DEFAULT_VIEWPORT_STATE.pan, |
| 237 | viewMode: "fit", |
| 238 | zoom: null, |
| 239 | }; |
| 240 | } |
| 241 | |
| 242 | export function sanitizePersistedUiState( |
| 243 | state: PersistedUiState, |
no outgoing calls
no test coverage detected