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

Function baseToString

src/helpers/get.js:507–517  ·  view source on GitHub ↗

* The base implementation of `_.toString` which doesn't convert nullish * values to empty strings. * * @private * @param {*} value The value to process. * @returns {string} Returns the string.

(value)

Source from the content-addressed store, hash-verified

505 * @returns {string} Returns the string.
506 */
507function baseToString(value) {
508 // Exit early for strings to avoid a performance hit in some environments.
509 if (typeof value == 'string') {
510 return value;
511 }
512 if (isSymbol(value)) {
513 return symbolToString ? symbolToString.call(value) : '';
514 }
515 const result = value + '';
516 return result == '0' && 1 / value == -INFINITY ? '-0' : result;
517}
518
519/**
520 * Casts `value` to a path array if it's not one.

Callers 1

toStringFunction · 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…