(baseUrl, path, baseUrlForRelativePath = '/')
| 127 | * 2) Relative url to cdn (r2), e.g., production/something.png |
| 128 | */ |
| 129 | export 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 | |
| 143 | export function buildAudioUrlWithTracking(audioUrl, trackingUrls, protocal='https') { |
| 144 | if (!audioUrl) { |
no test coverage detected