lodash.map
Advanced tools
Comparing version 3.0.0 to 3.1.0
46
index.js
/** | ||
* lodash 3.0.0 (Custom Build) <https://lodash.com/> | ||
* lodash 3.1.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> | ||
* Based on Underscore.js 1.8.2 <http://underscorejs.org/LICENSE> | ||
* Copyright 2009-2015 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors | ||
@@ -12,7 +12,8 @@ * Available under MIT license <https://lodash.com/license> | ||
baseEach = require('lodash._baseeach'), | ||
isArray = require('lodash.isarray'); | ||
isArray = require('lodash.isarray'), | ||
keys = require('lodash.keys'); | ||
/** | ||
* The base implementation of `_.map` without support for callback shorthands | ||
* or `this` binding. | ||
* and `this` binding. | ||
* | ||
@@ -35,11 +36,24 @@ * @private | ||
* `iteratee`. The `iteratee` is bound to `thisArg` and invoked with three | ||
* arguments; (value, index|key, collection). | ||
* arguments: (value, index|key, collection). | ||
* | ||
* If a property name is provided for `predicate` the created "_.property" | ||
* If a property name is provided for `iteratee` the created `_.property` | ||
* style callback returns the property value of the given element. | ||
* | ||
* If an object is provided for `predicate` the created "_.matches" style | ||
* If a value is also provided for `thisArg` the created `_.matchesProperty` | ||
* style callback returns `true` for elements that have a matching property | ||
* value, else `false`. | ||
* | ||
* If an object is provided for `iteratee` the created `_.matches` style | ||
* callback returns `true` for elements that have the properties of the given | ||
* object, else `false`. | ||
* | ||
* Many lodash methods are guarded to work as interatees for methods like | ||
* `_.every`, `_.filter`, `_.map`, `_.mapValues`, `_.reject`, and `_.some`. | ||
* | ||
* The guarded methods are: | ||
* `ary`, `callback`, `chunk`, `clone`, `create`, `curry`, `curryRight`, `drop`, | ||
* `dropRight`, `every`, `fill`, `flatten`, `invert`, `max`, `min`, `parseInt`, | ||
* `slice`, `sortBy`, `take`, `takeRight`, `template`, `trim`, `trimLeft`, | ||
* `trimRight`, `trunc`, `random`, `range`, `sample`, `some`, `uniq`, and `words` | ||
* | ||
* @static | ||
@@ -51,4 +65,4 @@ * @memberOf _ | ||
* @param {Function|Object|string} [iteratee=_.identity] The function invoked | ||
* per iteration. If a property name or object is provided it is used to | ||
* create a "_.property" or "_.matches" style callback respectively. | ||
* per iteration. | ||
* create a `_.property` or `_.matches` style callback respectively. | ||
* @param {*} [thisArg] The `this` binding of `iteratee`. | ||
@@ -58,8 +72,12 @@ * @returns {Array} Returns the new mapped array. | ||
* | ||
* _.map([1, 2, 3], function(n) { return n * 3; }); | ||
* // => [3, 6, 9] | ||
* function timesThree(n) { | ||
* return n * 3; | ||
* } | ||
* | ||
* _.map({ 'one': 1, 'two': 2, 'three': 3 }, function(n) { return n * 3; }); | ||
* // => [3, 6, 9] (iteration order is not guaranteed) | ||
* _.map([1, 2], timesThree); | ||
* // => [3, 6] | ||
* | ||
* _.map({ 'a': 1, 'b': 2 }, timesThree); | ||
* // => [3, 6] (iteration order is not guaranteed) | ||
* | ||
* var users = [ | ||
@@ -70,3 +88,3 @@ * { 'user': 'barney' }, | ||
* | ||
* // using the "_.property" callback shorthand | ||
* // using the `_.property` callback shorthand | ||
* _.map(users, 'user'); | ||
@@ -73,0 +91,0 @@ * // => ['barney', 'fred'] |
Copyright 2012-2015 The Dojo Foundation <http://dojofoundation.org/> | ||
Based on Underscore.js 1.7.0, copyright 2009-2015 Jeremy Ashkenas, | ||
Based on Underscore.js, copyright 2009-2015 Jeremy Ashkenas, | ||
DocumentCloud and Investigative Reporters & Editors <http://underscorejs.org/> | ||
@@ -4,0 +4,0 @@ |
{ | ||
"name": "lodash.map", | ||
"version": "3.0.0", | ||
"version": "3.1.0", | ||
"description": "The modern build of lodash’s `_.map` as a module.", | ||
@@ -23,4 +23,5 @@ "homepage": "https://lodash.com/", | ||
"lodash._baseeach": "^3.0.0", | ||
"lodash.isarray": "^3.0.0" | ||
"lodash.isarray": "^3.0.0", | ||
"lodash.keys": "^3.0.0" | ||
} | ||
} |
@@ -1,2 +0,2 @@ | ||
# lodash.map v3.0.0 | ||
# lodash.map v3.1.0 | ||
@@ -20,2 +20,2 @@ The [modern build](https://github.com/lodash/lodash/wiki/Build-Differences) of [lodash’s](https://lodash.com/) `_.map` exported as a [Node.js](http://nodejs.org/)/[io.js](https://iojs.org/) module. | ||
See the [documentation](https://lodash.com/docs#map) or [package source](https://github.com/lodash/lodash/blob/3.0.0-npm-packages/lodash.map) for more details. | ||
See the [documentation](https://lodash.com/docs#map) or [package source](https://github.com/lodash/lodash/blob/3.1.0-npm-packages/lodash.map) for more details. |
6222
91
5
+ Addedlodash.keys@^3.0.0