The result of the scrape function returns an array of scrape results:
$ node x/index.js
[
{
url: 'https://media.npr.org/assets/img/2020/11/06/b643279e-03ce-469f-95cc-f457758859f8-c4d30b79302ecae1bb7926c7d24fbebfedef72fb-s1100-c50.jpg',
source: 'https://www.npr.org/2020/11/06/932178314/king-von-emerging-chicago-rapper-dead-at-26',
title: 'King Von, Emerging Chicago Rapper, Dead At 26 : NPR'
},
...
]
However, the type file (index.d.ts) states that it should return as just one result. This is simply just changing the type from Promise<Scraper.ScrapeResult> to Promise<Array<Scraper.ScrapeResult>> to fix type errors when using typescript.
(note: i dont know how to reopen a pr so i just made a new one)
Summary of Pull Request
The result of the
scrape
function returns an array of scrape results:However, the type file (
index.d.ts
) states that it should return as just one result. This is simply just changing the type fromPromise<Scraper.ScrapeResult>
toPromise<Array<Scraper.ScrapeResult>>
to fix type errors when using typescript.(note: i dont know how to reopen a pr so i just made a new one)