Sha256: 48470af278354e767e87281c02e5f7792a99281d1345885d3e282dae0322c5c6

Contents?: true

Size: 539 Bytes

Versions: 291

Compression:

Stored size: 539 Bytes

Contents

var isSymbol = require('./isSymbol');

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

/**
 * The base implementation of `_.toNumber` which doesn't ensure correct
 * conversions of binary, hexadecimal, or octal string values.
 *
 * @private
 * @param {*} value The value to process.
 * @returns {number} Returns the number.
 */
function baseToNumber(value) {
  if (typeof value == 'number') {
    return value;
  }
  if (isSymbol(value)) {
    return NAN;
  }
  return +value;
}

module.exports = baseToNumber;

Version data entries

291 entries across 268 versions & 32 rubygems

Version Path
govuk_publishing_components-17.15.0 node_modules/lodash/_baseToNumber.js
govuk_publishing_components-17.14.0 node_modules/lodash/_baseToNumber.js
govuk_publishing_components-17.13.0 node_modules/lodash/_baseToNumber.js
govuk_publishing_components-17.12.2 node_modules/lodash/_baseToNumber.js
govuk_publishing_components-17.12.1 node_modules/lodash/_baseToNumber.js
govuk_publishing_components-17.12.0 node_modules/lodash/_baseToNumber.js
govuk_publishing_components-17.11.0 node_modules/lodash/_baseToNumber.js
govuk_publishing_components-17.10.0 node_modules/lodash/_baseToNumber.js
govuk_publishing_components-17.9.0 node_modules/lodash/_baseToNumber.js
govuk_publishing_components-17.8.0 node_modules/lodash/_baseToNumber.js
govuk_publishing_components-17.7.0 node_modules/lodash/_baseToNumber.js
govuk_publishing_components-17.6.1 node_modules/lodash/_baseToNumber.js
govuk_publishing_components-17.6.0 node_modules/lodash/_baseToNumber.js
govuk_publishing_components-17.5.0 node_modules/lodash/_baseToNumber.js
govuk_publishing_components-17.4.0 node_modules/lodash/_baseToNumber.js
govuk_publishing_components-17.3.0 node_modules/lodash/_baseToNumber.js
govuk_publishing_components-17.2.0 node_modules/lodash/_baseToNumber.js
govuk_publishing_components-17.1.1 node_modules/lodash/_baseToNumber.js
govuk_publishing_components-17.1.0 node_modules/lodash/_baseToNumber.js
govuk_publishing_components-17.0.0 node_modules/lodash/_baseToNumber.js