Spracherkennung für: .ts vermutete Sprache: Unknown {[0] [0] [0]} [Methode: Schwerpunktbildung, einfache Gewichte, sechs Dimensionen]
import { normalizeLowercaseStringOrEmpty } from "../../../shared/string-coerce.js";
import { compileGlobPatterns, matchesAnyGlobPattern } from "../../glob-pattern.js";
import type { ContextPruningToolMatch } from "./settings.js";
function normalizeGlob(value: string) {
return normalizeLowercaseStringOrEmpty(value ?? "");
}
export function makeToolPrunablePredicate(
match: ContextPruningToolMatch,
): (toolName: string) => boolean {
const deny = compileGlobPatterns({ raw: match.deny, normalize: normalizeGlob });
const allow = compileGlobPatterns({ raw: match.allow, normalize: normalizeGlob });
return (toolName: string) => {
const normalized = normalizeGlob(toolName);
if (matchesAnyGlobPattern(normalized, deny)) {
return false;
}
if (allow.length === 0) {
return true;
}
return matchesAnyGlobPattern(normalized, allow);
};
}
¤ Dauer der Verarbeitung: 0.20 Sekunden
(vorverarbeitet am 2026-04-27)
¤
*© Formatika GbR, Deutschland