Sha256: e2431c68f36dfdd1e83457d35e9b33ef46c2add926f02f67c598ef9c5c9c1c20

Contents?: true

Size: 934 Bytes

Versions: 26

Compression:

Stored size: 934 Bytes

Contents

var Symbol = require('./_Symbol'),
    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 (isSymbol(value)) {
    return symbolToString ? symbolToString.call(value) : '';
  }
  var result = (value + '');
  return (result == '0' && (1 / value) == -INFINITY) ? '-0' : result;
}

module.exports = baseToString;

Version data entries

26 entries across 5 versions & 3 rubygems

Version Path
minimum_viable_product-0.0.11 test/dummy/node_modules/lodash/_baseToString.js
babel-schmooze-sprockets-0.1.3 node_modules/lodash/_baseToString.js
blackboard-3.1.9 lib/site_template/node_modules/sass-graph/node_modules/lodash/_baseToString.js
babel-schmooze-sprockets-0.1.2 node_modules/lodash/_baseToString.js
babel-schmooze-sprockets-0.1.1 node_modules/babel-helper-function-name/node_modules/lodash/_baseToString.js
babel-schmooze-sprockets-0.1.1 node_modules/babel-helper-get-function-arity/node_modules/lodash/_baseToString.js
babel-schmooze-sprockets-0.1.1 node_modules/babel-helper-hoist-variables/node_modules/lodash/_baseToString.js
babel-schmooze-sprockets-0.1.1 node_modules/babel-helper-optimise-call-expression/node_modules/lodash/_baseToString.js
babel-schmooze-sprockets-0.1.1 node_modules/babel-helper-regex/node_modules/lodash/_baseToString.js
babel-schmooze-sprockets-0.1.1 node_modules/babel-helper-replace-supers/node_modules/lodash/_baseToString.js
babel-schmooze-sprockets-0.1.1 node_modules/babel-plugin-transform-es2015-block-scoping/node_modules/lodash/_baseToString.js
babel-schmooze-sprockets-0.1.1 node_modules/babel-plugin-transform-es2015-classes/node_modules/lodash/_baseToString.js
babel-schmooze-sprockets-0.1.1 node_modules/babel-plugin-transform-es2015-duplicate-keys/node_modules/lodash/_baseToString.js
babel-schmooze-sprockets-0.1.1 node_modules/babel-core/node_modules/lodash/_baseToString.js
babel-schmooze-sprockets-0.1.1 node_modules/babel-plugin-transform-es2015-modules-commonjs/node_modules/lodash/_baseToString.js
babel-schmooze-sprockets-0.1.1 node_modules/babel-plugin-transform-es2015-parameters/node_modules/lodash/_baseToString.js
babel-schmooze-sprockets-0.1.1 node_modules/babel-plugin-transform-es2015-shorthand-properties/node_modules/lodash/_baseToString.js
babel-schmooze-sprockets-0.1.1 node_modules/babel-plugin-transform-es2015-sticky-regex/node_modules/lodash/_baseToString.js
babel-schmooze-sprockets-0.1.1 node_modules/babel-plugin-transform-regenerator/node_modules/lodash/_baseToString.js
babel-schmooze-sprockets-0.1.1 node_modules/babel-plugin-transform-strict-mode/node_modules/lodash/_baseToString.js