'use strict';

var wrapAsync = require('../../../_virtual/wrapAsync.js');
var asyncify = require('../asyncify.js');

var hasRequiredWrapAsync;

function requireWrapAsync () {
	if (hasRequiredWrapAsync) return wrapAsync.__exports;
	hasRequiredWrapAsync = 1;

	Object.defineProperty(wrapAsync.__exports, "__esModule", {
	    value: true
	});
	wrapAsync.__exports.isAsyncIterable = wrapAsync.__exports.isAsyncGenerator = wrapAsync.__exports.isAsync = undefined;

	var _asyncify = asyncify.__require();

	var _asyncify2 = _interopRequireDefault(_asyncify);

	function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

	function isAsync(fn) {
	    return fn[Symbol.toStringTag] === 'AsyncFunction';
	}

	function isAsyncGenerator(fn) {
	    return fn[Symbol.toStringTag] === 'AsyncGenerator';
	}

	function isAsyncIterable(obj) {
	    return typeof obj[Symbol.asyncIterator] === 'function';
	}

	function wrapAsync$1(asyncFn) {
	    if (typeof asyncFn !== 'function') throw new Error('expected a function');
	    return isAsync(asyncFn) ? (0, _asyncify2.default)(asyncFn) : asyncFn;
	}

	wrapAsync.__exports.default = wrapAsync$1;
	wrapAsync.__exports.isAsync = isAsync;
	wrapAsync.__exports.isAsyncGenerator = isAsyncGenerator;
	wrapAsync.__exports.isAsyncIterable = isAsyncIterable;
	return wrapAsync.__exports;
}

exports.__require = requireWrapAsync;
