From 0fec10a2c982c8a097e517e218ecea2a998bdf8b Mon Sep 17 00:00:00 2001 From: Simon Brandeis <33657802+SBrandeis@users.noreply.github.com> Date: Thu, 23 Jan 2025 18:12:33 +0100 Subject: [PATCH] lint error on main x2 (#1133) --- packages/tasks-gen/scripts/inference-codegen.ts | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/packages/tasks-gen/scripts/inference-codegen.ts b/packages/tasks-gen/scripts/inference-codegen.ts index df5f2492b..e9fb05b80 100644 --- a/packages/tasks-gen/scripts/inference-codegen.ts +++ b/packages/tasks-gen/scripts/inference-codegen.ts @@ -145,7 +145,13 @@ async function generateBinaryInputTypes( return; } const propName = propSignature.name.getText(tsSource); - const propIsMedia = !!spec["properties"]?.[propName]?.["comment"]?.includes("type=binary"); + + const propIsMedia = + typeof spec["properties"] !== "string" && + typeof spec["properties"]?.[propName] !== "string" && + typeof spec["properties"]?.[propName]?.["comment"] === "string" + ? !!spec["properties"]?.[propName]?.["comment"]?.includes("type=binary") + : false; if (!propIsMedia) { return; }