hd-utils
Version:
A handy utils for modern JS developers
8 lines (7 loc) • 409 B
TypeScript
/**
* @description will validate the passed image url, it will make a fetch call to the passed url,
* and check if it returns a valid image or not.
* @example validateImageURLAsync("valid-image-url").then(v => console.log(v)) // true
* @example validateImageURLAsync("invalid-image-url").then(v => console.log(v)) // false
*/
export default function validateImageURLAsync(url: string): Promise<boolean>;