MCPcopy Create free account
hub / github.com/RubyLouvre/anu / toKey

Function toKey

test/babel.js:10328–10334  ·  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

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

Callers 4

baseGetFunction · 0.85
hasPathFunction · 0.85
baseMatchesPropertyFunction · 0.85
propertyFunction · 0.85

Calls 1

isSymbolFunction · 0.70

Tested by

no test coverage detected