MCPcopy Index your code
hub / github.com/reactnativecn/react-native-update / joinUrls

Function joinUrls

src/utils.ts:74–85  ·  view source on GitHub ↗
(paths: string[], fileName?: string)

Source from the content-addressed store, hash-verified

72 };
73
74export 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
87export const testUrls = async (urls?: string[]) => {
88 if (!urls?.length) {

Callers 2

PushyClass · 0.90
utils.test.tsFile · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected