Bump to v3.5.0.

This commit is contained in:
John-David Dalton
2016-04-20 22:58:17 -07:00
parent 5afdc7b263
commit a9ec8d953c
23 changed files with 312 additions and 253 deletions

View File

@@ -1,4 +1,4 @@
# lodash v3.4.4 # lodash v3.5.0
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.

View File

@@ -1,4 +1,4 @@
# lodash._basesortbyorder v3.4.1 # lodash._basesortbyorder v3.5.0
The [modern build](https://github.com/lodash/lodash/wiki/Build-Differences) of [lodashs](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 [lodashs](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.0-npm-packages/lodash._basesortbyorder) for more details.

View File

@@ -1,12 +1,14 @@
/** /**
* lodash 3.4.1 (Custom Build) <https://lodash.com/> * lodash 3.5.0 (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');
@@ -14,7 +16,7 @@ var baseCompareAscending = require('lodash._basecompareascending'),
* Used by `_.sortByOrder` to compare multiple properties of each element * Used by `_.sortByOrder` to compare multiple properties of each element
* in a collection and stable sort them in the following order: * in a collection and stable sort them in the following order:
* *
* If orders is unspecified, sort in ascending order for all properties. * If `orders` is unspecified, sort in ascending order for all properties.
* Otherwise, for each property, sort in ascending order if its corresponding value in * Otherwise, for each property, sort in ascending order if its corresponding value in
* orders is true, and descending order if false. * orders is true, and descending order if false.
* *
@@ -56,28 +58,56 @@ function compareMultiple(object, other, orders) {
*/ */
var MAX_SAFE_INTEGER = Math.pow(2, 53) - 1; var MAX_SAFE_INTEGER = Math.pow(2, 53) - 1;
/**
* 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,
length = getLength(collection),
result = isLength(length) ? Array(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,6 +115,18 @@ 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)
* in Safari on iOS 8.1 ARM64.
*
* @private
* @param {Object} object The object to query.
* @returns {*} Returns the "length" value.
*/
var getLength = baseProperty('length');
/** /**
* Checks if `value` is a valid array-like length. * Checks if `value` is a valid array-like length.
* *

View File

@@ -1,6 +1,6 @@
{ {
"name": "lodash._basesortbyorder", "name": "lodash._basesortbyorder",
"version": "3.4.1", "version": "3.5.0",
"description": "The modern build of lodashs internal `baseSortByOrder` as a module.", "description": "The modern build of lodashs 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"

View File

@@ -1,22 +0,0 @@
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.

View File

@@ -1,20 +0,0 @@
# lodash._createcomposer v3.4.1
The [modern build](https://github.com/lodash/lodash/wiki/Build-Differences) of [lodashs](https://lodash.com/) internal `createComposer` 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._createcomposer
```
In Node.js/io.js:
```js
var createComposer = require('lodash._createcomposer');
```
See the [package source](https://github.com/lodash/lodash/blob/3.4.1-npm-packages/lodash._createcomposer) for more details.

View File

@@ -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;

View File

@@ -1,18 +0,0 @@
{
"name": "lodash._createcomposer",
"version": "3.4.1",
"description": "The modern build of lodashs internal `createComposer` as a module.",
"homepage": "https://lodash.com/",
"icon": "https://lodash.com/icon.svg",
"license": "MIT",
"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.\"" }
}

View File

@@ -1,4 +1,4 @@
# lodash.add v3.4.4 # lodash.add v3.5.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.4-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.5.0-npm-packages/lodash.add) for more details.

View File

@@ -1,11 +1,13 @@
/** /**
* lodash 3.4.4 (Custom Build) <https://lodash.com/> * lodash 3.5.0 (Custom Build) <https://lodash.com/>
* Build: `lodash modularize exports="npm" -o ./` * Build: `lodash modularize exports="npm" -o ./`
* Copyright jQuery Foundation and other contributors <https://jquery.org/> * Copyright jQuery Foundation and other contributors <https://jquery.org/>
* Released under MIT license <https://lodash.com/license> * 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 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors * 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. * Creates a function that performs a mathematical operation on two values.
@@ -24,7 +26,17 @@ function createMathOperation(operator) {
result = value; result = value;
} }
if (other !== undefined) { 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; return result;
}; };

View File

@@ -1,6 +1,6 @@
{ {
"name": "lodash.add", "name": "lodash.add",
"version": "3.4.4", "version": "3.5.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",
@@ -13,5 +13,9 @@
"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.11.0",
"lodash._basetostring": "~4.11.0"
}
} }

View File

@@ -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.

View File

@@ -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

View File

@@ -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",

View File

@@ -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.

View File

@@ -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

View File

@@ -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",

View File

@@ -1,4 +1,4 @@
# lodash.sum v3.4.0 # lodash.sum v3.5.0
The [modern build](https://github.com/lodash/lodash/wiki/Build-Differences) of [lodashs](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 [lodashs](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.5.0-npm-packages/lodash.sum) for more details.

View File

@@ -1,14 +1,51 @@
/** /**
* lodash 3.4.0 (Custom Build) <https://lodash.com/> * lodash 3.5.0 (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.2 <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 iteratees.
*
* @private
* @param {Array} array The array to iterate over.
* @returns {number} Returns the sum.
*/
function arraySum(array) {
var length = array.length,
result = 0;
while (length--) {
result += +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 +53,41 @@ 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 = null;
} }
var length = collection.length, var noIteratee = iteratee == null;
result = 0;
while (length--) { iteratee = noIteratee ? iteratee : baseCallback(iteratee, thisArg, 3);
result += +collection[length] || 0; return noIteratee
} ? arraySum(isArray(collection) ? collection : toIterable(collection))
return result; : baseSum(collection, iteratee);
} }
module.exports = sum; module.exports = sum;

