* 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.
(value)
| 10326 | * @returns {string|symbol} Returns the key. |
| 10327 | */ |
| 10328 | function toKey(value) { |
| 10329 | if (typeof value == 'string' || isSymbol(value)) { |
| 10330 | return value; |
| 10331 | } |
| 10332 | var result = value + ''; |
| 10333 | return result == '0' && 1 / value == -INFINITY ? '-0' : result; |
| 10334 | } |
| 10335 | |
| 10336 | module.exports = toKey; |
| 10337 |
no test coverage detected