mirror of
https://gitea.com/Lydanne/issues-helper.git
synced 2025-08-21 11:15:50 +08:00

* wip * wip * fix * fix * test * test * fix * fix * fix * fix * add * opt * update * add changelog * remove version * fix * a * Update README.md * a * Update .umirc.dev.ts
41 lines
706 B
JavaScript
41 lines
706 B
JavaScript
function dealInput (para) {
|
|
let arr = [];
|
|
if (para) {
|
|
const paraArr = para.split(',');
|
|
paraArr.forEach(it => {
|
|
if(it.trim()){
|
|
arr.push(it.trim())
|
|
}
|
|
})
|
|
}
|
|
return arr;
|
|
};
|
|
|
|
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;
|
|
}
|
|
};
|
|
|
|
function getPreMonth (m) {
|
|
return m == 1 ? 12 : m -1;
|
|
};
|
|
|
|
module.exports = {
|
|
dealInput,
|
|
getPreMonth,
|
|
matchKeyword,
|
|
testDuplicate,
|
|
};
|