1 |
3a515b92
|
cagy
|
'use strict';
|
2 |
|
|
|
3 |
|
|
Object.defineProperty(exports, "__esModule", {
|
4 |
|
|
value: true
|
5 |
|
|
});
|
6 |
|
|
exports.isAsync = undefined;
|
7 |
|
|
|
8 |
|
|
var _asyncify = require('../asyncify');
|
9 |
|
|
|
10 |
|
|
var _asyncify2 = _interopRequireDefault(_asyncify);
|
11 |
|
|
|
12 |
|
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
13 |
|
|
|
14 |
|
|
var supportsSymbol = typeof Symbol === 'function';
|
15 |
|
|
|
16 |
|
|
function isAsync(fn) {
|
17 |
|
|
return supportsSymbol && fn[Symbol.toStringTag] === 'AsyncFunction';
|
18 |
|
|
}
|
19 |
|
|
|
20 |
|
|
function wrapAsync(asyncFn) {
|
21 |
|
|
return isAsync(asyncFn) ? (0, _asyncify2.default)(asyncFn) : asyncFn;
|
22 |
|
|
}
|
23 |
|
|
|
24 |
|
|
exports.default = wrapAsync;
|
25 |
|
|
exports.isAsync = isAsync;
|