Last change
on this file since 76712b2 was 6a3a178, checked in by Ema <ema_spirova@…>, 3 years ago |
initial commit
|
-
Property mode
set to
100644
|
File size:
495 bytes
|
Rev | Line | |
---|
[6a3a178] | 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 |
---|
Note:
See
TracBrowser
for help on using the repository browser.