mammoth-style
Version:
Convert Word documents (.docx files) to HTML (with style)
27 lines (22 loc) • 803 B
JavaScript
var _ = require("underscore");
var bluebird = require("bluebird/js/release/promise")();
exports.defer = bluebird.defer;
exports.when = bluebird.resolve;
exports.resolve = bluebird.resolve;
exports.all = bluebird.all;
exports.props = bluebird.props;
exports.reject = bluebird.reject;
exports.promisify = bluebird.promisify;
exports.mapSeries = bluebird.mapSeries;
exports.nfcall = function(func) {
var args = Array.prototype.slice.call(arguments, 1);
var promisedFunc = bluebird.promisify(func);
return promisedFunc.apply(null, args);
};
bluebird.prototype.fail = bluebird.prototype.caught;
bluebird.prototype.also = function(func) {
return this.then(function(value) {
var returnValue = _.extend({}, value, func(value));
return bluebird.props(returnValue);
});
};