isSet.js 325 B

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