@woosh/meep-engine
Version:
Pure JavaScript game engine. Fully featured and production ready.
12 lines • 386 B
JavaScript
/**
* Guards against cases where ImageBitmap doesn't exist
* @param {*} image
* @return {boolean}
*/
export function isImageBitmap(image) {
/**
* check that browser/environment has the class at all to avoid potential exceptions
* Required for Safari below version 15.6
*/
return typeof ImageBitmap !== 'undefined' && image instanceof ImageBitmap;
}