angular-promise-extras.js
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
  }
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
  }
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 }
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.
Called with an array this acts like map otherwise it acts like _ . mapValues in lodash .