/
githubmirror
/
lodash
Обзор
Документация
Войти
/
githubmirror
/
lodash
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
4.18.0-amd
_createRelationalOperation.js
21 строка
612 B
John-David Dalton
Bump to v4.11.2.
21 апр 2016, 17:00
21 апр 2016, 17:00
ccdfca5
Код
Авторство
О чём код?
define(['./toNumber'], function(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); }; } return createRelationalOperation; });