Bump to v4.11.2.

This commit is contained in:
John-David Dalton
2016-04-19 22:00:04 -07:00
parent e93cb815c3
commit ddde027fd9
89 changed files with 1020 additions and 726 deletions

View File

@@ -1,3 +1,6 @@
var baseToNumber = require('./_baseToNumber'),
baseToString = require('./_baseToString');
/**
* Creates a function that performs a mathematical operation on two values.
*
@@ -15,7 +18,17 @@ function createMathOperation(operator) {
result = value;
}
if (other !== undefined) {
result = result === undefined ? other : operator(result, other);
if (result === undefined) {
return other;
}
if (typeof value == 'string' || typeof other == 'string') {
value = baseToString(value);
other = baseToString(other);
} else {
value = baseToNumber(value);
other = baseToNumber(other);
}
result = operator(value, other);
}
return result;
};