'use strict';

Object.defineProperty(exports, '__esModule', { value: true });

var _Symbol = require('./_Symbol.js');
var _arrayMap = require('./_arrayMap.js');
var isArray = require('./isArray.js');
var isSymbol = require('./isSymbol.js');

/** Used to convert symbols to primitives and strings. */
var symbolProto = _Symbol.default ? _Symbol.default.prototype : undefined,
    symbolToString = symbolProto ? symbolProto.toString : undefined;

/**
 * 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.
 */
function baseToString(value) {
  // Exit early for strings to avoid a performance hit in some environments.
  if (typeof value == 'string') {
    return value;
  }
  if (isArray.default(value)) {
    // Recursively convert values (susceptible to call stack limits).
    return _arrayMap.default(value, baseToString) + '';
  }
  if (isSymbol.default(value)) {
    return symbolToString ? symbolToString.call(value) : '';
  }
  var result = (value + '');
  return (result == '0' && (1 / value) == -Infinity) ? '-0' : result;
}

exports.default = baseToString;
