From 71e66cf437564701395d14f8c5fd645b0bc10682 Mon Sep 17 00:00:00 2001 From: Nulo Date: Tue, 2 Jan 2024 19:34:35 -0300 Subject: [PATCH] no asumir que offers es solo length===1 --- scraper/common.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/scraper/common.ts b/scraper/common.ts index 534800b..f84edff 100644 --- a/scraper/common.ts +++ b/scraper/common.ts @@ -32,7 +32,7 @@ const zProductLd = z.object({ name: z.string(), image: z.string(), offers: z.object({ - offers: z.tuple([ + offers: z.array( z.object({ "@type": z.literal("Offer"), price: z.number(), @@ -41,8 +41,8 @@ const zProductLd = z.object({ "http://schema.org/OutOfStock", "http://schema.org/InStock", ]), - }), - ]), + }) + ), }), }); type ProductLd = z.infer;