fix(code-queue): reject runner skills typo path
This commit is contained in:
@@ -529,6 +529,15 @@ function asRecord(value: unknown): Record<string, unknown> | null {
|
||||
return typeof value === "object" && value !== null && !Array.isArray(value) ? value as Record<string, unknown> : null;
|
||||
}
|
||||
|
||||
function compactObjectFields(record: Record<string, unknown> | null, keys: string[]): Record<string, unknown> | null {
|
||||
if (record === null) return null;
|
||||
const selected: Record<string, unknown> = {};
|
||||
for (const key of keys) {
|
||||
if (record[key] !== undefined) selected[key] = record[key];
|
||||
}
|
||||
return Object.keys(selected).length > 0 ? selected : null;
|
||||
}
|
||||
|
||||
function asArray(value: unknown): unknown[] {
|
||||
return Array.isArray(value) ? value : [];
|
||||
}
|
||||
@@ -4654,7 +4663,14 @@ function compactSkillsStatus(value: unknown): Record<string, unknown> | null {
|
||||
requiredSkills: Array.isArray(record.requiredSkills) ? record.requiredSkills : [],
|
||||
missingSkills: Array.isArray(record.missingSkills) ? record.missingSkills : [],
|
||||
valuesPrinted: record.valuesPrinted ?? false,
|
||||
pathSpelling: record.pathSpelling ?? null,
|
||||
pathSpelling: compactObjectFields(asRecord(record.pathSpelling), [
|
||||
"expectedTarget",
|
||||
"forbiddenPathChecked",
|
||||
"forbiddenPathExists",
|
||||
"forbiddenPathConfigured",
|
||||
"forbiddenPathRoles",
|
||||
"forbiddenPathMustNotBeUsed",
|
||||
]),
|
||||
repairHint: record.repairHint ?? null,
|
||||
};
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user