9 lines
358 B
JavaScript
9 lines
358 B
JavaScript
module.exports = function (item, itemOptions, source) {
|
|
const patt = /(glasgow|london|edinburgh|milton keynes)/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;
|
|
};
|