Returns true if the element is a DOM image, video, canvas, or ImageData
.
These are the same image types supported by the WebGL 1.0 Spec.
Runs in Node and the Browser.
var isDOMImage = require('is-dom-image')
if (isDOMImage(data)) {
// got an image
console.log(data.width, data.height)
}
npm install is-dom-image --save
Returns true if element
is an instance of HTMLImageElement, HTMLVideoElement, HTMLCanvasElement or ImageData. Otherwise returns false.
MIT, see LICENSE.md for details.