00001 var toNumber = require('./toNumber'); 00002 00010 function createRelationalOperation(operator) { 00011 return function(value, other) { 00012 if (!(typeof value == 'string' && typeof other == 'string')) { 00013 value = toNumber(value); 00014 other = toNumber(other); 00015 } 00016 return operator(value, other); 00017 }; 00018 } 00019 00020 module.exports = createRelationalOperation;