Current File : //home/tradevaly/text.tradevaly.com.bd/node_modules/collect.js/src/methods/whereIn.js
'use strict';

const extractValues = require('../helpers/values');
const nestedValue = require('../helpers/nestedValue');

module.exports = function whereIn(key, values) {
  const items = extractValues(values);

  const collection = this.items
    .filter(item => items.indexOf(nestedValue(item, key)) !== -1);

  return new this.constructor(collection);
};