All Downloads are FREE. Search and download functionalities are using the official Maven repository.

node_modules.lodash._createRelationalOperation.js Maven / Gradle / Ivy

There is a newer version: 3.3.1
Show newest version
var toNumber = require('./toNumber');

/**
 * Creates a function that performs a relational operation on two values.
 *
 * @private
 * @param {Function} operator The function to perform the operation.
 * @returns {Function} Returns the new relational operation function.
 */
function createRelationalOperation(operator) {
  return function(value, other) {
    if (!(typeof value == 'string' && typeof other == 'string')) {
      value = toNumber(value);
      other = toNumber(other);
    }
    return operator(value, other);
  };
}

module.exports = createRelationalOperation;




© 2015 - 2025 Weber Informatics LLC | Privacy Policy