mirror of
https://github.com/whoisclebs/lodash.git
synced 2026-02-06 09:47:48 +00:00
Compare commits
9 Commits
3.4.2-npm-
...
3.6.2-npm-
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
bbc20f983e | ||
|
|
4ed2b24773 | ||
|
|
f1a2ea44f0 | ||
|
|
dbf44fcc0b | ||
|
|
ee29e79294 | ||
|
|
9f7937cb84 | ||
|
|
a9ec8d953c | ||
|
|
5afdc7b263 | ||
|
|
5047ef35e0 |
@@ -1,4 +1,4 @@
|
|||||||
# lodash v3.4.2
|
# lodash v3.6.2
|
||||||
|
|
||||||
The [lodash](https://lodash.com/) library exported as [npm packages](https://www.npmjs.com/browse/keyword/lodash-modularized) per method.
|
The [lodash](https://lodash.com/) library exported as [npm packages](https://www.npmjs.com/browse/keyword/lodash-modularized) per method.
|
||||||
|
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
# lodash._basesortbyorder v3.4.1
|
# lodash._basesortbyorder v3.5.3
|
||||||
|
|
||||||
The [modern build](https://github.com/lodash/lodash/wiki/Build-Differences) of [lodash’s](https://lodash.com/) internal `baseSortByOrder` exported as a [Node.js](http://nodejs.org/)/[io.js](https://iojs.org/) module.
|
The [modern build](https://github.com/lodash/lodash/wiki/Build-Differences) of [lodash’s](https://lodash.com/) internal `baseSortByOrder` exported as a [Node.js](http://nodejs.org/)/[io.js](https://iojs.org/) module.
|
||||||
|
|
||||||
@@ -17,4 +17,4 @@ In Node.js/io.js:
|
|||||||
var baseSortByOrder = require('lodash._basesortbyorder');
|
var baseSortByOrder = require('lodash._basesortbyorder');
|
||||||
```
|
```
|
||||||
|
|
||||||
See the [package source](https://github.com/lodash/lodash/blob/3.4.1-npm-packages/lodash._basesortbyorder) for more details.
|
See the [package source](https://github.com/lodash/lodash/blob/3.5.3-npm-packages/lodash._basesortbyorder) for more details.
|
||||||
|
|||||||
@@ -1,26 +1,28 @@
|
|||||||
/**
|
/**
|
||||||
* lodash 3.4.1 (Custom Build) <https://lodash.com/>
|
* lodash 3.5.3 (Custom Build) <https://lodash.com/>
|
||||||
* Build: `lodash modern modularize exports="npm" -o ./`
|
* Build: `lodash modern modularize exports="npm" -o ./`
|
||||||
* Copyright 2012-2015 The Dojo Foundation <http://dojofoundation.org/>
|
* Copyright 2012-2015 The Dojo Foundation <http://dojofoundation.org/>
|
||||||
* Based on Underscore.js 1.8.2 <http://underscorejs.org/LICENSE>
|
* Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE>
|
||||||
* Copyright 2009-2015 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
|
* Copyright 2009-2015 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
|
||||||
* Available under MIT license <https://lodash.com/license>
|
* Available under MIT license <https://lodash.com/license>
|
||||||
*/
|
*/
|
||||||
var baseCompareAscending = require('lodash._basecompareascending'),
|
var arrayMap = require('lodash._arraymap'),
|
||||||
|
baseCallback = require('lodash._basecallback'),
|
||||||
|
baseCompareAscending = require('lodash._basecompareascending'),
|
||||||
baseEach = require('lodash._baseeach'),
|
baseEach = require('lodash._baseeach'),
|
||||||
baseSortBy = require('lodash._basesortby');
|
baseSortBy = require('lodash._basesortby');
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Used by `_.sortByOrder` to compare multiple properties of each element
|
* Used by `_.sortByOrder` to compare multiple properties of a value to another
|
||||||
* in a collection and stable sort them in the following order:
|
* and stable sort them.
|
||||||
*
|
*
|
||||||
* If orders is unspecified, sort in ascending order for all properties.
|
* If `orders` is unspecified, all valuess are sorted in ascending order. Otherwise,
|
||||||
* Otherwise, for each property, sort in ascending order if its corresponding value in
|
* a value is sorted in ascending order if its corresponding order is "asc", and
|
||||||
* orders is true, and descending order if false.
|
* descending if "desc".
|
||||||
*
|
*
|
||||||
* @private
|
* @private
|
||||||
* @param {Object} object The object to compare to `other`.
|
* @param {Object} object The object to compare.
|
||||||
* @param {Object} other The object to compare to `object`.
|
* @param {Object} other The other object to compare.
|
||||||
* @param {boolean[]} orders The order to sort by for each property.
|
* @param {boolean[]} orders The order to sort by for each property.
|
||||||
* @returns {number} Returns the sort order indicator for `object`.
|
* @returns {number} Returns the sort order indicator for `object`.
|
||||||
*/
|
*/
|
||||||
@@ -37,7 +39,8 @@ function compareMultiple(object, other, orders) {
|
|||||||
if (index >= ordersLength) {
|
if (index >= ordersLength) {
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
return result * (orders[index] ? 1 : -1);
|
var order = orders[index];
|
||||||
|
return result * ((order === 'asc' || order === true) ? 1 : -1);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// Fixes an `Array#sort` bug in the JS engine embedded in Adobe applications
|
// Fixes an `Array#sort` bug in the JS engine embedded in Adobe applications
|
||||||
@@ -51,33 +54,60 @@ function compareMultiple(object, other, orders) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Used as the [maximum length](https://people.mozilla.org/~jorendorff/es6-draft.html#sec-number.max_safe_integer)
|
* Used as the [maximum length](http://ecma-international.org/ecma-262/6.0/#sec-number.max_safe_integer)
|
||||||
* of an array-like value.
|
* of an array-like value.
|
||||||
*/
|
*/
|
||||||
var MAX_SAFE_INTEGER = Math.pow(2, 53) - 1;
|
var MAX_SAFE_INTEGER = 9007199254740991;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The base implementation of `_.map` without support for callback shorthands
|
||||||
|
* and `this` binding.
|
||||||
|
*
|
||||||
|
* @private
|
||||||
|
* @param {Array|Object|string} collection The collection to iterate over.
|
||||||
|
* @param {Function} iteratee The function invoked per iteration.
|
||||||
|
* @returns {Array} Returns the new mapped array.
|
||||||
|
*/
|
||||||
|
function baseMap(collection, iteratee) {
|
||||||
|
var index = -1,
|
||||||
|
result = isArrayLike(collection) ? Array(collection.length) : [];
|
||||||
|
|
||||||
|
baseEach(collection, function(value, key, collection) {
|
||||||
|
result[++index] = iteratee(value, key, collection);
|
||||||
|
});
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The base implementation of `_.property` without support for deep paths.
|
||||||
|
*
|
||||||
|
* @private
|
||||||
|
* @param {string} key The key of the property to get.
|
||||||
|
* @returns {Function} Returns the new function.
|
||||||
|
*/
|
||||||
|
function baseProperty(key) {
|
||||||
|
return function(object) {
|
||||||
|
return object == null ? undefined : object[key];
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The base implementation of `_.sortByOrder` without param guards.
|
* The base implementation of `_.sortByOrder` without param guards.
|
||||||
*
|
*
|
||||||
* @private
|
* @private
|
||||||
* @param {Array|Object|string} collection The collection to iterate over.
|
* @param {Array|Object|string} collection The collection to iterate over.
|
||||||
* @param {string[]} props The property names to sort by.
|
* @param {Function[]|Object[]|string[]} iteratees The iteratees to sort by.
|
||||||
* @param {boolean[]} orders The sort orders of `props`.
|
* @param {boolean[]} orders The sort orders of `iteratees`.
|
||||||
* @returns {Array} Returns the new sorted array.
|
* @returns {Array} Returns the new sorted array.
|
||||||
*/
|
*/
|
||||||
function baseSortByOrder(collection, props, orders) {
|
function baseSortByOrder(collection, iteratees, orders) {
|
||||||
var index = -1,
|
var index = -1;
|
||||||
length = collection.length,
|
|
||||||
result = isLength(length) ? Array(length) : [];
|
|
||||||
|
|
||||||
baseEach(collection, function(value) {
|
iteratees = arrayMap(iteratees, function(iteratee) { return baseCallback(iteratee); });
|
||||||
var length = props.length,
|
|
||||||
criteria = Array(length);
|
|
||||||
|
|
||||||
while (length--) {
|
var result = baseMap(collection, function(value) {
|
||||||
criteria[length] = value == null ? undefined : value[props[length]];
|
var criteria = arrayMap(iteratees, function(iteratee) { return iteratee(value); });
|
||||||
}
|
return { 'criteria': criteria, 'index': ++index, 'value': value };
|
||||||
result[++index] = { 'criteria': criteria, 'index': index, 'value': value };
|
|
||||||
});
|
});
|
||||||
|
|
||||||
return baseSortBy(result, function(object, other) {
|
return baseSortBy(result, function(object, other) {
|
||||||
@@ -85,10 +115,33 @@ function baseSortByOrder(collection, props, orders) {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Gets the "length" property value of `object`.
|
||||||
|
*
|
||||||
|
* **Note:** This function is used to avoid a [JIT bug](https://bugs.webkit.org/show_bug.cgi?id=142792)
|
||||||
|
* that affects Safari on at least iOS 8.1-8.3 ARM64.
|
||||||
|
*
|
||||||
|
* @private
|
||||||
|
* @param {Object} object The object to query.
|
||||||
|
* @returns {*} Returns the "length" value.
|
||||||
|
*/
|
||||||
|
var getLength = baseProperty('length');
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Checks if `value` is array-like.
|
||||||
|
*
|
||||||
|
* @private
|
||||||
|
* @param {*} value The value to check.
|
||||||
|
* @returns {boolean} Returns `true` if `value` is array-like, else `false`.
|
||||||
|
*/
|
||||||
|
function isArrayLike(value) {
|
||||||
|
return value != null && isLength(getLength(value));
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Checks if `value` is a valid array-like length.
|
* Checks if `value` is a valid array-like length.
|
||||||
*
|
*
|
||||||
* **Note:** This function is based on [`ToLength`](https://people.mozilla.org/~jorendorff/es6-draft.html#sec-tolength).
|
* **Note:** This function is based on [`ToLength`](http://ecma-international.org/ecma-262/6.0/#sec-tolength).
|
||||||
*
|
*
|
||||||
* @private
|
* @private
|
||||||
* @param {*} value The value to check.
|
* @param {*} value The value to check.
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "lodash._basesortbyorder",
|
"name": "lodash._basesortbyorder",
|
||||||
"version": "3.4.1",
|
"version": "3.5.3",
|
||||||
"description": "The modern build of lodash’s internal `baseSortByOrder` as a module.",
|
"description": "The modern build of lodash’s internal `baseSortByOrder` as a module.",
|
||||||
"homepage": "https://lodash.com/",
|
"homepage": "https://lodash.com/",
|
||||||
"icon": "https://lodash.com/icon.svg",
|
"icon": "https://lodash.com/icon.svg",
|
||||||
@@ -16,6 +16,8 @@
|
|||||||
"repository": "lodash/lodash",
|
"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": {
|
"dependencies": {
|
||||||
|
"lodash._arraymap": "^3.0.0",
|
||||||
|
"lodash._basecallback": "^3.0.0",
|
||||||
"lodash._basecompareascending": "^3.0.0",
|
"lodash._basecompareascending": "^3.0.0",
|
||||||
"lodash._baseeach": "^3.0.0",
|
"lodash._baseeach": "^3.0.0",
|
||||||
"lodash._basesortby": "^3.0.0"
|
"lodash._basesortby": "^3.0.0"
|
||||||
|
|||||||
@@ -1,48 +0,0 @@
|
|||||||
/**
|
|
||||||
* lodash 3.4.1 (Custom Build) <https://lodash.com/>
|
|
||||||
* Build: `lodash modern modularize exports="npm" -o ./`
|
|
||||||
* Copyright 2012-2015 The Dojo Foundation <http://dojofoundation.org/>
|
|
||||||
* Based on Underscore.js 1.8.2 <http://underscorejs.org/LICENSE>
|
|
||||||
* Copyright 2009-2015 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
|
|
||||||
* Available under MIT license <https://lodash.com/license>
|
|
||||||
*/
|
|
||||||
|
|
||||||
/** Used as the `TypeError` message for "Functions" methods. */
|
|
||||||
var FUNC_ERROR_TEXT = 'Expected a function';
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Creates a function to compose other functions into a single function.
|
|
||||||
*
|
|
||||||
* @private
|
|
||||||
* @param {boolean} [fromRight] Specify iterating from right to left.
|
|
||||||
* @returns {Function} Returns the new composer function.
|
|
||||||
*/
|
|
||||||
function createComposer(fromRight) {
|
|
||||||
return function() {
|
|
||||||
var length = arguments.length,
|
|
||||||
index = length,
|
|
||||||
fromIndex = fromRight ? (length - 1) : 0;
|
|
||||||
|
|
||||||
if (!length) {
|
|
||||||
return function() { return arguments[0]; };
|
|
||||||
}
|
|
||||||
var funcs = Array(length);
|
|
||||||
while (index--) {
|
|
||||||
funcs[index] = arguments[index];
|
|
||||||
if (typeof funcs[index] != 'function') {
|
|
||||||
throw new TypeError(FUNC_ERROR_TEXT);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return function() {
|
|
||||||
var index = fromIndex,
|
|
||||||
result = funcs[index].apply(this, arguments);
|
|
||||||
|
|
||||||
while ((fromRight ? index-- : ++index < length)) {
|
|
||||||
result = funcs[index].call(this, result);
|
|
||||||
}
|
|
||||||
return result;
|
|
||||||
};
|
|
||||||
};
|
|
||||||
}
|
|
||||||
|
|
||||||
module.exports = createComposer;
|
|
||||||
@@ -1,6 +1,6 @@
|
|||||||
# lodash._createcomposer v3.4.1
|
# lodash._createpadding v3.6.1
|
||||||
|
|
||||||
The [modern build](https://github.com/lodash/lodash/wiki/Build-Differences) of [lodash’s](https://lodash.com/) internal `createComposer` exported as a [Node.js](http://nodejs.org/)/[io.js](https://iojs.org/) module.
|
The [modern build](https://github.com/lodash/lodash/wiki/Build-Differences) of [lodash’s](https://lodash.com/) internal `createPadding` exported as a [Node.js](http://nodejs.org/)/[io.js](https://iojs.org/) module.
|
||||||
|
|
||||||
## Installation
|
## Installation
|
||||||
|
|
||||||
@@ -8,13 +8,13 @@ Using npm:
|
|||||||
|
|
||||||
```bash
|
```bash
|
||||||
$ {sudo -H} npm i -g npm
|
$ {sudo -H} npm i -g npm
|
||||||
$ npm i --save lodash._createcomposer
|
$ npm i --save lodash._createpadding
|
||||||
```
|
```
|
||||||
|
|
||||||
In Node.js/io.js:
|
In Node.js/io.js:
|
||||||
|
|
||||||
```js
|
```js
|
||||||
var createComposer = require('lodash._createcomposer');
|
var createPadding = require('lodash._createpadding');
|
||||||
```
|
```
|
||||||
|
|
||||||
See the [package source](https://github.com/lodash/lodash/blob/3.4.1-npm-packages/lodash._createcomposer) for more details.
|
See the [package source](https://github.com/lodash/lodash/blob/3.6.1-npm-packages/lodash._createpadding) for more details.
|
||||||
37
lodash._createpadding/index.js
Normal file
37
lodash._createpadding/index.js
Normal file
@@ -0,0 +1,37 @@
|
|||||||
|
/**
|
||||||
|
* lodash 3.6.1 (Custom Build) <https://lodash.com/>
|
||||||
|
* Build: `lodash modern modularize exports="npm" -o ./`
|
||||||
|
* Copyright 2012-2015 The Dojo Foundation <http://dojofoundation.org/>
|
||||||
|
* Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE>
|
||||||
|
* Copyright 2009-2015 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
|
||||||
|
* Available under MIT license <https://lodash.com/license>
|
||||||
|
*/
|
||||||
|
var repeat = require('lodash.repeat');
|
||||||
|
|
||||||
|
/* Native method references for those with the same name as other `lodash` methods. */
|
||||||
|
var nativeCeil = Math.ceil,
|
||||||
|
nativeIsFinite = global.isFinite;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Creates the padding required for `string` based on the given `length`.
|
||||||
|
* The `chars` string is truncated if the number of characters exceeds `length`.
|
||||||
|
*
|
||||||
|
* @private
|
||||||
|
* @param {string} string The string to create padding for.
|
||||||
|
* @param {number} [length=0] The padding length.
|
||||||
|
* @param {string} [chars=' '] The string used as padding.
|
||||||
|
* @returns {string} Returns the pad for `string`.
|
||||||
|
*/
|
||||||
|
function createPadding(string, length, chars) {
|
||||||
|
var strLength = string.length;
|
||||||
|
length = +length;
|
||||||
|
|
||||||
|
if (strLength >= length || !nativeIsFinite(length)) {
|
||||||
|
return '';
|
||||||
|
}
|
||||||
|
var padLength = length - strLength;
|
||||||
|
chars = chars == null ? ' ' : (chars + '');
|
||||||
|
return repeat(chars, nativeCeil(padLength / chars.length)).slice(0, padLength);
|
||||||
|
}
|
||||||
|
|
||||||
|
module.exports = createPadding;
|
||||||
@@ -1,7 +1,7 @@
|
|||||||
{
|
{
|
||||||
"name": "lodash._createcomposer",
|
"name": "lodash._createpadding",
|
||||||
"version": "3.4.1",
|
"version": "3.6.1",
|
||||||
"description": "The modern build of lodash’s internal `createComposer` as a module.",
|
"description": "The modern build of lodash’s internal `createPadding` as a module.",
|
||||||
"homepage": "https://lodash.com/",
|
"homepage": "https://lodash.com/",
|
||||||
"icon": "https://lodash.com/icon.svg",
|
"icon": "https://lodash.com/icon.svg",
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
@@ -14,5 +14,8 @@
|
|||||||
"Mathias Bynens <mathias@qiwi.be> (https://mathiasbynens.be/)"
|
"Mathias Bynens <mathias@qiwi.be> (https://mathiasbynens.be/)"
|
||||||
],
|
],
|
||||||
"repository": "lodash/lodash",
|
"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.repeat": "^3.0.0"
|
||||||
|
}
|
||||||
}
|
}
|
||||||
@@ -1,7 +1,17 @@
|
|||||||
Copyright 2012-2016 The Dojo Foundation <http://dojofoundation.org/>
|
Copyright jQuery Foundation and other contributors <https://jquery.org/>
|
||||||
Based on Underscore.js, copyright 2009-2016 Jeremy Ashkenas,
|
|
||||||
|
Based on Underscore.js, copyright Jeremy Ashkenas,
|
||||||
DocumentCloud and Investigative Reporters & Editors <http://underscorejs.org/>
|
DocumentCloud and Investigative Reporters & Editors <http://underscorejs.org/>
|
||||||
|
|
||||||
|
This software consists of voluntary contributions made by many
|
||||||
|
individuals. For exact contribution history, see the revision history
|
||||||
|
available at https://github.com/lodash/lodash
|
||||||
|
|
||||||
|
The following license applies to all parts of this software except as
|
||||||
|
documented below:
|
||||||
|
|
||||||
|
====
|
||||||
|
|
||||||
Permission is hereby granted, free of charge, to any person obtaining
|
Permission is hereby granted, free of charge, to any person obtaining
|
||||||
a copy of this software and associated documentation files (the
|
a copy of this software and associated documentation files (the
|
||||||
"Software"), to deal in the Software without restriction, including
|
"Software"), to deal in the Software without restriction, including
|
||||||
@@ -20,3 +30,18 @@ NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
|||||||
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
||||||
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
||||||
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||||
|
|
||||||
|
====
|
||||||
|
|
||||||
|
Copyright and related rights for sample code are waived via CC0. Sample
|
||||||
|
code is defined as all source code displayed within the prose of the
|
||||||
|
documentation.
|
||||||
|
|
||||||
|
CC0: http://creativecommons.org/publicdomain/zero/1.0/
|
||||||
|
|
||||||
|
====
|
||||||
|
|
||||||
|
Files located in the node_modules and vendor directories are externally
|
||||||
|
maintained libraries used by this software which have their own
|
||||||
|
licenses; we recommend you read them, as their terms may differ from the
|
||||||
|
terms above.
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
# lodash.add v3.4.2
|
# lodash.add v3.6.0
|
||||||
|
|
||||||
The [lodash](https://lodash.com/) method `_.add` exported as a [Node.js](https://nodejs.org/) module.
|
The [lodash](https://lodash.com/) method `_.add` exported as a [Node.js](https://nodejs.org/) module.
|
||||||
|
|
||||||
@@ -15,4 +15,4 @@ In Node.js:
|
|||||||
var add = require('lodash.add');
|
var add = require('lodash.add');
|
||||||
```
|
```
|
||||||
|
|
||||||
See the [documentation](https://lodash.com/docs#add) or [package source](https://github.com/lodash/lodash/blob/3.4.2-npm-packages/lodash.add) for more details.
|
See the [documentation](https://lodash.com/docs#add) or [package source](https://github.com/lodash/lodash/blob/3.6.0-npm-packages/lodash.add) for more details.
|
||||||
|
|||||||
@@ -1,17 +1,53 @@
|
|||||||
/**
|
/**
|
||||||
* lodash 3.4.2 (Custom Build) <https://lodash.com/>
|
* lodash (Custom Build) <https://lodash.com/>
|
||||||
* Build: `lodash modularize exports="npm" -o ./`
|
* Build: `lodash modularize exports="npm" -o ./`
|
||||||
* Copyright 2012-2016 The Dojo Foundation <http://dojofoundation.org/>
|
* 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>
|
* Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE>
|
||||||
* Copyright 2009-2016 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
|
* Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
|
||||||
* Available under MIT license <https://lodash.com/license>
|
|
||||||
*/
|
*/
|
||||||
|
var baseToNumber = require('lodash._basetonumber'),
|
||||||
|
baseToString = require('lodash._basetostring');
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Creates a function that performs a mathematical operation on two values.
|
||||||
|
*
|
||||||
|
* @private
|
||||||
|
* @param {Function} operator The function to perform the operation.
|
||||||
|
* @returns {Function} Returns the new mathematical operation function.
|
||||||
|
*/
|
||||||
|
function createMathOperation(operator) {
|
||||||
|
return function(value, other) {
|
||||||
|
var result;
|
||||||
|
if (value === undefined && other === undefined) {
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
if (value !== undefined) {
|
||||||
|
result = value;
|
||||||
|
}
|
||||||
|
if (other !== undefined) {
|
||||||
|
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;
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Adds two numbers.
|
* Adds two numbers.
|
||||||
*
|
*
|
||||||
* @static
|
* @static
|
||||||
* @memberOf _
|
* @memberOf _
|
||||||
|
* @since 3.4.0
|
||||||
* @category Math
|
* @category Math
|
||||||
* @param {number} augend The first number in an addition.
|
* @param {number} augend The first number in an addition.
|
||||||
* @param {number} addend The second number in an addition.
|
* @param {number} addend The second number in an addition.
|
||||||
@@ -21,15 +57,8 @@
|
|||||||
* _.add(6, 4);
|
* _.add(6, 4);
|
||||||
* // => 10
|
* // => 10
|
||||||
*/
|
*/
|
||||||
function add(augend, addend) {
|
var add = createMathOperation(function(augend, addend) {
|
||||||
var result;
|
return augend + addend;
|
||||||
if (augend !== undefined) {
|
});
|
||||||
result = augend;
|
|
||||||
}
|
|
||||||
if (addend !== undefined) {
|
|
||||||
result = result === undefined ? addend : (result + addend);
|
|
||||||
}
|
|
||||||
return result;
|
|
||||||
}
|
|
||||||
|
|
||||||
module.exports = add;
|
module.exports = add;
|
||||||
|
|||||||
@@ -1,17 +1,21 @@
|
|||||||
{
|
{
|
||||||
"name": "lodash.add",
|
"name": "lodash.add",
|
||||||
"version": "3.4.2",
|
"version": "3.6.0",
|
||||||
"description": "The lodash method `_.add` exported as a module.",
|
"description": "The lodash method `_.add` exported as a module.",
|
||||||
"homepage": "https://lodash.com/",
|
"homepage": "https://lodash.com/",
|
||||||
"icon": "https://lodash.com/icon.svg",
|
"icon": "https://lodash.com/icon.svg",
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"keywords": "lodash, lodash-modularized, stdlib, util, add",
|
"keywords": "lodash-modularized, add",
|
||||||
"author": "John-David Dalton <john.david.dalton@gmail.com> (http://allyoucanleet.com/)",
|
"author": "John-David Dalton <john.david.dalton@gmail.com> (http://allyoucanleet.com/)",
|
||||||
"contributors": [
|
"contributors": [
|
||||||
"John-David Dalton <john.david.dalton@gmail.com> (http://allyoucanleet.com/)",
|
"John-David Dalton <john.david.dalton@gmail.com> (http://allyoucanleet.com/)",
|
||||||
"Blaine Bublitz <blaine@iceddev.com> (https://github.com/phated)",
|
"Blaine Bublitz <blaine.bublitz@gmail.com> (https://github.com/phated)",
|
||||||
"Mathias Bynens <mathias@qiwi.be> (https://mathiasbynens.be/)"
|
"Mathias Bynens <mathias@qiwi.be> (https://mathiasbynens.be/)"
|
||||||
],
|
],
|
||||||
"repository": "lodash/lodash",
|
"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"
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
# lodash.flow v3.4.0
|
# lodash.flow v3.5.0
|
||||||
|
|
||||||
The [lodash](https://lodash.com/) method `_.flow` exported as a [Node.js](https://nodejs.org/) module.
|
The [lodash](https://lodash.com/) method `_.flow` exported as a [Node.js](https://nodejs.org/) module.
|
||||||
|
|
||||||
@@ -15,4 +15,4 @@ In Node.js:
|
|||||||
var flow = require('lodash.flow');
|
var flow = require('lodash.flow');
|
||||||
```
|
```
|
||||||
|
|
||||||
See the [documentation](https://lodash.com/docs#flow) or [package source](https://github.com/lodash/lodash/blob/3.4.0-npm-packages/lodash.flow) for more details.
|
See the [documentation](https://lodash.com/docs#flow) or [package source](https://github.com/lodash/lodash/blob/3.5.0-npm-packages/lodash.flow) for more details.
|
||||||
|
|||||||
@@ -66,19 +66,6 @@ function arrayPush(array, values) {
|
|||||||
return array;
|
return array;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* The base implementation of `_.property` without support for deep paths.
|
|
||||||
*
|
|
||||||
* @private
|
|
||||||
* @param {string} key The key of the property to get.
|
|
||||||
* @returns {Function} Returns the new accessor function.
|
|
||||||
*/
|
|
||||||
function baseProperty(key) {
|
|
||||||
return function(object) {
|
|
||||||
return object == null ? undefined : object[key];
|
|
||||||
};
|
|
||||||
}
|
|
||||||
|
|
||||||
/** Used for built-in method references. */
|
/** Used for built-in method references. */
|
||||||
var objectProto = Object.prototype;
|
var objectProto = Object.prototype;
|
||||||
|
|
||||||
@@ -87,7 +74,7 @@ var hasOwnProperty = objectProto.hasOwnProperty;
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Used to resolve the
|
* Used to resolve the
|
||||||
* [`toStringTag`](http://ecma-international.org/ecma-262/6.0/#sec-object.prototype.tostring)
|
* [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)
|
||||||
* of values.
|
* of values.
|
||||||
*/
|
*/
|
||||||
var objectToString = objectProto.toString;
|
var objectToString = objectProto.toString;
|
||||||
@@ -197,19 +184,6 @@ function createFlow(fromRight) {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Gets the "length" property value of `object`.
|
|
||||||
*
|
|
||||||
* **Note:** This function is used to avoid a
|
|
||||||
* [JIT bug](https://bugs.webkit.org/show_bug.cgi?id=142792) that affects
|
|
||||||
* Safari on at least iOS 8.1-8.3 ARM64.
|
|
||||||
*
|
|
||||||
* @private
|
|
||||||
* @param {Object} object The object to query.
|
|
||||||
* @returns {*} Returns the "length" value.
|
|
||||||
*/
|
|
||||||
var getLength = baseProperty('length');
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Checks if `value` is a flattenable `arguments` object or array.
|
* Checks if `value` is a flattenable `arguments` object or array.
|
||||||
*
|
*
|
||||||
@@ -241,7 +215,7 @@ function isFlattenable(value) {
|
|||||||
* // => false
|
* // => false
|
||||||
*/
|
*/
|
||||||
function isArguments(value) {
|
function isArguments(value) {
|
||||||
// Safari 8.1 incorrectly makes `arguments.callee` enumerable in strict mode.
|
// Safari 8.1 makes `arguments.callee` enumerable in strict mode.
|
||||||
return isArrayLikeObject(value) && hasOwnProperty.call(value, 'callee') &&
|
return isArrayLikeObject(value) && hasOwnProperty.call(value, 'callee') &&
|
||||||
(!propertyIsEnumerable.call(value, 'callee') || objectToString.call(value) == argsTag);
|
(!propertyIsEnumerable.call(value, 'callee') || objectToString.call(value) == argsTag);
|
||||||
}
|
}
|
||||||
@@ -297,7 +271,7 @@ var isArray = Array.isArray;
|
|||||||
* // => false
|
* // => false
|
||||||
*/
|
*/
|
||||||
function isArrayLike(value) {
|
function isArrayLike(value) {
|
||||||
return value != null && isLength(getLength(value)) && !isFunction(value);
|
return value != null && isLength(value.length) && !isFunction(value);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -348,8 +322,7 @@ function isArrayLikeObject(value) {
|
|||||||
*/
|
*/
|
||||||
function isFunction(value) {
|
function isFunction(value) {
|
||||||
// The use of `Object#toString` avoids issues with the `typeof` operator
|
// The use of `Object#toString` avoids issues with the `typeof` operator
|
||||||
// in Safari 8 which returns 'object' for typed array and weak map constructors,
|
// in Safari 8-9 which returns 'object' for typed array and other constructors.
|
||||||
// and PhantomJS 1.9 which returns 'function' for `NodeList` instances.
|
|
||||||
var tag = isObject(value) ? objectToString.call(value) : '';
|
var tag = isObject(value) ? objectToString.call(value) : '';
|
||||||
return tag == funcTag || tag == genTag;
|
return tag == funcTag || tag == genTag;
|
||||||
}
|
}
|
||||||
@@ -357,16 +330,15 @@ function isFunction(value) {
|
|||||||
/**
|
/**
|
||||||
* Checks if `value` is a valid array-like length.
|
* Checks if `value` is a valid array-like length.
|
||||||
*
|
*
|
||||||
* **Note:** This function is loosely based on
|
* **Note:** This method is loosely based on
|
||||||
* [`ToLength`](http://ecma-international.org/ecma-262/6.0/#sec-tolength).
|
* [`ToLength`](http://ecma-international.org/ecma-262/7.0/#sec-tolength).
|
||||||
*
|
*
|
||||||
* @static
|
* @static
|
||||||
* @memberOf _
|
* @memberOf _
|
||||||
* @since 4.0.0
|
* @since 4.0.0
|
||||||
* @category Lang
|
* @category Lang
|
||||||
* @param {*} value The value to check.
|
* @param {*} value The value to check.
|
||||||
* @returns {boolean} Returns `true` if `value` is a valid length,
|
* @returns {boolean} Returns `true` if `value` is a valid length, else `false`.
|
||||||
* else `false`.
|
|
||||||
* @example
|
* @example
|
||||||
*
|
*
|
||||||
* _.isLength(3);
|
* _.isLength(3);
|
||||||
@@ -388,7 +360,7 @@ function isLength(value) {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Checks if `value` is the
|
* Checks if `value` is the
|
||||||
* [language type](http://www.ecma-international.org/ecma-262/6.0/#sec-ecmascript-language-types)
|
* [language type](http://www.ecma-international.org/ecma-262/7.0/#sec-ecmascript-language-types)
|
||||||
* of `Object`. (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`)
|
* of `Object`. (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`)
|
||||||
*
|
*
|
||||||
* @static
|
* @static
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "lodash.flow",
|
"name": "lodash.flow",
|
||||||
"version": "3.4.0",
|
"version": "3.5.0",
|
||||||
"description": "The lodash method `_.flow` exported as a module.",
|
"description": "The lodash method `_.flow` exported as a module.",
|
||||||
"homepage": "https://lodash.com/",
|
"homepage": "https://lodash.com/",
|
||||||
"icon": "https://lodash.com/icon.svg",
|
"icon": "https://lodash.com/icon.svg",
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
# lodash.flowright v3.4.0
|
# lodash.flowright v3.5.0
|
||||||
|
|
||||||
The [lodash](https://lodash.com/) method `_.flowRight` exported as a [Node.js](https://nodejs.org/) module.
|
The [lodash](https://lodash.com/) method `_.flowRight` exported as a [Node.js](https://nodejs.org/) module.
|
||||||
|
|
||||||
@@ -15,4 +15,4 @@ In Node.js:
|
|||||||
var flowRight = require('lodash.flowright');
|
var flowRight = require('lodash.flowright');
|
||||||
```
|
```
|
||||||
|
|
||||||
See the [documentation](https://lodash.com/docs#flowRight) or [package source](https://github.com/lodash/lodash/blob/3.4.0-npm-packages/lodash.flowright) for more details.
|
See the [documentation](https://lodash.com/docs#flowRight) or [package source](https://github.com/lodash/lodash/blob/3.5.0-npm-packages/lodash.flowright) for more details.
|
||||||
|
|||||||
@@ -66,19 +66,6 @@ function arrayPush(array, values) {
|
|||||||
return array;
|
return array;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* The base implementation of `_.property` without support for deep paths.
|
|
||||||
*
|
|
||||||
* @private
|
|
||||||
* @param {string} key The key of the property to get.
|
|
||||||
* @returns {Function} Returns the new accessor function.
|
|
||||||
*/
|
|
||||||
function baseProperty(key) {
|
|
||||||
return function(object) {
|
|
||||||
return object == null ? undefined : object[key];
|
|
||||||
};
|
|
||||||
}
|
|
||||||
|
|
||||||
/** Used for built-in method references. */
|
/** Used for built-in method references. */
|
||||||
var objectProto = Object.prototype;
|
var objectProto = Object.prototype;
|
||||||
|
|
||||||
@@ -87,7 +74,7 @@ var hasOwnProperty = objectProto.hasOwnProperty;
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Used to resolve the
|
* Used to resolve the
|
||||||
* [`toStringTag`](http://ecma-international.org/ecma-262/6.0/#sec-object.prototype.tostring)
|
* [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)
|
||||||
* of values.
|
* of values.
|
||||||
*/
|
*/
|
||||||
var objectToString = objectProto.toString;
|
var objectToString = objectProto.toString;
|
||||||
@@ -197,19 +184,6 @@ function createFlow(fromRight) {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Gets the "length" property value of `object`.
|
|
||||||
*
|
|
||||||
* **Note:** This function is used to avoid a
|
|
||||||
* [JIT bug](https://bugs.webkit.org/show_bug.cgi?id=142792) that affects
|
|
||||||
* Safari on at least iOS 8.1-8.3 ARM64.
|
|
||||||
*
|
|
||||||
* @private
|
|
||||||
* @param {Object} object The object to query.
|
|
||||||
* @returns {*} Returns the "length" value.
|
|
||||||
*/
|
|
||||||
var getLength = baseProperty('length');
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Checks if `value` is a flattenable `arguments` object or array.
|
* Checks if `value` is a flattenable `arguments` object or array.
|
||||||
*
|
*
|
||||||
@@ -241,7 +215,7 @@ function isFlattenable(value) {
|
|||||||
* // => false
|
* // => false
|
||||||
*/
|
*/
|
||||||
function isArguments(value) {
|
function isArguments(value) {
|
||||||
// Safari 8.1 incorrectly makes `arguments.callee` enumerable in strict mode.
|
// Safari 8.1 makes `arguments.callee` enumerable in strict mode.
|
||||||
return isArrayLikeObject(value) && hasOwnProperty.call(value, 'callee') &&
|
return isArrayLikeObject(value) && hasOwnProperty.call(value, 'callee') &&
|
||||||
(!propertyIsEnumerable.call(value, 'callee') || objectToString.call(value) == argsTag);
|
(!propertyIsEnumerable.call(value, 'callee') || objectToString.call(value) == argsTag);
|
||||||
}
|
}
|
||||||
@@ -297,7 +271,7 @@ var isArray = Array.isArray;
|
|||||||
* // => false
|
* // => false
|
||||||
*/
|
*/
|
||||||
function isArrayLike(value) {
|
function isArrayLike(value) {
|
||||||
return value != null && isLength(getLength(value)) && !isFunction(value);
|
return value != null && isLength(value.length) && !isFunction(value);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -348,8 +322,7 @@ function isArrayLikeObject(value) {
|
|||||||
*/
|
*/
|
||||||
function isFunction(value) {
|
function isFunction(value) {
|
||||||
// The use of `Object#toString` avoids issues with the `typeof` operator
|
// The use of `Object#toString` avoids issues with the `typeof` operator
|
||||||
// in Safari 8 which returns 'object' for typed array and weak map constructors,
|
// in Safari 8-9 which returns 'object' for typed array and other constructors.
|
||||||
// and PhantomJS 1.9 which returns 'function' for `NodeList` instances.
|
|
||||||
var tag = isObject(value) ? objectToString.call(value) : '';
|
var tag = isObject(value) ? objectToString.call(value) : '';
|
||||||
return tag == funcTag || tag == genTag;
|
return tag == funcTag || tag == genTag;
|
||||||
}
|
}
|
||||||
@@ -357,16 +330,15 @@ function isFunction(value) {
|
|||||||
/**
|
/**
|
||||||
* Checks if `value` is a valid array-like length.
|
* Checks if `value` is a valid array-like length.
|
||||||
*
|
*
|
||||||
* **Note:** This function is loosely based on
|
* **Note:** This method is loosely based on
|
||||||
* [`ToLength`](http://ecma-international.org/ecma-262/6.0/#sec-tolength).
|
* [`ToLength`](http://ecma-international.org/ecma-262/7.0/#sec-tolength).
|
||||||
*
|
*
|
||||||
* @static
|
* @static
|
||||||
* @memberOf _
|
* @memberOf _
|
||||||
* @since 4.0.0
|
* @since 4.0.0
|
||||||
* @category Lang
|
* @category Lang
|
||||||
* @param {*} value The value to check.
|
* @param {*} value The value to check.
|
||||||
* @returns {boolean} Returns `true` if `value` is a valid length,
|
* @returns {boolean} Returns `true` if `value` is a valid length, else `false`.
|
||||||
* else `false`.
|
|
||||||
* @example
|
* @example
|
||||||
*
|
*
|
||||||
* _.isLength(3);
|
* _.isLength(3);
|
||||||
@@ -388,7 +360,7 @@ function isLength(value) {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Checks if `value` is the
|
* Checks if `value` is the
|
||||||
* [language type](http://www.ecma-international.org/ecma-262/6.0/#sec-ecmascript-language-types)
|
* [language type](http://www.ecma-international.org/ecma-262/7.0/#sec-ecmascript-language-types)
|
||||||
* of `Object`. (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`)
|
* of `Object`. (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`)
|
||||||
*
|
*
|
||||||
* @static
|
* @static
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "lodash.flowright",
|
"name": "lodash.flowright",
|
||||||
"version": "3.4.0",
|
"version": "3.5.0",
|
||||||
"description": "The lodash method `_.flowRight` exported as a module.",
|
"description": "The lodash method `_.flowRight` exported as a module.",
|
||||||
"homepage": "https://lodash.com/",
|
"homepage": "https://lodash.com/",
|
||||||
"icon": "https://lodash.com/icon.svg",
|
"icon": "https://lodash.com/icon.svg",
|
||||||
|
|||||||
20
lodash.restparam/README.md
Normal file
20
lodash.restparam/README.md
Normal file
@@ -0,0 +1,20 @@
|
|||||||
|
# lodash.restparam v3.6.1
|
||||||
|
|
||||||
|
The [modern build](https://github.com/lodash/lodash/wiki/Build-Differences) of [lodash’s](https://lodash.com/) `_.restParam` exported as a [Node.js](http://nodejs.org/)/[io.js](https://iojs.org/) module.
|
||||||
|
|
||||||
|
## Installation
|
||||||
|
|
||||||
|
Using npm:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
$ {sudo -H} npm i -g npm
|
||||||
|
$ npm i --save lodash.restparam
|
||||||
|
```
|
||||||
|
|
||||||
|
In Node.js/io.js:
|
||||||
|
|
||||||
|
```js
|
||||||
|
var restParam = require('lodash.restparam');
|
||||||
|
```
|
||||||
|
|
||||||
|
See the [documentation](https://lodash.com/docs#restParam) or [package source](https://github.com/lodash/lodash/blob/3.6.1-npm-packages/lodash.restparam) for more details.
|
||||||
67
lodash.restparam/index.js
Normal file
67
lodash.restparam/index.js
Normal file
@@ -0,0 +1,67 @@
|
|||||||
|
/**
|
||||||
|
* lodash 3.6.1 (Custom Build) <https://lodash.com/>
|
||||||
|
* Build: `lodash modern modularize exports="npm" -o ./`
|
||||||
|
* Copyright 2012-2015 The Dojo Foundation <http://dojofoundation.org/>
|
||||||
|
* Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE>
|
||||||
|
* Copyright 2009-2015 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
|
||||||
|
* Available under MIT license <https://lodash.com/license>
|
||||||
|
*/
|
||||||
|
|
||||||
|
/** Used as the `TypeError` message for "Functions" methods. */
|
||||||
|
var FUNC_ERROR_TEXT = 'Expected a function';
|
||||||
|
|
||||||
|
/* Native method references for those with the same name as other `lodash` methods. */
|
||||||
|
var nativeMax = Math.max;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Creates a function that invokes `func` with the `this` binding of the
|
||||||
|
* created function and arguments from `start` and beyond provided as an array.
|
||||||
|
*
|
||||||
|
* **Note:** This method is based on the [rest parameter](https://developer.mozilla.org/Web/JavaScript/Reference/Functions/rest_parameters).
|
||||||
|
*
|
||||||
|
* @static
|
||||||
|
* @memberOf _
|
||||||
|
* @category Function
|
||||||
|
* @param {Function} func The function to apply a rest parameter to.
|
||||||
|
* @param {number} [start=func.length-1] The start position of the rest parameter.
|
||||||
|
* @returns {Function} Returns the new function.
|
||||||
|
* @example
|
||||||
|
*
|
||||||
|
* var say = _.restParam(function(what, names) {
|
||||||
|
* return what + ' ' + _.initial(names).join(', ') +
|
||||||
|
* (_.size(names) > 1 ? ', & ' : '') + _.last(names);
|
||||||
|
* });
|
||||||
|
*
|
||||||
|
* say('hello', 'fred', 'barney', 'pebbles');
|
||||||
|
* // => 'hello fred, barney, & pebbles'
|
||||||
|
*/
|
||||||
|
function restParam(func, start) {
|
||||||
|
if (typeof func != 'function') {
|
||||||
|
throw new TypeError(FUNC_ERROR_TEXT);
|
||||||
|
}
|
||||||
|
start = nativeMax(start === undefined ? (func.length - 1) : (+start || 0), 0);
|
||||||
|
return function() {
|
||||||
|
var args = arguments,
|
||||||
|
index = -1,
|
||||||
|
length = nativeMax(args.length - start, 0),
|
||||||
|
rest = Array(length);
|
||||||
|
|
||||||
|
while (++index < length) {
|
||||||
|
rest[index] = args[start + index];
|
||||||
|
}
|
||||||
|
switch (start) {
|
||||||
|
case 0: return func.call(this, rest);
|
||||||
|
case 1: return func.call(this, args[0], rest);
|
||||||
|
case 2: return func.call(this, args[0], args[1], rest);
|
||||||
|
}
|
||||||
|
var otherArgs = Array(start + 1);
|
||||||
|
index = -1;
|
||||||
|
while (++index < start) {
|
||||||
|
otherArgs[index] = args[index];
|
||||||
|
}
|
||||||
|
otherArgs[start] = rest;
|
||||||
|
return func.apply(this, otherArgs);
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
module.exports = restParam;
|
||||||
19
lodash.restparam/package.json
Normal file
19
lodash.restparam/package.json
Normal file
@@ -0,0 +1,19 @@
|
|||||||
|
{
|
||||||
|
"name": "lodash.restparam",
|
||||||
|
"version": "3.6.1",
|
||||||
|
"description": "The modern build of lodash’s `_.restParam` as a module.",
|
||||||
|
"homepage": "https://lodash.com/",
|
||||||
|
"icon": "https://lodash.com/icon.svg",
|
||||||
|
"license": "MIT",
|
||||||
|
"keywords": "lodash, lodash-modularized, stdlib, util",
|
||||||
|
"author": "John-David Dalton <john.david.dalton@gmail.com> (http://allyoucanleet.com/)",
|
||||||
|
"contributors": [
|
||||||
|
"John-David Dalton <john.david.dalton@gmail.com> (http://allyoucanleet.com/)",
|
||||||
|
"Benjamin Tan <demoneaux@gmail.com> (https://d10.github.io/)",
|
||||||
|
"Blaine Bublitz <blaine@iceddev.com> (http://www.iceddev.com/)",
|
||||||
|
"Kit Cambridge <github@kitcambridge.be> (http://kitcambridge.be/)",
|
||||||
|
"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.\"" }
|
||||||
|
}
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
# lodash.sortbyorder v3.4.2
|
# lodash.sortbyorder v3.4.4
|
||||||
|
|
||||||
The [modern build](https://github.com/lodash/lodash/wiki/Build-Differences) of [lodash’s](https://lodash.com/) `_.sortByOrder` exported as a [Node.js](http://nodejs.org/)/[io.js](https://iojs.org/) module.
|
The [modern build](https://github.com/lodash/lodash/wiki/Build-Differences) of [lodash’s](https://lodash.com/) `_.sortByOrder` exported as a [Node.js](http://nodejs.org/)/[io.js](https://iojs.org/) module.
|
||||||
|
|
||||||
@@ -17,4 +17,4 @@ In Node.js/io.js:
|
|||||||
var sortByOrder = require('lodash.sortbyorder');
|
var sortByOrder = require('lodash.sortbyorder');
|
||||||
```
|
```
|
||||||
|
|
||||||
See the [documentation](https://lodash.com/docs#sortByOrder) or [package source](https://github.com/lodash/lodash/blob/3.4.2-npm-packages/lodash.sortbyorder) for more details.
|
See the [documentation](https://lodash.com/docs#sortByOrder) or [package source](https://github.com/lodash/lodash/blob/3.4.4-npm-packages/lodash.sortbyorder) for more details.
|
||||||
|
|||||||
@@ -1,21 +1,20 @@
|
|||||||
/**
|
/**
|
||||||
* lodash 3.4.2 (Custom Build) <https://lodash.com/>
|
* lodash 3.4.4 (Custom Build) <https://lodash.com/>
|
||||||
* Build: `lodash modern modularize exports="npm" -o ./`
|
* Build: `lodash modern modularize exports="npm" -o ./`
|
||||||
* Copyright 2012-2015 The Dojo Foundation <http://dojofoundation.org/>
|
* Copyright 2012-2015 The Dojo Foundation <http://dojofoundation.org/>
|
||||||
* Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE>
|
* Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE>
|
||||||
* Copyright 2009-2015 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
|
* Copyright 2009-2015 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
|
||||||
* Available under MIT license <https://lodash.com/license>
|
* Available under MIT license <https://lodash.com/license>
|
||||||
*/
|
*/
|
||||||
var baseEach = require('lodash._baseeach'),
|
var baseSortByOrder = require('lodash._basesortbyorder'),
|
||||||
baseSortByOrder = require('lodash._basesortbyorder'),
|
|
||||||
isIterateeCall = require('lodash._isiterateecall'),
|
isIterateeCall = require('lodash._isiterateecall'),
|
||||||
isArray = require('lodash.isarray');
|
isArray = require('lodash.isarray');
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This method is like `_.sortByAll` except that it allows specifying the
|
* This method is like `_.sortByAll` except that it allows specifying the
|
||||||
* sort orders of the iteratees to sort by. A truthy value in `orders` will
|
* sort orders of the iteratees to sort by. If `orders` is unspecified, all
|
||||||
* sort the corresponding property name in ascending order while a falsey
|
* values are sorted in ascending order. Otherwise, a value is sorted in
|
||||||
* value will sort it in descending order.
|
* ascending order if its corresponding order is "asc", and descending if "desc".
|
||||||
*
|
*
|
||||||
* If a property name is provided for an iteratee the created `_.property`
|
* If a property name is provided for an iteratee the created `_.property`
|
||||||
* style callback returns the property value of the given element.
|
* style callback returns the property value of the given element.
|
||||||
@@ -29,7 +28,7 @@ var baseEach = require('lodash._baseeach'),
|
|||||||
* @category Collection
|
* @category Collection
|
||||||
* @param {Array|Object|string} collection The collection to iterate over.
|
* @param {Array|Object|string} collection The collection to iterate over.
|
||||||
* @param {Function[]|Object[]|string[]} iteratees The iteratees to sort by.
|
* @param {Function[]|Object[]|string[]} iteratees The iteratees to sort by.
|
||||||
* @param {boolean[]} orders The sort orders of `iteratees`.
|
* @param {boolean[]} [orders] The sort orders of `iteratees`.
|
||||||
* @param- {Object} [guard] Enables use as a callback for functions like `_.reduce`.
|
* @param- {Object} [guard] Enables use as a callback for functions like `_.reduce`.
|
||||||
* @returns {Array} Returns the new sorted array.
|
* @returns {Array} Returns the new sorted array.
|
||||||
* @example
|
* @example
|
||||||
@@ -42,7 +41,7 @@ var baseEach = require('lodash._baseeach'),
|
|||||||
* ];
|
* ];
|
||||||
*
|
*
|
||||||
* // sort by `user` in ascending order and by `age` in descending order
|
* // sort by `user` in ascending order and by `age` in descending order
|
||||||
* _.map(_.sortByOrder(users, ['user', 'age'], [true, false]), _.values);
|
* _.map(_.sortByOrder(users, ['user', 'age'], ['asc', 'desc']), _.values);
|
||||||
* // => [['barney', 36], ['barney', 34], ['fred', 48], ['fred', 42]]
|
* // => [['barney', 36], ['barney', 34], ['fred', 48], ['fred', 42]]
|
||||||
*/
|
*/
|
||||||
function sortByOrder(collection, iteratees, orders, guard) {
|
function sortByOrder(collection, iteratees, orders, guard) {
|
||||||
@@ -50,7 +49,7 @@ function sortByOrder(collection, iteratees, orders, guard) {
|
|||||||
return [];
|
return [];
|
||||||
}
|
}
|
||||||
if (guard && isIterateeCall(iteratees, orders, guard)) {
|
if (guard && isIterateeCall(iteratees, orders, guard)) {
|
||||||
orders = null;
|
orders = undefined;
|
||||||
}
|
}
|
||||||
if (!isArray(iteratees)) {
|
if (!isArray(iteratees)) {
|
||||||
iteratees = iteratees == null ? [] : [iteratees];
|
iteratees = iteratees == null ? [] : [iteratees];
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "lodash.sortbyorder",
|
"name": "lodash.sortbyorder",
|
||||||
"version": "3.4.2",
|
"version": "3.4.4",
|
||||||
"description": "The modern build of lodash’s `_.sortByOrder` as a module.",
|
"description": "The modern build of lodash’s `_.sortByOrder` as a module.",
|
||||||
"homepage": "https://lodash.com/",
|
"homepage": "https://lodash.com/",
|
||||||
"icon": "https://lodash.com/icon.svg",
|
"icon": "https://lodash.com/icon.svg",
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
# lodash.sum v3.4.0
|
# lodash.sum v3.6.2
|
||||||
|
|
||||||
The [modern build](https://github.com/lodash/lodash/wiki/Build-Differences) of [lodash’s](https://lodash.com/) `_.sum` exported as a [Node.js](http://nodejs.org/)/[io.js](https://iojs.org/) module.
|
The [modern build](https://github.com/lodash/lodash/wiki/Build-Differences) of [lodash’s](https://lodash.com/) `_.sum` exported as a [Node.js](http://nodejs.org/)/[io.js](https://iojs.org/) module.
|
||||||
|
|
||||||
@@ -17,4 +17,4 @@ In Node.js/io.js:
|
|||||||
var sum = require('lodash.sum');
|
var sum = require('lodash.sum');
|
||||||
```
|
```
|
||||||
|
|
||||||
See the [documentation](https://lodash.com/docs#sum) or [package source](https://github.com/lodash/lodash/blob/3.4.0-npm-packages/lodash.sum) for more details.
|
See the [documentation](https://lodash.com/docs#sum) or [package source](https://github.com/lodash/lodash/blob/3.6.2-npm-packages/lodash.sum) for more details.
|
||||||
|
|||||||
@@ -1,14 +1,53 @@
|
|||||||
/**
|
/**
|
||||||
* lodash 3.4.0 (Custom Build) <https://lodash.com/>
|
* lodash 3.6.2 (Custom Build) <https://lodash.com/>
|
||||||
* Build: `lodash modern modularize exports="npm" -o ./`
|
* Build: `lodash modern modularize exports="npm" -o ./`
|
||||||
* Copyright 2012-2015 The Dojo Foundation <http://dojofoundation.org/>
|
* Copyright 2012-2015 The Dojo Foundation <http://dojofoundation.org/>
|
||||||
* Based on Underscore.js 1.8.2 <http://underscorejs.org/LICENSE>
|
* Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE>
|
||||||
* Copyright 2009-2015 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
|
* Copyright 2009-2015 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
|
||||||
* Available under MIT license <https://lodash.com/license>
|
* Available under MIT license <https://lodash.com/license>
|
||||||
*/
|
*/
|
||||||
var toIterable = require('lodash._toiterable'),
|
var baseCallback = require('lodash._basecallback'),
|
||||||
|
baseEach = require('lodash._baseeach'),
|
||||||
|
isIterateeCall = require('lodash._isiterateecall'),
|
||||||
|
toIterable = require('lodash._toiterable'),
|
||||||
isArray = require('lodash.isarray');
|
isArray = require('lodash.isarray');
|
||||||
|
|
||||||
|
/**
|
||||||
|
* A specialized version of `_.sum` for arrays without support for callback
|
||||||
|
* shorthands and `this` binding..
|
||||||
|
*
|
||||||
|
* @private
|
||||||
|
* @param {Array} array The array to iterate over.
|
||||||
|
* @param {Function} iteratee The function invoked per iteration.
|
||||||
|
* @returns {number} Returns the sum.
|
||||||
|
*/
|
||||||
|
function arraySum(array, iteratee) {
|
||||||
|
var length = array.length,
|
||||||
|
result = 0;
|
||||||
|
|
||||||
|
while (length--) {
|
||||||
|
result += +iteratee(array[length]) || 0;
|
||||||
|
}
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The base implementation of `_.sum` without support for callback shorthands
|
||||||
|
* and `this` binding.
|
||||||
|
*
|
||||||
|
* @private
|
||||||
|
* @param {Array|Object|string} collection The collection to iterate over.
|
||||||
|
* @param {Function} iteratee The function invoked per iteration.
|
||||||
|
* @returns {number} Returns the sum.
|
||||||
|
*/
|
||||||
|
function baseSum(collection, iteratee) {
|
||||||
|
var result = 0;
|
||||||
|
baseEach(collection, function(value, index, collection) {
|
||||||
|
result += +iteratee(value, index, collection) || 0;
|
||||||
|
});
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Gets the sum of the values in `collection`.
|
* Gets the sum of the values in `collection`.
|
||||||
*
|
*
|
||||||
@@ -16,26 +55,39 @@ var toIterable = require('lodash._toiterable'),
|
|||||||
* @memberOf _
|
* @memberOf _
|
||||||
* @category Math
|
* @category Math
|
||||||
* @param {Array|Object|string} collection The collection to iterate over.
|
* @param {Array|Object|string} collection The collection to iterate over.
|
||||||
|
* @param {Function|Object|string} [iteratee] The function invoked per iteration.
|
||||||
|
* @param {*} [thisArg] The `this` binding of `iteratee`.
|
||||||
* @returns {number} Returns the sum.
|
* @returns {number} Returns the sum.
|
||||||
* @example
|
* @example
|
||||||
*
|
*
|
||||||
* _.sum([4, 6, 2]);
|
* _.sum([4, 6]);
|
||||||
* // => 12
|
* // => 10
|
||||||
*
|
*
|
||||||
* _.sum({ 'a': 4, 'b': 6, 'c': 2 });
|
* _.sum({ 'a': 4, 'b': 6 });
|
||||||
* // => 12
|
* // => 10
|
||||||
|
*
|
||||||
|
* var objects = [
|
||||||
|
* { 'n': 4 },
|
||||||
|
* { 'n': 6 }
|
||||||
|
* ];
|
||||||
|
*
|
||||||
|
* _.sum(objects, function(object) {
|
||||||
|
* return object.n;
|
||||||
|
* });
|
||||||
|
* // => 10
|
||||||
|
*
|
||||||
|
* // using the `_.property` callback shorthand
|
||||||
|
* _.sum(objects, 'n');
|
||||||
|
* // => 10
|
||||||
*/
|
*/
|
||||||
function sum(collection) {
|
function sum(collection, iteratee, thisArg) {
|
||||||
if (!isArray(collection)) {
|
if (thisArg && isIterateeCall(collection, iteratee, thisArg)) {
|
||||||
collection = toIterable(collection);
|
iteratee = undefined;
|
||||||
}
|
}
|
||||||
var length = collection.length,
|
iteratee = baseCallback(iteratee, thisArg, 3);
|
||||||
result = 0;
|
return iteratee.length == 1
|
||||||
|
? arraySum(isArray(collection) ? collection : toIterable(collection), iteratee)
|
||||||
while (length--) {
|
: baseSum(collection, iteratee);
|
||||||
result += +collection[length] || 0;
|
|
||||||
}
|
|
||||||
return result;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
module.exports = sum;
|
module.exports = sum;
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "lodash.sum",
|
"name": "lodash.sum",
|
||||||
"version": "3.4.0",
|
"version": "3.6.2",
|
||||||
"description": "The modern build of lodash’s `_.sum` as a module.",
|
"description": "The modern build of lodash’s `_.sum` as a module.",
|
||||||
"homepage": "https://lodash.com/",
|
"homepage": "https://lodash.com/",
|
||||||
"icon": "https://lodash.com/icon.svg",
|
"icon": "https://lodash.com/icon.svg",
|
||||||
@@ -17,7 +17,11 @@
|
|||||||
"repository": "lodash/lodash",
|
"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": {
|
"dependencies": {
|
||||||
|
"lodash._basecallback": "^3.0.0",
|
||||||
|
"lodash._baseeach": "^3.0.0",
|
||||||
|
"lodash._isiterateecall": "^3.0.0",
|
||||||
"lodash._toiterable": "^3.0.0",
|
"lodash._toiterable": "^3.0.0",
|
||||||
"lodash.isarray": "^3.0.0"
|
"lodash.isarray": "^3.0.0",
|
||||||
|
"lodash.keys": "^3.0.0"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
22
lodash.template/LICENSE
Normal file
22
lodash.template/LICENSE
Normal file
@@ -0,0 +1,22 @@
|
|||||||
|
Copyright 2012-2015 The Dojo Foundation <http://dojofoundation.org/>
|
||||||
|
Based on Underscore.js, copyright 2009-2015 Jeremy Ashkenas,
|
||||||
|
DocumentCloud and Investigative Reporters & Editors <http://underscorejs.org/>
|
||||||
|
|
||||||
|
Permission is hereby granted, free of charge, to any person obtaining
|
||||||
|
a copy of this software and associated documentation files (the
|
||||||
|
"Software"), to deal in the Software without restriction, including
|
||||||
|
without limitation the rights to use, copy, modify, merge, publish,
|
||||||
|
distribute, sublicense, and/or sell copies of the Software, and to
|
||||||
|
permit persons to whom the Software is furnished to do so, subject to
|
||||||
|
the following conditions:
|
||||||
|
|
||||||
|
The above copyright notice and this permission notice shall be
|
||||||
|
included in all copies or substantial portions of the Software.
|
||||||
|
|
||||||
|
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
||||||
|
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
||||||
|
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
||||||
|
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
||||||
|
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
||||||
|
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
||||||
|
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
# lodash.template v3.4.0
|
# lodash.template v3.6.2
|
||||||
|
|
||||||
The [modern build](https://github.com/lodash/lodash/wiki/Build-Differences) of [lodash’s](https://lodash.com/) `_.template` exported as a [Node.js](http://nodejs.org/)/[io.js](https://iojs.org/) module.
|
The [modern build](https://github.com/lodash/lodash/wiki/Build-Differences) of [lodash’s](https://lodash.com/) `_.template` exported as a [Node.js](http://nodejs.org/)/[io.js](https://iojs.org/) module.
|
||||||
|
|
||||||
@@ -17,4 +17,4 @@ In Node.js/io.js:
|
|||||||
var template = require('lodash.template');
|
var template = require('lodash.template');
|
||||||
```
|
```
|
||||||
|
|
||||||
See the [documentation](https://lodash.com/docs#template) or [package source](https://github.com/lodash/lodash/blob/3.4.0-npm-packages/lodash.template) for more details.
|
See the [documentation](https://lodash.com/docs#template) or [package source](https://github.com/lodash/lodash/blob/3.6.2-npm-packages/lodash.template) for more details.
|
||||||
|
|||||||
@@ -1,8 +1,8 @@
|
|||||||
/**
|
/**
|
||||||
* lodash 3.4.0 (Custom Build) <https://lodash.com/>
|
* lodash 3.6.2 (Custom Build) <https://lodash.com/>
|
||||||
* Build: `lodash modern modularize exports="npm" -o ./`
|
* Build: `lodash modern modularize exports="npm" -o ./`
|
||||||
* Copyright 2012-2015 The Dojo Foundation <http://dojofoundation.org/>
|
* Copyright 2012-2015 The Dojo Foundation <http://dojofoundation.org/>
|
||||||
* Based on Underscore.js 1.8.2 <http://underscorejs.org/LICENSE>
|
* Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE>
|
||||||
* Copyright 2009-2015 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
|
* Copyright 2009-2015 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
|
||||||
* Available under MIT license <https://lodash.com/license>
|
* Available under MIT license <https://lodash.com/license>
|
||||||
*/
|
*/
|
||||||
@@ -11,7 +11,6 @@ var baseCopy = require('lodash._basecopy'),
|
|||||||
baseValues = require('lodash._basevalues'),
|
baseValues = require('lodash._basevalues'),
|
||||||
isIterateeCall = require('lodash._isiterateecall'),
|
isIterateeCall = require('lodash._isiterateecall'),
|
||||||
reInterpolate = require('lodash._reinterpolate'),
|
reInterpolate = require('lodash._reinterpolate'),
|
||||||
escape = require('lodash.escape'),
|
|
||||||
keys = require('lodash.keys'),
|
keys = require('lodash.keys'),
|
||||||
restParam = require('lodash.restparam'),
|
restParam = require('lodash.restparam'),
|
||||||
templateSettings = require('lodash.templatesettings');
|
templateSettings = require('lodash.templatesettings');
|
||||||
@@ -24,9 +23,7 @@ var reEmptyStringLeading = /\b__p \+= '';/g,
|
|||||||
reEmptyStringMiddle = /\b(__p \+=) '' \+/g,
|
reEmptyStringMiddle = /\b(__p \+=) '' \+/g,
|
||||||
reEmptyStringTrailing = /(__e\(.*?\)|\b__t\)) \+\n'';/g;
|
reEmptyStringTrailing = /(__e\(.*?\)|\b__t\)) \+\n'';/g;
|
||||||
|
|
||||||
/**
|
/** Used to match [ES template delimiters](http://ecma-international.org/ecma-262/6.0/#sec-template-literal-lexical-components). */
|
||||||
* Used to match [ES template delimiters](https://people.mozilla.org/~jorendorff/es6-draft.html#sec-template-literal-lexical-components).
|
|
||||||
*/
|
|
||||||
var reEsTemplate = /\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g;
|
var reEsTemplate = /\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g;
|
||||||
|
|
||||||
/** Used to ensure capturing order of template delimiters. */
|
/** Used to ensure capturing order of template delimiters. */
|
||||||
@@ -46,8 +43,7 @@ var stringEscapes = {
|
|||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Used by `_.template` to escape characters for inclusion in compiled
|
* Used by `_.template` to escape characters for inclusion in compiled string literals.
|
||||||
* string literals.
|
|
||||||
*
|
*
|
||||||
* @private
|
* @private
|
||||||
* @param {string} chr The matched character to escape.
|
* @param {string} chr The matched character to escape.
|
||||||
@@ -75,7 +71,7 @@ var objectProto = Object.prototype;
|
|||||||
var hasOwnProperty = objectProto.hasOwnProperty;
|
var hasOwnProperty = objectProto.hasOwnProperty;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Used to resolve the [`toStringTag`](https://people.mozilla.org/~jorendorff/es6-draft.html#sec-object.prototype.tostring)
|
* Used to resolve the [`toStringTag`](http://ecma-international.org/ecma-262/6.0/#sec-object.prototype.tostring)
|
||||||
* of values.
|
* of values.
|
||||||
*/
|
*/
|
||||||
var objToString = objectProto.toString;
|
var objToString = objectProto.toString;
|
||||||
@@ -83,7 +79,7 @@ var objToString = objectProto.toString;
|
|||||||
/**
|
/**
|
||||||
* Used by `_.template` to customize its `_.assign` use.
|
* Used by `_.template` to customize its `_.assign` use.
|
||||||
*
|
*
|
||||||
* **Note:** This method is like `assignDefaults` except that it ignores
|
* **Note:** This function is like `assignDefaults` except that it ignores
|
||||||
* inherited property values when checking if a property is `undefined`.
|
* inherited property values when checking if a property is `undefined`.
|
||||||
*
|
*
|
||||||
* @private
|
* @private
|
||||||
@@ -94,27 +90,25 @@ var objToString = objectProto.toString;
|
|||||||
* @returns {*} Returns the value to assign to the destination object.
|
* @returns {*} Returns the value to assign to the destination object.
|
||||||
*/
|
*/
|
||||||
function assignOwnDefaults(objectValue, sourceValue, key, object) {
|
function assignOwnDefaults(objectValue, sourceValue, key, object) {
|
||||||
return (typeof objectValue == 'undefined' || !hasOwnProperty.call(object, key))
|
return (objectValue === undefined || !hasOwnProperty.call(object, key))
|
||||||
? sourceValue
|
? sourceValue
|
||||||
: objectValue;
|
: objectValue;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The base implementation of `_.assign` without support for argument juggling,
|
* A specialized version of `_.assign` for customizing assigned values without
|
||||||
* multiple sources, and `this` binding `customizer` functions.
|
* support for argument juggling, multiple sources, and `this` binding `customizer`
|
||||||
|
* functions.
|
||||||
*
|
*
|
||||||
* @private
|
* @private
|
||||||
* @param {Object} object The destination object.
|
* @param {Object} object The destination object.
|
||||||
* @param {Object} source The source object.
|
* @param {Object} source The source object.
|
||||||
* @param {Function} [customizer] The function to customize assigning values.
|
* @param {Function} customizer The function to customize assigned values.
|
||||||
* @returns {Object} Returns the destination object.
|
* @returns {Object} Returns `object`.
|
||||||
*/
|
*/
|
||||||
function baseAssign(object, source, customizer) {
|
function assignWith(object, source, customizer) {
|
||||||
var props = keys(source);
|
|
||||||
if (!customizer) {
|
|
||||||
return baseCopy(source, object, props);
|
|
||||||
}
|
|
||||||
var index = -1,
|
var index = -1,
|
||||||
|
props = keys(source),
|
||||||
length = props.length;
|
length = props.length;
|
||||||
|
|
||||||
while (++index < length) {
|
while (++index < length) {
|
||||||
@@ -123,13 +117,28 @@ function baseAssign(object, source, customizer) {
|
|||||||
result = customizer(value, source[key], key, object, source);
|
result = customizer(value, source[key], key, object, source);
|
||||||
|
|
||||||
if ((result === result ? (result !== value) : (value === value)) ||
|
if ((result === result ? (result !== value) : (value === value)) ||
|
||||||
(typeof value == 'undefined' && !(key in object))) {
|
(value === undefined && !(key in object))) {
|
||||||
object[key] = result;
|
object[key] = result;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return object;
|
return object;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The base implementation of `_.assign` without support for argument juggling,
|
||||||
|
* multiple sources, and `customizer` functions.
|
||||||
|
*
|
||||||
|
* @private
|
||||||
|
* @param {Object} object The destination object.
|
||||||
|
* @param {Object} source The source object.
|
||||||
|
* @returns {Object} Returns `object`.
|
||||||
|
*/
|
||||||
|
function baseAssign(object, source) {
|
||||||
|
return source == null
|
||||||
|
? object
|
||||||
|
: baseCopy(source, keys(source), object);
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Checks if `value` is an `Error`, `EvalError`, `RangeError`, `ReferenceError`,
|
* Checks if `value` is an `Error`, `EvalError`, `RangeError`, `ReferenceError`,
|
||||||
* `SyntaxError`, `TypeError`, or `URIError` object.
|
* `SyntaxError`, `TypeError`, or `URIError` object.
|
||||||
@@ -253,12 +262,12 @@ function template(string, options, otherOptions) {
|
|||||||
var settings = templateSettings.imports._.templateSettings || templateSettings;
|
var settings = templateSettings.imports._.templateSettings || templateSettings;
|
||||||
|
|
||||||
if (otherOptions && isIterateeCall(string, options, otherOptions)) {
|
if (otherOptions && isIterateeCall(string, options, otherOptions)) {
|
||||||
options = otherOptions = null;
|
options = otherOptions = undefined;
|
||||||
}
|
}
|
||||||
string = baseToString(string);
|
string = baseToString(string);
|
||||||
options = baseAssign(baseAssign({}, otherOptions || options), settings, assignOwnDefaults);
|
options = assignWith(baseAssign({}, otherOptions || options), settings, assignOwnDefaults);
|
||||||
|
|
||||||
var imports = baseAssign(baseAssign({}, options.imports), settings.imports, assignOwnDefaults),
|
var imports = assignWith(baseAssign({}, options.imports), settings.imports, assignOwnDefaults),
|
||||||
importsKeys = keys(imports),
|
importsKeys = keys(imports),
|
||||||
importsValues = baseValues(imports, importsKeys);
|
importsValues = baseValues(imports, importsKeys);
|
||||||
|
|
||||||
@@ -351,7 +360,7 @@ function template(string, options, otherOptions) {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Attempts to invoke `func`, returning either the result or the caught error
|
* Attempts to invoke `func`, returning either the result or the caught error
|
||||||
* object. Any additional arguments are provided to `func` when it is invoked.
|
* object. Any additional arguments are provided to `func` when it's invoked.
|
||||||
*
|
*
|
||||||
* @static
|
* @static
|
||||||
* @memberOf _
|
* @memberOf _
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "lodash.template",
|
"name": "lodash.template",
|
||||||
"version": "3.4.0",
|
"version": "3.6.2",
|
||||||
"description": "The modern build of lodash’s `_.template` as a module.",
|
"description": "The modern build of lodash’s `_.template` as a module.",
|
||||||
"homepage": "https://lodash.com/",
|
"homepage": "https://lodash.com/",
|
||||||
"icon": "https://lodash.com/icon.svg",
|
"icon": "https://lodash.com/icon.svg",
|
||||||
|
|||||||
Reference in New Issue
Block a user