"use strict";

module.exports = function uniqueByPredicate(items, predicate) {
	let seen = new Set();

	return items.filter((item) => {
		let key = predicate(item);
		
		if (seen.has(key)) {
			return false;
		} else {
			return true;
		}
	});
};
