Repositorio del curso CCOM4030 el semestre B91 del proyecto Artesanías con el Instituto de Cultura

123456789101112131415161718192021
  1. var isSymbol = require('./isSymbol');
  2. /** Used as references for various `Number` constants. */
  3. var INFINITY = 1 / 0;
  4. /**
  5. * Converts `value` to a string key if it's not a string or symbol.
  6. *
  7. * @private
  8. * @param {*} value The value to inspect.
  9. * @returns {string|symbol} Returns the key.
  10. */
  11. function toKey(value) {
  12. if (typeof value == 'string' || isSymbol(value)) {
  13. return value;
  14. }
  15. var result = (value + '');
  16. return (result == '0' && (1 / value) == -INFINITY) ? '-0' : result;
  17. }
  18. module.exports = toKey;