Skip to content

Instantly share code, notes, and snippets.

View alexferreira's full-sized avatar

Alex Ferreira alexferreira

  • Juster
  • São Paulo, SP
View GitHub Profile
var Promise = require('bluebird');
_ = require('lodash');
/**
* Map an object, or a promise of an object, with the given `mapper` function
* with the signature `(value, key, obj)` where `value` is an object's `key`
* property's value.
*
* If the `mapper` function returns promises or thenables, the returned promise
* will wait for all the mapped results to be resolved as well.