baseToString.js 329 B

12345678910111213
  1. /**
  2. * Converts `value` to a string if it's not one. An empty string is returned
  3. * for `null` or `undefined` values.
  4. *
  5. * @private
  6. * @param {*} value The value to process.
  7. * @returns {string} Returns the string.
  8. */
  9. function baseToString(value) {
  10. return value == null ? '' : (value + '');
  11. }
  12. module.exports = baseToString;