@automattic/calypso-url
Version:
This library provides both generic and Calypso-specific utilities for handling URLs.
11 lines • 542 B
TypeScript
import { URL_TYPE } from './url-type';
/**
* Format a URL as a particular type.
* Does not support formatting invalid or path-relative URLs.
*
* @param url The URL to format.
* @param urlType The URL type into which to format. If not provided, defaults to the same type as `url`, which effectively results in the URL being normalized.
* @returns The formatted URL.
*/
export default function format(url: string | URL, urlType?: Exclude<URL_TYPE, URL_TYPE.INVALID | URL_TYPE.PATH_RELATIVE>): string;
//# sourceMappingURL=format.d.ts.map