MCPcopy
hub / github.com/autoNumeric/autoNumeric / isElement

Method isElement

src/AutoNumericHelper.js:257–267  ·  view source on GitHub ↗

* Return `true` if the parameter is a DOM element * cf. http://stackoverflow.com/a/4754104/2834898 * * @param {*} obj * @returns {boolean}

(obj)

Source from the content-addressed store, hash-verified

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>.

Callers 8

isInputElementMethod · 0.95
_setArgumentsValuesMethod · 0.80
initMethod · 0.80
formatMethod · 0.80
unformatMethod · 0.80
localizeMethod · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected