Update types.ts

This commit is contained in:
Nicolas
2024-08-30 13:54:04 -03:00
parent f4a49bc1d1
commit 7c8ca0c889
+6 -1
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", 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 = { // export type ScrapeRequest = {
// url: string; // url: string;