Rinser/plugins/filter_location.js
2018-08-09 16:43:49 +01:00

9 lines
344 B
JavaScript

module.exports = function (item, itemOptions, source) {
const patt = /(glasgow|london|edinburgh)/ig;
const result = patt.test(itemOptions.description);
const resultB = patt.test(itemOptions.title);
console.log('Location:', (result || resultB === true) ? 'Pass' : 'Reject');
return (result || resultB === true) ? itemOptions : -1;
};