INNER CODE UNIT · TypeScript
quote
NVIDIA/NemoClaw · .dsh/tools/carry_nemoclaw_cached_review_recommendations/index.ts:31
const quote = (value) => "'" + String(value).replaceAll("'", "'\"'\"'") + "'";
const repo = input.repo ?? "NVIDIA/NemoClaw";
const failure = input.failure ?? "fail-fast";
const overwrite = input.overwrite === true;
if (typeof input.workdir !== "string" || !input.workdir.trim() || input.workdir.length > 4096)
throw new Error("workdir must contain 1 to 4096 characters");
if (
typeof repo !== "string" ||
repo.length > 255 ||
!/^[A-Za-z0-9_.-]+\/[A-Za-z0-9_.-]+$/.test(repo)
)
throw new Error("repo must be owner/name with at most 255 characters");
if (!Array.isArray(input.items) || input.items.length < 1 || input.items.length > 10)
throw new Error("items must contain 1 to 10 recommendation carries");
const seen = new Set();
for (const item of input.items) {
if (!Number.isSafeInteger(item.number) || item.number <= 0)
throw new Error("each PR number must be a positive integer");