mirror of
https://github.com/whoisclebs/lodash.git
synced 2026-01-29 14:37:49 +00:00
20 lines
434 B
JavaScript
20 lines
434 B
JavaScript
define([], function() {
|
|
|
|
/**
|
|
* 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 + '');
|
|
}
|
|
|
|
return baseToString;
|
|
});
|