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

Don't use arrow functions and const to work on IE11 #69

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

Conversation

guillaumewuip
Copy link

@guillaumewuip guillaumewuip commented Feb 4, 2020

The library cannot be used out-of-the-box on IE11 because IE6 is not supported there.

This PR simply convert the two arrow functions into classic functions and replace const by var

@guillaumewuip guillaumewuip changed the title Don't use arrow function to work on IE11 Don't use arrow functions and const to work on IE11 Feb 4, 2020
@@ -2,21 +2,21 @@
const ipRegex = require('ip-regex');
const tlds = require('tlds');

module.exports = options => {
module.exports = function(options) {
options = {
strict: true,
...options

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the spread operate breaks in IE11 as well though so that needs to be swapped out

@Richienb
Copy link

I feel like this won't be needed since this PR needs to be compiled either way to use module.exports.

@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).

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.

4 participants