• File: _baseToNumber.js
  • Full Path: /home/awtadalkhimacom/public_html/services/node_modules/lodash/_baseToNumber.js
  • Date Modified: 10/30/2025 4:29 AM
  • File size: 539 bytes
  • MIME-type: text/plain
  • Charset: utf-8
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;