MCPcopy
hub / github.com/lodash/lodash / baseToString

Function baseToString

lodash.js:4291–4305  ·  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

4289 * @returns {string} Returns the string.
4290 */
4291 function baseToString(value) {
4292 // Exit early for strings to avoid a performance hit in some environments.
4293 if (typeof value == 'string') {
4294 return value;
4295 }
4296 if (isArray(value)) {
4297 // Recursively convert values (susceptible to call stack limits).
4298 return arrayMap(value, baseToString) + '';
4299 }
4300 if (isSymbol(value)) {
4301 return symbolToString ? symbolToString.call(value) : '';
4302 }
4303 var result = (value + '');
4304 return (result == '0' && (1 / value) == -INFINITY) ? '-0' : result;
4305 }
4306
4307 /**
4308 * The base implementation of `_.uniqBy` without support for iteratee shorthands.

Callers 10

createMathOperationFunction · 0.85
createPaddingFunction · 0.85
toStringFunction · 0.85
endsWithFunction · 0.85
splitFunction · 0.85
startsWithFunction · 0.85
trimFunction · 0.85
trimEndFunction · 0.85
trimStartFunction · 0.85
truncateFunction · 0.85

Calls 2

arrayMapFunction · 0.85
isSymbolFunction · 0.85

Tested by

no test coverage detected