(url: string)
| 11 | }; |
| 12 | |
| 13 | const getExtension = (url: string): string => { |
| 14 | // Drop query/hash before reading the extension so cloudinary transform |
| 15 | // params (e.g. `?_a=...`) don't hide it. |
| 16 | const path = url.split(/[?#]/, 1)[0]; |
| 17 | const lastDot = path.lastIndexOf('.'); |
| 18 | return lastDot === -1 ? '' : path.slice(lastDot + 1).toLowerCase(); |
| 19 | }; |
| 20 | |
| 21 | /** |
| 22 | * Detects whether a markdown media URL points to a video file, so `` |
no outgoing calls
no test coverage detected