lodash._createaggregator
Advanced tools
+24
-23
| /** | ||
| * Lo-Dash 2.4.1 (Custom Build) <http://lodash.com/> | ||
| * Build: `lodash modularize modern exports="npm" -o ./npm/` | ||
| * Copyright 2012-2013 The Dojo Foundation <http://dojofoundation.org/> | ||
| * Based on Underscore.js 1.5.2 <http://underscorejs.org/LICENSE> | ||
| * Copyright 2009-2013 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors | ||
| * Available under MIT license <http://lodash.com/license> | ||
| * lodash 3.0.0 (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.7.0 <http://underscorejs.org/LICENSE> | ||
| * Copyright 2009-2015 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors | ||
| * Available under MIT license <https://lodash.com/license> | ||
| */ | ||
| var createCallback = require('lodash.createcallback'), | ||
| forOwn = require('lodash.forown'), | ||
| var baseCallback = require('lodash._basecallback'), | ||
| baseEach = require('lodash._baseeach'), | ||
| isArray = require('lodash.isarray'); | ||
| /** | ||
| * Creates a function that aggregates a collection, creating an object composed | ||
| * of keys generated from the results of running each element of the collection | ||
| * through a callback. The given `setter` function sets the keys and values | ||
| * of the composed object. | ||
| * Creates a function that aggregates a collection, creating an accumulator | ||
| * object composed from the results of running each element in the collection | ||
| * through an iteratee. The `setter` sets the keys and values of the accumulator | ||
| * object. If `initializer` is provided initializes the accumulator object. | ||
| * | ||
| * @private | ||
| * @param {Function} setter The setter function. | ||
| * @param {Function} setter The function to set keys and values of the accumulator object. | ||
| * @param {Function} [initializer] The function to initialize the accumulator object. | ||
| * @returns {Function} Returns the new aggregator function. | ||
| */ | ||
| function createAggregator(setter) { | ||
| return function(collection, callback, thisArg) { | ||
| var result = {}; | ||
| callback = createCallback(callback, thisArg, 3); | ||
| function createAggregator(setter, initializer) { | ||
| return function(collection, iteratee, thisArg) { | ||
| var result = initializer ? initializer() : {}; | ||
| iteratee = baseCallback(iteratee, thisArg, 3); | ||
| var index = -1, | ||
| length = collection ? collection.length : 0; | ||
| if (isArray(collection)) { | ||
| var index = -1, | ||
| length = collection.length; | ||
| if (typeof length == 'number') { | ||
| while (++index < length) { | ||
| var value = collection[index]; | ||
| setter(result, value, callback(value, index, collection), collection); | ||
| setter(result, value, iteratee(value, index, collection), collection); | ||
| } | ||
| } else { | ||
| forOwn(collection, function(value, key, collection) { | ||
| setter(result, value, callback(value, key, collection), collection); | ||
| baseEach(collection, function(value, key, collection) { | ||
| setter(result, value, iteratee(value, key, collection), collection); | ||
| }); | ||
@@ -40,0 +41,0 @@ } |
+3
-3
@@ -1,3 +0,3 @@ | ||
| Copyright 2012-2013 The Dojo Foundation <http://dojofoundation.org/> | ||
| Based on Underscore.js 1.5.2, copyright 2009-2013 Jeremy Ashkenas, | ||
| Copyright 2012-2015 The Dojo Foundation <http://dojofoundation.org/> | ||
| Based on Underscore.js 1.7.0, copyright 2009-2015 Jeremy Ashkenas, | ||
| DocumentCloud and Investigative Reporters & Editors <http://underscorejs.org/> | ||
@@ -22,2 +22,2 @@ | ||
| 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. |
+11
-9
| { | ||
| "name": "lodash._createaggregator", | ||
| "version": "2.4.1", | ||
| "description": "The internal Lo-Dash function `createAggregator` as a Node.js module generated by lodash-cli.", | ||
| "homepage": "http://lodash.com/custom-builds", | ||
| "version": "3.0.0", | ||
| "description": "The modern build of lodash’s internal `createAggregator` as a module.", | ||
| "homepage": "https://lodash.com/", | ||
| "icon": "https://lodash.com/icon.svg", | ||
| "license": "MIT", | ||
@@ -10,13 +11,14 @@ "author": "John-David Dalton <john.david.dalton@gmail.com> (http://allyoucanleet.com/)", | ||
| "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> (http://mathiasbynens.be/)" | ||
| "Mathias Bynens <mathias@qiwi.be> (https://mathiasbynens.be/)" | ||
| ], | ||
| "bugs": "https://github.com/lodash/lodash-cli/issues", | ||
| "repository": { "type": "git", "url": "https://github.com/lodash/lodash-cli.git" }, | ||
| "repository": "lodash/lodash", | ||
| "scripts": { "test": "echo \"See https://travis-ci.org/lodash/lodash-cli for testing details.\"" }, | ||
| "dependencies": { | ||
| "lodash.createcallback": "~2.4.1", | ||
| "lodash.forown": "~2.4.1", | ||
| "lodash.isarray": "~2.4.1" | ||
| "lodash._basecallback": "^3.0.0", | ||
| "lodash._baseeach": "^3.0.0", | ||
| "lodash.isarray": "^3.0.0" | ||
| } | ||
| } |
+15
-10
@@ -1,15 +0,20 @@ | ||
| # lodash._createaggregator v2.4.1 | ||
| # lodash._createaggregator v3.0.0 | ||
| The internal [Lo-Dash](http://lodash.com/) function `createAggregator` as a [Node.js](http://nodejs.org/) module generated by [lodash-cli](https://npmjs.org/package/lodash-cli). | ||
| The [modern build](https://github.com/lodash/lodash/wiki/Build-Differences) of [lodash’s](https://lodash.com/) internal `createAggregator` exported as a [Node.js](http://nodejs.org/)/[io.js](https://iojs.org/) module. | ||
| ## Author | ||
| ## Installation | ||
| | [](https://twitter.com/jdalton "Follow @jdalton on Twitter") | | ||
| |---| | ||
| | [John-David Dalton](http://allyoucanleet.com/) | | ||
| Using npm: | ||
| ## Contributors | ||
| ```bash | ||
| $ {sudo -H} npm i -g npm | ||
| $ npm i --save lodash._createaggregator | ||
| ``` | ||
| | [](https://twitter.com/blainebublitz "Follow @BlaineBublitz on Twitter") | [](https://twitter.com/kitcambridge "Follow @kitcambridge on Twitter") | [](https://twitter.com/mathias "Follow @mathias on Twitter") | | ||
| |---|---|---| | ||
| | [Blaine Bublitz](http://www.iceddev.com/) | [Kit Cambridge](http://kitcambridge.be/) | [Mathias Bynens](http://mathiasbynens.be/) | | ||
| In Node.js/io.js: | ||
| ```js | ||
| var createAggregator = require('lodash._createaggregator'); | ||
| ``` | ||
| See the [package source](https://github.com/lodash/lodash/blob/3.0.0-npm-packages/lodash._createaggregator) for more details. |
No bug tracker
MaintenancePackage does not have a linked bug tracker in package.json.
Found 1 instance in 1 package
No repository
Supply chain riskPackage does not have a linked source code repository. Without this field, a package will have no reference to the location of the source code use to generate the package.
Found 1 instance in 1 package
URL strings
Supply chain riskPackage contains fragments of external URLs or IP addresses, which the package may be accessing at runtime.
Found 1 instance in 1 package
42
2.44%21
31.25%4609
-4.65%2
Infinity%+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
Updated