<commit_before>import HTTP
import Routing

@_exported import HTTPRouting
@_exported import TypeSafeRouting

extension Droplet: RouteBuilder {
    public typealias Value = Responder

    public func add(
        path: [String],
        value: Value
    ) {
        router.add(path: path, value: value)
    }
}

extension RouteBuilder where Value == Responder {
    public func group(_ middleware: Middleware ..., closure: (RouteGroup<Value, Self>) ->()) {
        group(prefix: [nil, nil], path: [], map: { handler in
            return Request.Handler { request in
                return try middleware.chain(to: handler).respond(to: request)
            }
        }, closure: closure)
    }

    public func grouped(_ middleware: Middleware ...) -> RouteGroup<Value, Self> {
        return grouped(prefix: [nil, nil], path: [], map: { handler in
            return Request.Handler { request in
                return try middleware.chain(to: handler).respond(to: request)
            }
        })
    }
    
    public func group(collection middlewares: [Middleware], closure: (RouteGroup<Value, Self>) ->()) {
        group(prefix: [nil, nil], path: [], map: { handler in
            return Request.Handler { request in
                return try middlewares.chain(to: handler).respond(to: request)
            }
        }, closure: closure)
    }

    public func grouped(collection middlewares: [Middleware]) -> RouteGroup<Value, Self> {
        return grouped(prefix: [nil, nil], path: [], map: { handler in
            return Request.Handler { request in
                return try middlewares.chain(to: handler).respond(to: request)
            }
        })
    }
}
<commit_msg>forwarding variadic group calls to collection handlers<commit_after>import HTTP
import Routing

@_exported import HTTPRouting
@_exported import TypeSafeRouting

extension Droplet: RouteBuilder {
    public typealias Value = Responder

    public func add(
        path: [String],
        value: Value
    ) {
        router.add(path: path, value: value)
    }
}

extension RouteBuilder where Value == Responder {
    public func group(_ middleware: Middleware ..., closure: (RouteGroup<Value, Self>) ->()) {
        group(collection: middleware, closure: closure)
    }

    public func grouped(_ middleware: Middleware ...) -> RouteGroup<Value, Self> {
        return grouped(collection: middleware)
    }
    
    public func group(collection middlewares: [Middleware], closure: (RouteGroup<Value, Self>) ->()) {
        group(prefix: [nil, nil], path: [], map: { handler in
            return Request.Handler { request in
                return try middlewares.chain(to: handler).respond(to: request)
            }
        }, closure: closure)
    }

    public func grouped(collection middlewares: [Middleware]) -> RouteGroup<Value, Self> {
        return grouped(prefix: [nil, nil], path: [], map: { handler in
            return Request.Handler { request in
                return try middlewares.chain(to: handler).respond(to: request)
            }
        })
    }
}

{'fraction_non_alphanumeric': 0.11238157464880758, 'fraction_numerical': 0.0, 'mean_word_length': 2.4835039817974973, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 19, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3214530', 'n_tokens_mistral': 835, 'n_tokens_neox': 808, 'n_words': 244}