@remusao/url-match-patterns
TypeScript icon, indicating that this package has built-in type declarations

1.2.0 • Public • Published

@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

Readme

Keywords

none

Package Sidebar

Install

npm i @remusao/url-match-patterns

Weekly Downloads

1,201

Version

1.2.0

License

MPL-2.0

Unpacked Size

49.7 kB

Total Files

14

Last publish

Collaborators

  • remusao