You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

19 lines
501 B

4 years ago
  1. var Set = require('./_Set'),
  2. noop = require('./noop'),
  3. setToArray = require('./_setToArray');
  4. /** Used as references for various `Number` constants. */
  5. var INFINITY = 1 / 0;
  6. /**
  7. * Creates a set object of `values`.
  8. *
  9. * @private
  10. * @param {Array} values The values to add to the set.
  11. * @returns {Object} Returns the new set.
  12. */
  13. var createSet = !(Set && (1 / setToArray(new Set([,-0]))[1]) == INFINITY) ? noop : function(values) {
  14. return new Set(values);
  15. };
  16. module.exports = createSet;