Files
lodash/internal/baseToString.js
2015-05-19 08:43:25 -07:00

17 lines
383 B
JavaScript

/**
* Converts `value` to a string if it's not one. An empty string is returned
* for `null` or `undefined` values.
*
* @private
* @param {*} value The value to process.
* @returns {string} Returns the string.
*/
function baseToString(value) {
if (typeof value == 'string') {
return value;
}
return value == null ? '' : (value + '');
}
export default baseToString;