From 646314e7f65d0f20d29d83bc5232d76e6857737c Mon Sep 17 00:00:00 2001 From: schuer Date: Sun, 22 Sep 2024 20:28:31 +0200 Subject: [PATCH] add types and improve check --- scripts/generate-image-files.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/generate-image-files.ts b/scripts/generate-image-files.ts index bd1f5bb..69db12d 100644 --- a/scripts/generate-image-files.ts +++ b/scripts/generate-image-files.ts @@ -7,9 +7,9 @@ const imagesDirectory = 'images'; /** * Prepare image configuration */ -const imageConfiguration = parse(Deno.readTextFileSync(`${sourceDirectory}/images.yml`)); +const imageConfiguration = parse(Deno.readTextFileSync(`${sourceDirectory}/images.yml`)) as { images: [] }; -if (!(imageConfiguration !== null && typeof imageConfiguration === "object")) { +if (imageConfiguration === null && typeof imageConfiguration !== "object") { console.error("Invalid image configuration!"); Deno.exit(1); }