<commit_before>//
//  mapMany.swift
//  RxSwiftExt
//
//  Created by <NAME> on 06.05.18.
//  Copyright © 2018 RxSwiftCommunity. All rights reserved.
//

import RxSwift

extension ObservableType where E: Collection {

    /**
     Projects elements of each element of an observable collection into a new form.
     - parameter transform: A transform function to apply to each source element.
     - returns: An observable collection whose elements are the result of invoking the transform function on each element of source.
     */

    public func mapMany<T>(_ transform: @escaping (E.Element) throws -> T) -> Observable<[T]> {
        return map { collection -> [T] in
            try collection.map(transform)
        }
    }
}<commit_msg>make mapMany a rethrowing function<commit_after>//
//  mapMany.swift
//  RxSwiftExt
//
//  Created by <NAME> on 06.05.18.
//  Copyright © 2018 RxSwiftCommunity. All rights reserved.
//

import RxSwift

extension ObservableType where E: Collection {

    /**
     Projects elements of each element of an observable collection into a new form.
     - parameter transform: A transform function to apply to each source element.
     - returns: An observable collection whose elements are the result of invoking the transform function on each element of source.
     */

    public func mapMany<T>(_ transform: @escaping (E.Element) throws -> T) rethrows -> Observable<[T]> {
        return map { collection -> [T] in
            try collection.map(transform)
        }
    }
}
{'fraction_non_alphanumeric': 0.09114927344782034, 'fraction_numerical': 0.013210039630118891, 'mean_word_length': 2.75, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 15, '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': '3684178', 'n_tokens_mistral': 440, 'n_tokens_neox': 392, 'n_words': 167}