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.

16 lines
359 B

4 years ago
  1. 'use strict';
  2. module.exports = function diff(values) {
  3. var valuesToDiff = void 0;
  4. if (values instanceof this.constructor) {
  5. valuesToDiff = values.all();
  6. } else {
  7. valuesToDiff = values;
  8. }
  9. var collection = this.items.filter(function (item) {
  10. return valuesToDiff.indexOf(item) === -1;
  11. });
  12. return new this.constructor(collection);
  13. };