mirror of
https://github.com/whoisclebs/lodash.git
synced 2026-02-06 09:47:48 +00:00
Bump to v4.1.0.
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
# lodash.subtract v4.0.2
|
||||
# lodash.subtract v4.1.0
|
||||
|
||||
The [lodash](https://lodash.com/) method `_.subtract` exported as a [Node.js](https://nodejs.org/) module.
|
||||
|
||||
@@ -15,4 +15,4 @@ In Node.js:
|
||||
var subtract = require('lodash.subtract');
|
||||
```
|
||||
|
||||
See the [documentation](https://lodash.com/docs#subtract) or [package source](https://github.com/lodash/lodash/blob/4.0.2-npm-packages/lodash.subtract) for more details.
|
||||
See the [documentation](https://lodash.com/docs#subtract) or [package source](https://github.com/lodash/lodash/blob/4.1.0-npm-packages/lodash.subtract) for more details.
|
||||
|
||||
@@ -1,11 +1,13 @@
|
||||
/**
|
||||
* lodash 4.0.2 (Custom Build) <https://lodash.com/>
|
||||
* lodash (Custom Build) <https://lodash.com/>
|
||||
* Build: `lodash modularize exports="npm" -o ./`
|
||||
* Copyright jQuery Foundation and other contributors <https://jquery.org/>
|
||||
* Released under MIT license <https://lodash.com/license>
|
||||
* Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE>
|
||||
* Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
|
||||
*/
|
||||
var baseToNumber = require('lodash._basetonumber'),
|
||||
baseToString = require('lodash._basetostring');
|
||||
|
||||
/**
|
||||
* Creates a function that performs a mathematical operation on two values.
|
||||
@@ -24,7 +26,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;
|
||||
};
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "lodash.subtract",
|
||||
"version": "4.0.2",
|
||||
"version": "4.1.0",
|
||||
"description": "The lodash method `_.subtract` exported as a module.",
|
||||
"homepage": "https://lodash.com/",
|
||||
"icon": "https://lodash.com/icon.svg",
|
||||
@@ -13,5 +13,9 @@
|
||||
"Mathias Bynens <mathias@qiwi.be> (https://mathiasbynens.be/)"
|
||||
],
|
||||
"repository": "lodash/lodash",
|
||||
"scripts": { "test": "echo \"See https://travis-ci.org/lodash/lodash-cli for testing details.\"" }
|
||||
"scripts": { "test": "echo \"See https://travis-ci.org/lodash/lodash-cli for testing details.\"" },
|
||||
"dependencies": {
|
||||
"lodash._basetonumber": "~4.12.0",
|
||||
"lodash._basetostring": "~4.12.0"
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user