mirror of
https://github.com/nodejs/node.git
synced 2025-08-17 22:58:52 +02:00

PR-URL: https://github.com/nodejs/io.js/pull/2286 Reviewed-By: Roman Reiss <me@silverwind.io>
13 lines
329 B
JavaScript
13 lines
329 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) {
|
|
return value == null ? '' : (value + '');
|
|
}
|
|
|
|
module.exports = baseToString;
|