Skip to content

Commit

Permalink
chore: support multiple globs in config
Browse files Browse the repository at this point in the history
  • Loading branch information
86 committed Nov 20, 2023
1 parent d713d1c commit 6f7748e
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ type Config = {
/** URL to start the crawl */
url: string;
/** Pattern to match against for links on a page to subsequently crawl */
match: string;
match: string | string[];
/** Selector to grab the inner text from */
selector: string;
/** Don't crawl more than this many pages */
Expand Down
2 changes: 1 addition & 1 deletion src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ if (process.env.NO_CRAWL !== "true") {
// Extract links from the current page
// and add them to the crawling queue.
await enqueueLinks({
globs: [config.match],
globs: typeof config.match === "string" ? [config.match] : config.match,
});
},
// Comment this option to scrape the full website.
Expand Down

0 comments on commit 6f7748e

Please sign in to comment.