feat(ai-code-review): 新增 AI 程式碼審查主程式、模組與測試

This commit is contained in:
Jeffery
2026-07-02 16:09:12 +08:00
parent 18314b88a3
commit f46dfe6258
448 changed files with 78568 additions and 16 deletions
+29
View File
@@ -0,0 +1,29 @@
// API
module.exports = abort;
/**
* Aborts leftover active jobs
*
* @param {object} state - current state object
*/
function abort(state)
{
Object.keys(state.jobs).forEach(clean.bind(state));
// reset leftover jobs
state.jobs = {};
}
/**
* Cleans up leftover job by invoking abort function for the provided job id
*
* @this state
* @param {string|number} key - job id to abort
*/
function clean(key)
{
if (typeof this.jobs[key] == 'function')
{
this.jobs[key]();
}
}