* Return `true` if the parameter is a DOM element * cf. http://stackoverflow.com/a/4754104/2834898 * * @param {*} obj * @returns {boolean}
(obj)
| 255 | * @returns {boolean} |
| 256 | */ |
| 257 | static isElement(obj) { |
| 258 | // return !!(obj && obj.nodeName); |
| 259 | // return obj && 'nodeType' in obj; |
| 260 | // return obj instanceof Element || obj instanceof HTMLInputElement || obj instanceof HTMLElement; |
| 261 | if (typeof Element === 'undefined') { |
| 262 | // This test is needed in environnements where the Element object does not exist (ie. in web workers) |
| 263 | return false; |
| 264 | } |
| 265 | |
| 266 | return obj instanceof Element; |
| 267 | } |
| 268 | |
| 269 | /** |
| 270 | * Return `true` in the given DOM element is an <input>. |
no outgoing calls
no test coverage detected