isWeakSet.js 353 B

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