From 2ddb050dd2c965e190f9bbf15ee002fa584f8d92 Mon Sep 17 00:00:00 2001 From: Yufan Sheng Date: Fri, 21 Jun 2024 01:19:33 +0800 Subject: [PATCH] fix: the invalid image types. --- options.ts | 2 +- src/helpers/images.ts | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/options.ts b/options.ts index 04b00b2..6e4eb28 100644 --- a/options.ts +++ b/options.ts @@ -69,7 +69,7 @@ const Options = z }), thumbnail: z .function() - .args(z.object({ src: z.string().min(1), width: z.number(), height: z.number() })) + .args(z.object({ src: z.string().min(1), width: z.number().or(z.string()), height: z.number().or(z.string()) })) .returns(z.string()), }) .transform((opts) => { diff --git a/src/helpers/images.ts b/src/helpers/images.ts index 4c88850..5d63bae 100644 --- a/src/helpers/images.ts +++ b/src/helpers/images.ts @@ -11,11 +11,11 @@ export interface Image { /** * image width */ - width: number; + width: number | string; /** * image height */ - height: number; + height: number | string; /** * blurDataURL of the image */