View File

@@ -1,6 +1,6 @@
{ {
"name": "lodash.sum", "name": "lodash.sum",
"version": "3.4.0", "version": "3.5.0",
"description": "The modern build of lodashs `_.sum` as a module.", "description": "The modern build of lodashs `_.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,6 +17,9 @@
"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"
} }

View File

@@ -1,4 +1,4 @@
# lodash.template v3.4.0 # lodash.template v3.5.0
The [modern build](https://github.com/lodash/lodash/wiki/Build-Differences) of [lodashs](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 [lodashs](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.5.0-npm-packages/lodash.template) for more details.

View File

@@ -1,8 +1,8 @@
/** /**
* lodash 3.4.0 (Custom Build) <https://lodash.com/> * lodash 3.5.0 (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>
*/ */
@@ -12,6 +12,7 @@ var baseCopy = require('lodash._basecopy'),
isIterateeCall = require('lodash._isiterateecall'), isIterateeCall = require('lodash._isiterateecall'),
reInterpolate = require('lodash._reinterpolate'), reInterpolate = require('lodash._reinterpolate'),
escape = require('lodash.escape'), escape = require('lodash.escape'),
isNative = require('lodash.isnative'),
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 +25,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](https://people.mozilla.org/~jorendorff/es6-draft.html#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. */
@@ -69,7 +68,8 @@ function isObjectLike(value) {
} }
/** Used for native method references. */ /** Used for native method references. */
var objectProto = Object.prototype; var arrayProto = Array.prototype,
objectProto = Object.prototype;
/** Used to check objects for own properties. */ /** Used to check objects for own properties. */
var hasOwnProperty = objectProto.hasOwnProperty; var hasOwnProperty = objectProto.hasOwnProperty;
@@ -80,10 +80,31 @@ var hasOwnProperty = objectProto.hasOwnProperty;
*/ */
var objToString = objectProto.toString; var objToString = objectProto.toString;
/** Native method references. */
var getOwnPropertySymbols = isNative(getOwnPropertySymbols = Object.getOwnPropertySymbols) && getOwnPropertySymbols,
push = arrayProto.push,
preventExtensions = isNative(Object.preventExtensions = Object.preventExtensions) && preventExtensions;
/** Used as `baseAssign`. */
var nativeAssign = (function() {
// Avoid `Object.assign` in Firefox 34-37 which have an early implementation
// with a now defunct try/catch behavior. See https://bugzilla.mozilla.org/show_bug.cgi?id=1103344
// for more details.
//
// Use `Object.preventExtensions` on a plain object instead of simply using
// `Object('x')` because Chrome and IE fail to throw an error when attempting
// to assign values to readonly indexes of strings in strict mode.
var object = { '1': 0 },
func = preventExtensions && isNative(func = Object.assign) && func;
try { func(preventExtensions(object), 'xo'); } catch(e) {}
return !object[1] && func;
}());
/** /**
* 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,26 +115,26 @@ 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); var props = keys(source);
if (!customizer) { push.apply(props, getSymbols(source));
return baseCopy(source, object, props);
}
var index = -1, var index = -1,
length = props.length; length = props.length;
@@ -123,13 +144,50 @@ 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`.
*/
var baseAssign = nativeAssign || function(object, source) {
return source == null
? object
: baseCopy(source, getSymbols(source), baseCopy(source, keys(source), object));
};
/**
* Creates an array of the own symbols of `object`.
*
* @private
* @param {Object} object The object to query.
* @returns {Array} Returns the array of symbols.
*/
var getSymbols = !getOwnPropertySymbols ? constant([]) : function(object) {
return getOwnPropertySymbols(toObject(object));
};
/**
* Converts `value` to an object if it is not one.
*
* @private
* @param {*} value The value to process.
* @returns {Object} Returns the object.
*/
function toObject(value) {
return isObject(value) ? value : Object(value);
}
/** /**
* 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.
@@ -151,6 +209,33 @@ function isError(value) {
return isObjectLike(value) && typeof value.message == 'string' && objToString.call(value) == errorTag; return isObjectLike(value) && typeof value.message == 'string' && objToString.call(value) == errorTag;
} }
/**
* Checks if `value` is the [language type](https://es5.github.io/#x8) of `Object`.
* (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`)
*
* @static
* @memberOf _
* @category Lang
* @param {*} value The value to check.
* @returns {boolean} Returns `true` if `value` is an object, else `false`.
* @example
*
* _.isObject({});
* // => true
*
* _.isObject([1, 2, 3]);
* // => true
*
* _.isObject(1);
* // => false
*/
function isObject(value) {
// Avoid a V8 JIT bug in Chrome 19-20.
// See https://code.google.com/p/v8/issues/detail?id=2291 for more details.
var type = typeof value;
return type == 'function' || (!!value && type == 'object');
}
/** /**
* Creates a compiled template function that can interpolate data properties * Creates a compiled template function that can interpolate data properties
* in "interpolate" delimiters, HTML-escape interpolated data properties in * in "interpolate" delimiters, HTML-escape interpolated data properties in
@@ -256,9 +341,9 @@ function template(string, options, otherOptions) {
options = otherOptions = null; options = otherOptions = null;
} }
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);
@@ -377,4 +462,26 @@ var attempt = restParam(function(func, args) {
} }
}); });
/**
* Creates a function that returns `value`.
*
* @static
* @memberOf _
* @category Utility
* @param {*} value The value to return from the new function.
* @returns {Function} Returns the new function.
* @example
*
* var object = { 'user': 'fred' };
* var getter = _.constant(object);
*
* getter() === object;
* // => true
*/
function constant(value) {
return function() {
return value;
};
}
module.exports = template; module.exports = template;

View File

@@ -1,6 +1,6 @@
{ {
"name": "lodash.template", "name": "lodash.template",
"version": "3.4.0", "version": "3.5.0",
"description": "The modern build of lodashs `_.template` as a module.", "description": "The modern build of lodashs `_.template` as a module.",
"homepage": "https://lodash.com/", "homepage": "https://lodash.com/",
"icon": "https://lodash.com/icon.svg", "icon": "https://lodash.com/icon.svg",
@@ -23,6 +23,7 @@
"lodash._isiterateecall": "^3.0.0", "lodash._isiterateecall": "^3.0.0",
"lodash._reinterpolate": "^3.0.0", "lodash._reinterpolate": "^3.0.0",
"lodash.escape": "^3.0.0", "lodash.escape": "^3.0.0",
"lodash.isnative": "^3.0.0",
"lodash.keys": "^3.0.0", "lodash.keys": "^3.0.0",
"lodash.restparam": "^3.0.0", "lodash.restparam": "^3.0.0",
"lodash.templatesettings": "^3.0.0" "lodash.templatesettings": "^3.0.0"