From 8cb27b6987255b4cf827a8e9d88534fb3832ff9d Mon Sep 17 00:00:00 2001 From: Justin Ridgewell Date: Fri, 20 Feb 2015 11:56:12 -0500 Subject: [PATCH] Alias mapObject to mapValues For the record, I like `_.mapObject` better. But this change was undiscussed. Re: https://github.com/jashkenas/underscore/issues/2061, 4f771e0 --- index.html | 1 + underscore.js | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/index.html b/index.html index a5d9ec206..24b227505 100644 --- a/index.html +++ b/index.html @@ -1381,6 +1381,7 @@

Object Functions

mapObject_.mapObject(object, iteratee, [context]) + Alias: mapValues
Like map, but for objects. Transform the value of each property in turn. diff --git a/underscore.js b/underscore.js index 9db5560d7..824b3f781 100644 --- a/underscore.js +++ b/underscore.js @@ -993,7 +993,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,