File "_createRelationalOperation.js"
Full path: /home/ulinin/public_html/ttt.ulinin.com/node_modules/lodash/_createRelationalOperation.js
File
size: 0.56 KB (578 B bytes)
MIME-type: text/plain
Charset: utf-8
Download Open Edit Advanced Editor Back
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;