All files / src/contains Iterator.contains.js

100% Statements 5/5
100% Branches 2/2
100% Functions 2/2
100% Lines 4/4
1 2 3 4 5 6 7 8 9 10 11      18x 24x 2x     71x    
import Iterator from '../iterators/Iterator';
import '../first';
 
Iterator.prototype.contains = function contains(value) {
  if (typeof value === 'undefined') {
    throw new Error('Missing value to compare with.');
  }
 
  return !!this.first(item => Object.is(item, value));
};