Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
export function resolveBundledResourceUrl(url: string) {
if (url.startsWith(HARP_GL_BUNDLED_ASSETS_PREFIX)) {
const bundleSriptUrl = getBundleScriptUrl();
if (bundleSriptUrl === null || bundleSriptUrl === undefined) {
throw new Error(
`harp.js: cannot resolve ${url} because 'harp.gl' base url is not set.`
);
} else {
url = url.substring(HARP_GL_BUNDLED_ASSETS_PREFIX.length);
if (url.startsWith("/")) {
url = url.substring(1);
}
return baseUrl(bundleSriptUrl) + url;
}
}
return url;
}