1.1.1 • Published 4 years ago

@remusao/url-match-patterns v1.1.1

Weekly downloads
165
License
MPL-2.0
Repository
github
Last release
4 years ago

@remusao/url-match-patterns

Test URLs against match patterns, as defined by Google and Mozilla.

import match, { Pattern } from '@remusao/url-match-patterns';

// check that a url matches
match('*://*/*', 'https://www.example.com'); // true

// pre-compile pattern for faster performance
const pattern = new Pattern('*://*/*');
pattern.match('https://www.example.com'); // true

// More examples
match('<all_urls>', 'https://www.example.com'); // true
match('https://example.com/*', 'https://www.example.com'); // false
match('https://*.example.com/*', 'https://www.example.com'); // true
1.1.1

4 years ago

1.1.0

4 years ago