vanillajs-browser-helpers
Version:
Collection of convenience code snippets (helpers) that aims to make it a little easier to work with vanilla JS in the browser
15 lines (14 loc) • 486 B
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
/**
* Is the given object a viable event target (implements the addEventListener function)
*
* @param obj - The object to check
* @return Is it an Event Target or not
*/
exports.default = (function (obj) {
return !!obj
&& typeof obj.addEventListener === 'function'
&& typeof obj.removeEventListener === 'function'
&& typeof obj.dispatchEvent === 'function';
});