(event: unknown)
| 192 | } |
| 193 | |
| 194 | function tryGetContentOffset(event: unknown): Point | null { |
| 195 | try { |
| 196 | // @ts-expect-error: try to extract contentOffset from the event value |
| 197 | const contentOffset = event?.nativeEvent?.contentOffset; |
| 198 | const x = contentOffset?.x; |
| 199 | const y = contentOffset?.y; |
| 200 | |
| 201 | if (typeof x === 'number' || typeof y === 'number') { |
| 202 | return { |
| 203 | x: Number.isFinite(x) ? x : 0, |
| 204 | y: Number.isFinite(y) ? y : 0, |
| 205 | }; |
| 206 | } |
| 207 | } catch { |
| 208 | // Do nothing |
| 209 | } |
| 210 | |
| 211 | return null; |
| 212 | } |
| 213 | |
| 214 | function mergeEventProps(target: Record<string, unknown>, source: Record<string, unknown>) { |
| 215 | for (const key of Object.keys(source)) { |
no outgoing calls
no test coverage detected
searching dependent graphs…