test(app): 補齊 isSafeRepoPath/extractBalancedJSON/normalizeText/repairJSONArrayWithAI/格式化函式測試
為可測性 export 三個內部函式(isSafeRepoPath、extractBalancedJSON/extractJSONText、normalizeText)。 Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Opus 4.8
parent
fc10ab7266
commit
775cc575ae
+1
-1
@@ -171,7 +171,7 @@ function toExclusion(botFinding) {
|
||||
* @param {string} p - 待檢查的檔案路徑。
|
||||
* @returns {boolean} 安全(repo 內相對路徑)為 true,否則 false。
|
||||
*/
|
||||
function isSafeRepoPath(p) {
|
||||
export function isSafeRepoPath(p) {
|
||||
if (typeof p !== 'string' || p === '') return false;
|
||||
if (p.startsWith('/') || /^[a-zA-Z]:/.test(p)) return false;
|
||||
return !p.split('/').includes('..');
|
||||
|
||||
Reference in New Issue
Block a user