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

Function baseToString

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

28095 * @returns {string} Returns the string.
28096 */
28097 function baseToString(value) {
28098 // Exit early for strings to avoid a performance hit in some environments.
28099 if (typeof value == 'string') {
28100 return value;
28101 }
28102 if (isArray(value)) {
28103 // Recursively convert values (susceptible to call stack limits).
28104 return arrayMap(value, baseToString) + '';
28105 }
28106 if (isSymbol(value)) {
28107 return symbolToString ? symbolToString.call(value) : '';
28108 }
28109 var result = value + '';
28110 return result == '0' && 1 / value == -INFINITY ? '-0' : result;
28111 }
28112
28113 module.exports = baseToString;
28114

Callers 2

toStringFunction · 0.85
startsWithFunction · 0.85

Calls 3

isArrayFunction · 0.85
arrayMapFunction · 0.85
isSymbolFunction · 0.70

Tested by

no test coverage detected