Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
normalizeLink(documentUri: URI, link: string): string {
try {
if (!this.urlScheme.test(link)) {
const location = documentUri.parent.resolve(link).path.toString();
return new MiniBrowserEndpoint().getRestUrl().resolve(location).toString();
}
} catch {
// ignore
}
return link;
}
}