safe-open
Version:
A small utility to safely open URLs, upgrading http to https when necessary.
12 lines (10 loc) • 464 B
TypeScript
/**
* Safely opens a URL in a new window, automatically upgrading http to https if needed.
*
* @param {string} url - The URL to open.
* @param {string} [target='_blank'] - The target window (e.g., '_blank', '_self').
* @param {string} [features] - Optional features for window.open.
* @returns A WindowProxy object or null.
*/
declare function safeOpen(url?: string, target?: string, features?: string): WindowProxy | null;
export { safeOpen as default };