Utilities for working with match patterns.
npm install @webext-core/match-patterns@webext-core/match-patternsUtilities for working with match patterns.
``bash`
pnpm i @webext-core/match-patterns
`ts
import { MatchPattern } from '@webext-core/match-patterns';
const pattern = MatchPattern('://.google.com/*');
pattern.includes('http://google.com/search?q=test'); // true
pattern.includes('https://accounts.google.com'); // true
pattern.includes('https://youtube.com/watch'); // false
`
See documentation to get started!
Not all protocols are supported. Open a PR to add support.
- [x] https
- [x] protocolhttp
- [x] protocolfile
- [ ] protocolftp
- [ ] protocolurn` protocol
- [ ]