Codibre/fluent-iterable

View on GitHub
src/recipes/contains-recipe.ts

Summary

Maintainability
A
0 mins
Test Coverage
A
100%
import { AnyIterable } from 'augmentative-iterable';
import { ResolverIngredient } from './ingredients';

export function containsRecipe(any: ResolverIngredient) {
  return function <T>(this: AnyIterable<T>, item: T) {
    return any.call(this, (next: any) => next === item);
  };
}