Skip to content

Commit c8fcecc

Browse files
committed
Bug Fixes: crawlData default type
1 parent e1ea111 commit c8fcecc

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

src/api.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -417,7 +417,7 @@ export function createCrawlPage(baseConfig: LoaderXCrawlBaseConfig) {
417417
}
418418

419419
export function createCrawlData(baseConfig: LoaderXCrawlBaseConfig) {
420-
async function crawlData<D, T extends CrawlDataConfig>(
420+
async function crawlData<D = any, T extends CrawlDataConfig = any>(
421421
config: T,
422422
callback?: (res: CrawlDataSingleRes<D>) => void
423423
): Promise<CrawlDataRes<D, T>> {

src/types/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ export interface XCrawlInstance {
3434
callback?: ((res: CrawlPageSingleRes) => void) | undefined
3535
) => Promise<CrawlPageRes<T>>
3636

37-
crawlData: <D, T extends CrawlDataConfig>(
37+
crawlData: <D = any, T extends CrawlDataConfig = CrawlDataConfig>(
3838
config: T,
3939
callback?: ((res: CrawlDataSingleRes<D>) => void) | undefined
4040
) => Promise<CrawlDataRes<D, T>>

0 commit comments

Comments
 (0)