isMap.js 325 B

123456789101112131415
  1. /* eslint-disable valid-typeof */
  2. var staticStrUndefined = require('./staticStrUndefined')
  3. /**
  4. * 判断是否Map对象
  5. *
  6. * @param {Object} obj 对象
  7. * @return {Boolean}
  8. */
  9. var supportMap = typeof Map !== staticStrUndefined
  10. function isMap (obj) {
  11. return supportMap && obj instanceof Map
  12. }
  13. module.exports = isMap