MCPcopy Create free account
hub / github.com/Lemoncode/fonk / toKey

Function toKey

src/helpers/get.js:642–648  ·  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

640 * @returns {string|symbol} Returns the key.
641 */
642function toKey(value) {
643 if (typeof value == 'string' || isSymbol(value)) {
644 return value;
645 }
646 const result = value + '';
647 return result == '0' && 1 / value == -INFINITY ? '-0' : result;
648}
649
650/**
651 * Converts `func` to its source code.

Callers 1

baseGetFunction · 0.70

Calls 1

isSymbolFunction · 0.70

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…