UNPKG

link-exists

Version:

A super lightweight JavaScript / TypeScript library to check whether a given url is valid and exists or not.

16 lines (15 loc) 474 B
/** * Format a string url with URL class * * @param url url to be reformed * @param includeProtocol validate url with or without protocol * @returns {URL | null} URL formatted object */ export declare function reformUrl(url: string, includeProtocol?: boolean): URL | null; /** * validates a url using javascript regex * * @param url url to validate * @returns true / false whether a given url is valid */ export declare function isValidUrl(url: string): boolean;