From 29ad44ba8611d56b3e23af8567ec681a73cc100b 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 2b0025d83..d69e8357f 100644 --- a/index.html +++ b/index.html @@ -1370,6 +1370,7 @@

Object Functions

mapObject_.mapObject(array, 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 d467f7924..4db3199ed 100644 --- a/underscore.js +++ b/underscore.js @@ -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,