(paths: string[], fileName?: string)
| 72 | }; |
| 73 | |
| 74 | export function joinUrls(paths: string[], fileName?: string) { |
| 75 | if (fileName) { |
| 76 | return paths.map(path => { |
| 77 | const normalizedPath = path.replace(/\/+$/, ''); |
| 78 | // Keep explicit http(s) URLs for local/self-hosted update sources. |
| 79 | const baseUrl = /^[a-z][a-z0-9+.-]*:\/\//i.test(normalizedPath) |
| 80 | ? normalizedPath |
| 81 | : `https://${normalizedPath}`; |
| 82 | return `${baseUrl}/${fileName}`; |
| 83 | }); |
| 84 | } |
| 85 | } |
| 86 | |
| 87 | export const testUrls = async (urls?: string[]) => { |
| 88 | if (!urls?.length) { |
no outgoing calls
no test coverage detected