You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

14 lines
370 B

'use strict';
var extractValues = require('../helpers/values');
var nestedValue = require('../helpers/nestedValue');
module.exports = function whereIn(key, values) {
var items = extractValues(values);
var collection = this.items.filter(function (item) {
return items.indexOf(nestedValue(item, key)) !== -1;
});
return new this.constructor(collection);
};