isElement.js 297 B

1234567891011121314
  1. var isString = require('./isString')
  2. var isNumber = require('./isNumber')
  3. /**
  4. * 判断是否Element对象
  5. *
  6. * @param {Object} obj 对象
  7. * @return {Boolean}
  8. */
  9. function isElement (obj) {
  10. return !!(obj && isString(obj.nodeName) && isNumber(obj.nodeType))
  11. }
  12. module.exports = isElement