Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
static resolveUrls(theme: Theme): Theme {
// Ensure that all resources referenced in theme by relative URLs are in fact relative to
// theme.
if (theme.url === undefined) {
return theme;
}
const childUrlResolver = composeUrlResolvers(
(childUrl: string) => resolveReferenceUrl(theme.url, childUrl),
defaultUrlResolver
);
if (theme.extends) {
if (typeof theme.extends === "string") {
theme.extends = childUrlResolver(theme.extends);
} else {
if (theme.extends.url === undefined) {
theme.extends.url = theme.url;
theme.extends = this.resolveUrls(theme.extends);
}
}
}
if (theme.sky && theme.sky.type === "cubemap") {