@automattic/calypso-url
Version:
This library provides both generic and Calypso-specific utilities for handling URLs.
15 lines • 618 B
TypeScript
/**
* Generate a safe version of the provided URL
*
* Images that Calypso uses have to be provided by a trusted TLS host. To do
* this, we check the host of the URL against a list of allowed hosts, and run the image
* through photon if the host name does not match.
*
* NOTE: This function will return `null` for external URLs with query strings,
* because Photon itself does not support this!
*
* @param url The URL to secure
* @returns The secured URL, or `null` if we couldn't make it safe
*/
export declare function safeImageUrl(url?: string | null): string | null;
//# sourceMappingURL=index.d.ts.map