Adding webp to regex list. Added function return type for consistency with the rest of the functions (#7649)
This commit is contained in:
@@ -8,8 +8,8 @@ export function getDataUriSize(uri: string): number {
|
|||||||
return Math.round((uri.length * 3) / 4)
|
return Math.round((uri.length * 3) / 4)
|
||||||
}
|
}
|
||||||
|
|
||||||
export function isUriImage(uri: string) {
|
export function isUriImage(uri: string): boolean {
|
||||||
return /\.(jpg|jpeg|png).*$/.test(uri)
|
return /\.(jpg|jpeg|png|webp).*$/.test(uri)
|
||||||
}
|
}
|
||||||
|
|
||||||
export function blobToDataUri(blob: Blob): Promise<string> {
|
export function blobToDataUri(blob: Blob): Promise<string> {
|
||||||
|
|||||||
Reference in New Issue
Block a user