OptionalimageSource: string | nullThe image URL or local file path to extract the extension from
The list of allowed extensions (with leading dot, e.g. ['.jpg', '.png']). Defaults to ['.jpg', '.jpeg', '.png', '.gif', '.webp', '.bmp', '.heic', '.heif']
The fallback extension with leading dot (defaults to '.jpg')
the extracted extension if allowed, otherwise the fallback extension
Extracts the file extension from an image source (URL or local file path) and returns it if allowed, otherwise returns the fallback