Skip to content

Commit

Permalink
perf: Reuse the same RegExp object for greenkeeper matching
Browse files Browse the repository at this point in the history
  • Loading branch information
Alorel committed Mar 27, 2019
1 parent 0c32ceb commit ba66505
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion index.js
@@ -1,11 +1,13 @@
const cloneDeep = require('lodash/cloneDeep');

const GK_REGEX = /update.+to\s+version\s+/i;

function isGreenkeeperLockfileCommit(commit) {
return commit.scope === 'package' && (commit.message || '').toLowerCase().includes('update lockfile');
}

function isGreenkeeperUpdate(commit) {
return commit.message && /update.+to\s+version\s+/i.test(commit.message);
return commit.message && GK_REGEX.test(commit.message);
}

function getCfg() {
Expand Down

0 comments on commit ba66505

Please sign in to comment.