Urara-Blog/node_modules/.pnpm-store/v3/files/1e/638c89849bcd6cec7cdf851af630a6ad7a51798aa1bc79c7c017f471d43b3c9374f9a80cfc6ca552297b063a95b282ee1824e69a04fad3a3dd3169336371a9
2022-08-14 01:14:53 +08:00

21 lines
523 B
Text

var isSymbol = require('./isSymbol');
/** Used as references for various `Number` constants. */
var INFINITY = 1 / 0;
/**
* Converts `value` to a string key if it's not a string or symbol.
*
* @private
* @param {*} value The value to inspect.
* @returns {string|symbol} Returns the key.
*/
function toKey(value) {
if (typeof value == 'string' || isSymbol(value)) {
return value;
}
var result = (value + '');
return (result == '0' && (1 / value) == -INFINITY) ? '-0' : result;
}
module.exports = toKey;