Commit 96e9cf59 authored by Alejandro Celaya's avatar Alejandro Celaya Committed by Alejandro Celaya

Migrate url module to TS

parent 725f2c09
......@@ -3,11 +3,13 @@
*
* This makes it absolute and strips the fragment identifier.
*
* @param {string} uri - Relative or absolute URL
* @param {string} [base] - Base URL to resolve relative to. Defaults to
* the document's base URL.
* @param uri - Relative or absolute URL
* @param base - Base URL to resolve relative to. Defaults to the document's base URL.
*/
export function normalizeURI(uri, base = document.baseURI) {
export function normalizeURI(
uri: string,
base: string = document.baseURI
): string {
const absUrl = new URL(uri, base).href;
// Remove the fragment identifier.
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment