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