From bbc20f983e1cc1aa3c1a3e94952898bb53992c94 Mon Sep 17 00:00:00 2001 From: jdalton Date: Sun, 28 Jun 2015 22:15:17 -0700 Subject: [PATCH] Bump to v3.6.2. --- README.md | 2 +- lodash.sum/{LICENSE.txt => LICENSE} | 0 lodash.sum/README.md | 4 ++-- lodash.sum/index.js | 20 ++++++++++---------- lodash.sum/package.json | 2 +- lodash.template/{LICENSE.txt => LICENSE} | 0 lodash.template/README.md | 4 ++-- lodash.template/index.js | 13 ++++++------- lodash.template/package.json | 2 +- 9 files changed, 23 insertions(+), 24 deletions(-) rename lodash.sum/{LICENSE.txt => LICENSE} (100%) rename lodash.template/{LICENSE.txt => LICENSE} (100%) diff --git a/README.md b/README.md index d6989d7ca..b44f03593 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -# lodash v3.6.1 +# lodash v3.6.2 The [lodash](https://lodash.com/) library exported as [npm packages](https://www.npmjs.com/browse/keyword/lodash-modularized) per method. diff --git a/lodash.sum/LICENSE.txt b/lodash.sum/LICENSE similarity index 100% rename from lodash.sum/LICENSE.txt rename to lodash.sum/LICENSE diff --git a/lodash.sum/README.md b/lodash.sum/README.md index 825f277ac..0b2f92b4b 100644 --- a/lodash.sum/README.md +++ b/lodash.sum/README.md @@ -1,4 +1,4 @@ -# lodash.sum v3.6.1 +# 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. @@ -17,4 +17,4 @@ In Node.js/io.js: var sum = require('lodash.sum'); ``` -See the [documentation](https://lodash.com/docs#sum) or [package source](https://github.com/lodash/lodash/blob/3.6.1-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. diff --git a/lodash.sum/index.js b/lodash.sum/index.js index e098fd28e..b7b087401 100644 --- a/lodash.sum/index.js +++ b/lodash.sum/index.js @@ -1,5 +1,5 @@ /** - * lodash 3.6.1 (Custom Build) + * lodash 3.6.2 (Custom Build) * Build: `lodash modern modularize exports="npm" -o ./` * Copyright 2012-2015 The Dojo Foundation * Based on Underscore.js 1.8.3 @@ -13,18 +13,20 @@ var baseCallback = require('lodash._basecallback'), isArray = require('lodash.isarray'); /** - * A specialized version of `_.sum` for arrays without support for iteratees. + * 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) { +function arraySum(array, iteratee) { var length = array.length, result = 0; while (length--) { - result += +array[length] || 0; + result += +iteratee(array[length]) || 0; } return result; } @@ -80,13 +82,11 @@ function baseSum(collection, iteratee) { */ function sum(collection, iteratee, thisArg) { if (thisArg && isIterateeCall(collection, iteratee, thisArg)) { - iteratee = null; + iteratee = undefined; } - var noIteratee = iteratee == null; - - iteratee = noIteratee ? iteratee : baseCallback(iteratee, thisArg, 3); - return noIteratee - ? arraySum(isArray(collection) ? collection : toIterable(collection)) + iteratee = baseCallback(iteratee, thisArg, 3); + return iteratee.length == 1 + ? arraySum(isArray(collection) ? collection : toIterable(collection), iteratee) : baseSum(collection, iteratee); } diff --git a/lodash.sum/package.json b/lodash.sum/package.json index d9c15945f..dadffa53b 100644 --- a/lodash.sum/package.json +++ b/lodash.sum/package.json @@ -1,6 +1,6 @@ { "name": "lodash.sum", - "version": "3.6.1", + "version": "3.6.2", "description": "The modern build of lodash’s `_.sum` as a module.", "homepage": "https://lodash.com/", "icon": "https://lodash.com/icon.svg", diff --git a/lodash.template/LICENSE.txt b/lodash.template/LICENSE similarity index 100% rename from lodash.template/LICENSE.txt rename to lodash.template/LICENSE diff --git a/lodash.template/README.md b/lodash.template/README.md index 633f43525..f542f713b 100644 --- a/lodash.template/README.md +++ b/lodash.template/README.md @@ -1,4 +1,4 @@ -# lodash.template v3.6.1 +# 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. @@ -17,4 +17,4 @@ In Node.js/io.js: var template = require('lodash.template'); ``` -See the [documentation](https://lodash.com/docs#template) or [package source](https://github.com/lodash/lodash/blob/3.6.1-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. diff --git a/lodash.template/index.js b/lodash.template/index.js index e643c2836..922bfc257 100644 --- a/lodash.template/index.js +++ b/lodash.template/index.js @@ -1,5 +1,5 @@ /** - * lodash 3.6.1 (Custom Build) + * lodash 3.6.2 (Custom Build) * Build: `lodash modern modularize exports="npm" -o ./` * Copyright 2012-2015 The Dojo Foundation * Based on Underscore.js 1.8.3 @@ -23,7 +23,7 @@ var reEmptyStringLeading = /\b__p \+= '';/g, reEmptyStringMiddle = /\b(__p \+=) '' \+/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](http://ecma-international.org/ecma-262/6.0/#sec-template-literal-lexical-components). */ var reEsTemplate = /\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g; /** Used to ensure capturing order of template delimiters. */ @@ -43,8 +43,7 @@ var stringEscapes = { }; /** - * Used by `_.template` to escape characters for inclusion in compiled - * string literals. + * Used by `_.template` to escape characters for inclusion in compiled string literals. * * @private * @param {string} chr The matched character to escape. @@ -72,7 +71,7 @@ var objectProto = Object.prototype; 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. */ var objToString = objectProto.toString; @@ -263,7 +262,7 @@ function template(string, options, otherOptions) { var settings = templateSettings.imports._.templateSettings || templateSettings; if (otherOptions && isIterateeCall(string, options, otherOptions)) { - options = otherOptions = null; + options = otherOptions = undefined; } string = baseToString(string); options = assignWith(baseAssign({}, otherOptions || options), settings, assignOwnDefaults); @@ -361,7 +360,7 @@ function template(string, options, otherOptions) { /** * 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 * @memberOf _ diff --git a/lodash.template/package.json b/lodash.template/package.json index f0a363623..88bb748e2 100644 --- a/lodash.template/package.json +++ b/lodash.template/package.json @@ -1,6 +1,6 @@ { "name": "lodash.template", - "version": "3.6.1", + "version": "3.6.2", "description": "The modern build of lodash’s `_.template` as a module.", "homepage": "https://lodash.com/", "icon": "https://lodash.com/icon.svg",