perf: optimize duplicate (#24)

* perf: optimize mark duplicate

* add

* add

* add

* add

* add
This commit is contained in:
xrkffgg
2020-12-30 15:17:26 +08:00
committed by GitHub
parent 1cf278b531
commit da1f8da3d4
10 changed files with 114 additions and 26 deletions

View File

@@ -11,11 +11,25 @@ function dealInput (para) {
return arr;
};
function matchKeyword(content, keywords) {
function matchKeyword (content, keywords) {
return keywords.find(item => content.toLowerCase().includes(item));
};
function testDuplicate(body) {
if (!body || !body.startsWith('Duplicate of')) {
return false
}
let arr = body.split(' ');
if (arr[0] == 'Duplicate' && arr[1] == 'of') {
return true;
} else {
return false;
}
};
module.exports = {
dealInput,
matchKeyword,
testDuplicate,
};