Cleanup
This commit is contained in:
@ -15,15 +15,7 @@ export function plural(count: number, singular: string): string {
|
||||
}
|
||||
|
||||
export function canUseWebP(): boolean {
|
||||
let canvas = document.createElement("canvas")
|
||||
|
||||
if(!!(canvas.getContext && canvas.getContext("2d"))) {
|
||||
// WebP representation possible
|
||||
return canvas.toDataURL("image/webp").indexOf("data:image/webp") === 0
|
||||
} else {
|
||||
// In very old browsers (IE 8) canvas is not supported
|
||||
return false
|
||||
}
|
||||
return document.createElement("canvas").toDataURL("image/webp").indexOf("data:image/webp") === 0
|
||||
}
|
||||
|
||||
export function swapElements(a: Node, b: Node) {
|
||||
|
Reference in New Issue
Block a user