src/async/makeAsyncFunc.js
function makeAsyncFunc(config) {
    // Validate the specified configuration
    config.validate();
    // Create an async function tailored to the given options.
    var result = function async(bodyFunc) {
        // Create a semaphore for limiting top-level concurrency, if specified in options.
        var semaphore = config.maxConcurrency ? new Semaphore(config.maxConcurrency) : Semaphore.unlimited;
        // Choose and run the appropriate function factory based on whether the result should be iterable.
        var makeFunc = config.isIterable ? makeAsyncIterator : makeAsyncNonIterator;
        var result = makeFunc(bodyFunc, config, semaphore);
        // Ensure the suspendable function's arity matches that of the function it wraps.
        var arity = bodyFunc.length;
        if (config.acceptsCallback)
            ++arity;
        result = makeFuncWithArity(result, arity);
        return result;
    };
    // Add the mod() function, and return the result.
    result.mod = makeModFunc(config);
    return result;
}
function makeAsyncFunc(config) {
    // Validate the specified configuration
    config.validate();
    // Create an async function tailored to the given options.
    var result = function async(bodyFunc) {
        // Create a semaphore for limiting top-level concurrency, if specified in options.
        var semaphore = config.maxConcurrency ? new Semaphore(config.maxConcurrency) : Semaphore.unlimited;
        // Choose and run the appropriate function factory based on whether the result should be iterable.
        var makeFunc = config.isIterable ? makeAsyncIterator : makeAsyncNonIterator;
        var result = makeFunc(bodyFunc, config, semaphore);
        // Ensure the suspendable function's arity matches that of the function it wraps.
        var arity = bodyFunc.length;
        if (config.acceptsCallback)
            ++arity;
        result = makeFuncWithArity(result, arity);
        return result;
    };
    // Add the mod() function, and return the result.
    result.mod = makeModFunc(config);
    return result;
}
Function for creating a specific variant of the async function.