//
//  NSArray+ProcessingArray.m
//  react-native-rainbow-module
//
//  Created by Doha Tubaileh on 21/3/2021.
//

#import "NSArray+ProcessingArray.h"

@implementation NSArray (ProcessingArray)

- (NSArray *)mapObjectsUsingBlock:(id (^)(id obj, NSUInteger idx))block {
    NSMutableArray *result = [NSMutableArray arrayWithCapacity:[self count]];
    [self enumerateObjectsUsingBlock:^(id obj, NSUInteger idx, BOOL *stop) {
        [result addObject:block(obj, idx)];
    }];
    return result;
}

@end
