mirror of
https://github.com/knex/knex.git
synced 2025-07-13 20:10:53 +00:00

When this eventually enabled on the client side, we can build this into the build script.
21 lines
459 B
JavaScript
21 lines
459 B
JavaScript
|
|
var Promise = require('bluebird/js/main/promise')();
|
|
|
|
Promise.prototype.yield = function(value) {
|
|
return this.then(function() {
|
|
return value;
|
|
});
|
|
};
|
|
|
|
Promise.prototype.tap = function(handler) {
|
|
return this.then(handler).yield(this);
|
|
};
|
|
|
|
Promise.prototype.ensure = Promise.prototype.lastly;
|
|
Promise.prototype.otherwise = Promise.prototype.caught;
|
|
|
|
Promise.resolve = Promise.fulfilled;
|
|
Promise.reject = Promise.rejected;
|
|
|
|
exports.Promise = Promise;
|