Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Pass in own list of TLDs #66

Open
wants to merge 6 commits into
base: master
Choose a base branch
from
Open

Pass in own list of TLDs #66

wants to merge 6 commits into from

Conversation

osdiab
Copy link

@osdiab osdiab commented Oct 18, 2019

Context at #65

Didn't add typings or readme yet, want to see if this kind of API is something you'd be open to. Adds a new entry point to preserve behavior of import, where doing so provides the same functionality but with an extra tlds option to provide the list of TLDs yourself.

Flow to use this would be to import it from url-regex/make-url-regex instead of just url-regex, allowing the library to be used without pulling in the tlds library, making this a much smaller library to include and flexible for niche URL schemes like .onion.

Naming kinda crappy but idk what would be better. Assumed wanted to preserve default behavior so intentionally didn't introduce to index.js.

@osdiab osdiab changed the title Pass in own list of TL Pass in own list of TLDs Oct 18, 2019
@niftylettuce
Copy link
Collaborator

This issue is fixed in my maintained and modern version of this package at https://github.com/niftylettuce/url-regex-safe. You should be able to switch from url-regex to url-regex-safe now. See the updated list of options as I added some new ones, and changed a few defaults to more sensible ones (since not everyone is parsing Markdown for instance).

It has an option to pass tlds (Array) 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants