jobscraper/lib/filter_location.js

9 lines
358 B
JavaScript
Raw Normal View History

2020-05-19 09:05:04 +00:00
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;
};