(url: string, test: (u: string) => boolean)
| 15 | export const MATCH_URL_TIKTOK = /tiktok\.com\/(?:player\/v1\/|share\/video\/|@[^/]+\/video\/)([0-9]+)/; |
| 16 | |
| 17 | const canPlayFile = (url: string, test: (u: string) => boolean) => { |
| 18 | if (Array.isArray(url)) { |
| 19 | for (const item of url) { |
| 20 | if (typeof item === 'string' && canPlayFile(item, test)) { |
| 21 | return true; |
| 22 | } |
| 23 | if (canPlayFile(item.src, test)) { |
| 24 | return true; |
| 25 | } |
| 26 | } |
| 27 | return false; |
| 28 | } |
| 29 | return test(url); |
| 30 | }; |
| 31 | |
| 32 | export const canPlay = { |
| 33 | html: (url: string) => |
no test coverage detected
searching dependent graphs…