@@ -440,6 +440,20 @@ export interface ResponseWithSentry<
440
440
sentry ?: string ,
441
441
}
442
442
443
+ export function toLegacyCrawlerOptions ( x : CrawlerOptions ) {
444
+ return {
445
+ includes : x . includePaths ,
446
+ excludes : x . excludePaths ,
447
+ maxCrawledLinks : x . limit ,
448
+ maxDepth : x . maxDepth ,
449
+ limit : x . limit ,
450
+ generateImgAltText : false ,
451
+ allowBackwardCrawling : x . allowBackwardLinks ,
452
+ allowExternalContentLinks : x . allowExternalLinks ,
453
+ ignoreSitemap : x . ignoreSitemap ,
454
+ } ;
455
+ }
456
+
443
457
export function fromLegacyCrawlerOptions ( x : any ) : { crawlOptions : CrawlerOptions ; internalOptions : InternalOptions } {
444
458
return {
445
459
crawlOptions : crawlerOptions . parse ( {
@@ -493,10 +507,10 @@ export function fromLegacyScrapeOptions(pageOptions: PageOptions, extractorOptio
493
507
}
494
508
}
495
509
496
- export function fromLegacyCombo ( pageOptions : PageOptions , extractorOptions : ExtractorOptions | undefined , timeout : number | undefined , crawlerOptions : any ) : { scrapeOptions : ScrapeOptions , crawlOptions : CrawlerOptions , internalOptions : InternalOptions } {
510
+ export function fromLegacyCombo ( pageOptions : PageOptions , extractorOptions : ExtractorOptions | undefined , timeout : number | undefined , crawlerOptions : any ) : { scrapeOptions : ScrapeOptions , internalOptions : InternalOptions } {
497
511
const { scrapeOptions, internalOptions : i1 } = fromLegacyScrapeOptions ( pageOptions , extractorOptions , timeout ) ;
498
- const { crawlOptions , internalOptions : i2 } = fromLegacyCrawlerOptions ( crawlerOptions ) ;
499
- return { scrapeOptions, crawlOptions , internalOptions : Object . assign ( i1 , i2 ) } ;
512
+ const { internalOptions : i2 } = fromLegacyCrawlerOptions ( crawlerOptions ) ;
513
+ return { scrapeOptions, internalOptions : Object . assign ( i1 , i2 ) } ;
500
514
}
501
515
502
516
export function toLegacyDocument ( document : Document , internalOptions : InternalOptions ) : V0Document | { url : string ; } {
0 commit comments