Ohm-Management - Projektarbeit B-ME
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

wrapAsync.js 616B

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