node-postgres/lib/promise.js
Brian M. Carlson 3a7b226fe3 WIP
2017-06-15 10:32:38 -05:00

13 lines
469 B
JavaScript

const util = require('util')
const deprecationMessage = 'Using the promise result as an event emitter is deprecated and will be removed in pg@8.0'
module.exports = function(emitter, callback) {
const promise = new global.Promise(callback)
promise.on = util.deprecate(function () {
emitter.on.apply(emitter, arguments)
}, deprecationMessage);
promise.once = util.deprecate(function () {
emitter.once.apply(emitter, arguments)
}, deprecationMessage)
}