MCPcopy
hub / github.com/microfeed/microfeed / urlJoinWithRelative

Function urlJoinWithRelative

common-src/StringUtils.js:129–141  ·  view source on GitHub ↗
(baseUrl, path, baseUrlForRelativePath = '/')

Source from the content-addressed store, hash-verified

127 * 2) Relative url to cdn (r2), e.g., production/something.png
128 */
129export function urlJoinWithRelative(baseUrl, path, baseUrlForRelativePath = '/') {
130 if (!path) {
131 return null;
132 }
133
134 if (path.startsWith('/')) {
135 return urlJoin(baseUrlForRelativePath, path);
136 }
137 if (baseUrl) {
138 return urlJoin(baseUrl, path);
139 }
140 return urlJoin('/', path);
141}
142
143export function buildAudioUrlWithTracking(audioUrl, trackingUrls, protocal='https') {
144 if (!audioUrl) {

Callers 9

onRequestPostFunction · 0.90
elementMethod · 0.90
_decorateForItemMethod · 0.90
onFileUploadMethod · 0.90
renderMethod · 0.90
renderMethod · 0.90
MediaUploaderFunction · 0.90

Calls 1

urlJoinFunction · 0.85

Tested by

no test coverage detected