您最多选择25个主题 主题必须以字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符

isWeakSet.js 643B

12345678910111213141516171819202122232425262728
  1. var baseGetTag = require('./_baseGetTag'),
  2. isObjectLike = require('./isObjectLike');
  3. /** `Object#toString` result references. */
  4. var weakSetTag = '[object WeakSet]';
  5. /**
  6. * Checks if `value` is classified as a `WeakSet` object.
  7. *
  8. * @static
  9. * @memberOf _
  10. * @since 4.3.0
  11. * @category Lang
  12. * @param {*} value The value to check.
  13. * @returns {boolean} Returns `true` if `value` is a weak set, else `false`.
  14. * @example
  15. *
  16. * _.isWeakSet(new WeakSet);
  17. * // => true
  18. *
  19. * _.isWeakSet(new Set);
  20. * // => false
  21. */
  22. function isWeakSet(value) {
  23. return isObjectLike(value) && baseGetTag(value) == weakSetTag;
  24. }
  25. module.exports = isWeakSet;