code: function(obj, callback) {
      if (angular.isArray(obj))
        return obj.map(callback)
  
      var ret = {}
      Object.keys(obj).forEach(function(key, val) {
        ret[key] = callback(obj[key], key)
      })
      return ret
    }
docs: Called with an array this acts like map, otherwise it acts like _.mapValues
  in lodash.
  @return {Array|Object} The same type as the input argument.