( size: string, )
| 312 | * Format: "aspectRatio_resolution" e.g. "16:9_4K" → { aspectRatio: "16:9", resolution: "4K" } |
| 313 | */ |
| 314 | export function parseNativeImageSize( |
| 315 | size: string, |
| 316 | ): { aspectRatio: string; resolution: string } | undefined { |
| 317 | const match = size.match(/^(\d+:\d+)_(.+)$/) |
| 318 | const [, aspectRatio, resolution] = match ?? [] |
| 319 | if (aspectRatio === undefined || resolution === undefined) return undefined |
| 320 | return { aspectRatio, resolution } |
| 321 | } |
no outgoing calls
no test coverage detected