/ cloudformation-templates / node_modules / aws-cdk / node_modules / agent-base / dist / src / promisify.js
promisify.js
1 "use strict"; 2 Object.defineProperty(exports, "__esModule", { value: true }); 3 function promisify(fn) { 4 return function (req, opts) { 5 return new Promise((resolve, reject) => { 6 fn.call(this, req, opts, (err, rtn) => { 7 if (err) { 8 reject(err); 9 } 10 else { 11 resolve(rtn); 12 } 13 }); 14 }); 15 }; 16 } 17 exports.default = promisify; 18 //# sourceMappingURL=promisify.js.map