API Reference - match-patterns
InvalidMatchPattern
ts
class InvalidMatchPattern extends Error {
constructor(matchPattern: string, reason: string) {
// ...
}
}
MatchPattern
ts
class MatchPattern {
constructor(matchPattern: string) {
// ...
}
includes(url: string | URL | Location): boolean {
// ...
}
}
Class for parsing and performing operations on match patterns.
Examples
ts
const pattern = new MatchPattern("*://google.com/*");
pattern.includes("https://google.com"); // true
pattern.includes("http://youtube.com/watch?v=123") // false
API reference generated by plugins/typescript-docs.ts