Sha256: 02703516b1d594c96987c84f7d016411d0ed7825bec23280fb974e86db178fc8

Contents?: true

Size: 1.13 KB

Versions: 264

Compression:

Stored size: 1.13 KB

Contents

var Symbol = require('./_Symbol'),
    arrayMap = require('./_arrayMap'),
    isArray = require('./isArray'),
    isSymbol = require('./isSymbol');

/** Used as references for various `Number` constants. */
var INFINITY = 1 / 0;

/** Used to convert symbols to primitives and strings. */
var symbolProto = Symbol ? Symbol.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(value)) {
    // Recursively convert values (susceptible to call stack limits).
    return arrayMap(value, baseToString) + '';
  }
  if (isSymbol(value)) {
    return symbolToString ? symbolToString.call(value) : '';
  }
  var result = (value + '');
  return (result == '0' && (1 / value) == -INFINITY) ? '-0' : result;
}

module.exports = baseToString;

Version data entries

264 entries across 262 versions & 29 rubygems

Version Path
clapton-0.0.12 lib/clapton/javascripts/node_modules/lodash/_baseToString.js
clapton-0.0.11 lib/clapton/javascripts/node_modules/lodash/_baseToString.js
clapton-0.0.10 lib/clapton/javascripts/node_modules/lodash/_baseToString.js
clapton-0.0.9 lib/clapton/javascripts/node_modules/lodash/_baseToString.js
clapton-0.0.8 lib/clapton/javascripts/node_modules/lodash/_baseToString.js
clapton-0.0.7 lib/clapton/javascripts/node_modules/lodash/_baseToString.js
clapton-0.0.6 lib/clapton/javascripts/node_modules/lodash/_baseToString.js
clapton-0.0.5 lib/clapton/javascripts/node_modules/lodash/_baseToString.js
clapton-0.0.4 lib/clapton/javascripts/node_modules/lodash/_baseToString.js
clapton-0.0.3 lib/clapton/javascripts/node_modules/lodash/_baseToString.js
clapton-0.0.2 lib/clapton/javascripts/node_modules/lodash/_baseToString.js
clapton-0.0.1 lib/clapton/javascripts/node_modules/lodash/_baseToString.js
immosquare-cleaner-0.1.47 node_modules/lodash/_baseToString.js
immosquare-cleaner-0.1.46 node_modules/lodash/_baseToString.js
immosquare-cleaner-0.1.45 node_modules/lodash/_baseToString.js
immosquare-cleaner-0.1.44 node_modules/lodash/_baseToString.js
boring_generators-0.14.0 tmp/templates/app_template/node_modules/lodash/_baseToString.js
immosquare-cleaner-0.1.43 node_modules/lodash/_baseToString.js
immosquare-cleaner-0.1.42 node_modules/lodash/_baseToString.js
immosquare-cleaner-0.1.41 node_modules/lodash/_baseToString.js