Skip to content

Commit

Permalink
Alias mapObject to mapValues
Browse files Browse the repository at this point in the history
For the record, I like `_.mapObject` better. But this change was
undiscussed.

Re: #2061, 4f771e0
  • Loading branch information
jridgewell committed Feb 20, 2015
1 parent 6dff42a commit a0fd6a0
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
1 change: 1 addition & 0 deletions index.html
Expand Up @@ -1370,6 +1370,7 @@ <h2 id="objects">Object Functions</h2>

<p id="mapObject">
<b class="header">mapObject</b><code>_.mapObject(array, iteratee, [context])</code>
<span class="alias">Alias: <b>mapValues</b></span>
<br />
Like <a href="#map">map</a>, but for objects. Transform the value
of each property in turn.
Expand Down
2 changes: 1 addition & 1 deletion underscore.js
Expand Up @@ -951,7 +951,7 @@

// Returns the results of applying the iteratee to each element of the object
// In contrast to _.map it returns an object
_.mapObject = function(obj, iteratee, context) {
_.mapObject =_.mapValues = function(obj, iteratee, context) {
iteratee = cb(iteratee, context);
var keys = _.keys(obj),
length = keys.length,
Expand Down

0 comments on commit a0fd6a0

Please sign in to comment.