* 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)
| 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 |
no test coverage detected