MCPcopy
hub / github.com/lodash/lodash / toKey

Function toKey

lodash.js:6848–6854  ·  view source on GitHub ↗

* 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)

Source from the content-addressed store, hash-verified

6846 * @returns {string|symbol} Returns the key.
6847 */
6848 function toKey(value) {
6849 if (typeof value == 'string' || isSymbol(value)) {
6850 return value;
6851 }
6852 var result = (value + '');
6853 return (result == '0' && (1 / value) == -INFINITY) ? '-0' : result;
6854 }
6855
6856 /**
6857 * Converts `func` to its source code.

Callers 9

baseGetFunction · 0.85
baseInvokeFunction · 0.85
baseMatchesPropertyFunction · 0.85
baseSetFunction · 0.85
baseUnsetFunction · 0.85
hasPathFunction · 0.85
resultFunction · 0.85
lodash.jsFile · 0.85
propertyFunction · 0.85

Calls 1

isSymbolFunction · 0.85

Tested by

no test coverage detected