MCPcopy Index your code
hub / github.com/cookpete/react-player / canPlayFile

Function canPlayFile

src/patterns.ts:17–30  ·  view source on GitHub ↗
(url: string, test: (u: string) => boolean)

Source from the content-addressed store, hash-verified

15export const MATCH_URL_TIKTOK = /tiktok\.com\/(?:player\/v1\/|share\/video\/|@[^/]+\/video\/)([0-9]+)/;
16
17const 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
32export const canPlay = {
33 html: (url: string) =>

Callers 1

patterns.tsFile · 0.85

Calls 1

testFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…