Skip to content

Commit 6f7748e

Browse files
committed
chore: support multiple globs in config
1 parent d713d1c commit 6f7748e

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

config.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ type Config = {
33
/** URL to start the crawl */
44
url: string;
55
/** Pattern to match against for links on a page to subsequently crawl */
6-
match: string;
6+
match: string | string[];
77
/** Selector to grab the inner text from */
88
selector: string;
99
/** Don't crawl more than this many pages */

src/main.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ if (process.env.NO_CRAWL !== "true") {
5151
// Extract links from the current page
5252
// and add them to the crawling queue.
5353
await enqueueLinks({
54-
globs: [config.match],
54+
globs: typeof config.match === "string" ? [config.match] : config.match,
5555
});
5656
},
5757
// Comment this option to scrape the full website.

0 commit comments

Comments
 (0)