Update types.ts

This commit is contained in:
Nicolas 2024-08-30 13:54:04 -03:00
parent f4a49bc1d1
commit 7c8ca0c889
1 changed files with 6 additions and 1 deletions

View File

@ -89,7 +89,12 @@ export const scrapeRequestSchema = scrapeOptions.extend({
{
message: "When 'extract' format is specified, 'extract' options must be provided, and vice versa",
}
);
).transform((obj) => {
if ((obj.formats?.includes("extract") || obj.extract) && !obj.timeout) {
return { ...obj, timeout: 60000 };
}
return obj;
});
// export type ScrapeRequest = {
// url: string;