Codibre/fluent-iterable

View on GitHub
src/recipes/for-each-recipe.ts

Summary

Maintainability
A
0 mins
Test Coverage
A
100%
import { AnyIterable } from 'augmentative-iterable';
import { AnyMapper } from '../types-internal';
import { prepare } from '../types-internal/prepare';

export function forEachRecipe(augmentativeForEach: Function) {
  return function <T>(this: AnyIterable<T>, action: AnyMapper<T>) {
    return augmentativeForEach.call(this, prepare(action));
  };
}