knex/lib/promise.js

15 lines
505 B
JavaScript
Raw Normal View History

2013-12-27 14:44:21 -05:00
// TODO: replace with the bookshelf copy
var Promise = require('bluebird/js/main/promise')();
2013-12-27 14:44:21 -05:00
Promise.prototype.yield = Promise.prototype.thenReturn;
Promise.prototype.tap = function(handler) {
2013-12-27 14:44:21 -05:00
return this.then(handler).thenReturn(this);
};
Promise.prototype.ensure = Promise.prototype.lastly;
Promise.prototype.otherwise = Promise.prototype.caught;
2013-12-27 14:44:21 -05:00
Promise.prototype.exec = Promise.prototype.nodeify;
Promise.resolve = Promise.fulfilled;
Promise.reject = Promise.rejected;
2013-12-27 14:44:21 -05:00
module.exports = Promise;