(list: Item[], exts: string[])
| 99 | } |
| 100 | |
| 101 | function pick(list: Item[], exts: string[]) { |
| 102 | for (const ext of exts) { |
| 103 | const found = list.find((item) => item.url.split("?")[0]?.toLowerCase().endsWith(ext)) |
| 104 | if (found) return found.url |
| 105 | } |
| 106 | } |
| 107 | |
| 108 | function link(raw: string) { |
| 109 | if (raw.startsWith("https://") || raw.startsWith("http://")) return raw |
no test coverage detected