job-hoarder
Version:
Job board aggregator to pull in standardized job postings from company job pages
14 lines (13 loc) • 423 B
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
/**
* Gets the first match from a string and regex or null
* @param {String} text text to search from
* @param {RegEx} pattern regex pattern to match
*/
exports.default = (function (text, pattern) {
if (!text)
return undefined;
var match = text.match(pattern);
return match && match.length > 1 ? match[1] : undefined;
});