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

add support for an optional link filtering function #119

Closed
zeke opened this issue Nov 18, 2019 · 3 comments
Closed

add support for an optional link filtering function #119

zeke opened this issue Nov 18, 2019 · 3 comments
Assignees
Labels
enhancement New feature or request help wanted Extra attention is needed

Comments

@zeke
Copy link
Contributor

zeke commented Nov 18, 2019

Hi @JustinBeckwith and maintainers. This is a nice module! Thanks for writing it.

In the current API doc:

linksToSkip (array) - An array of regular expression strings that should be skipped during the scan.

This works, but it can be cumbersome to write exclusion rules just using regular expressions. It would be nifty if this option (or a new option) could be passed a function instead of an array. The function would take the given link URL as input and return a Boolean indicating whether to skip it or not:

filterLinks: (url) => {
  return true // or false
}

I'd be willing to open a PR to add support for this. Would you be open to this change?

@zeke zeke changed the title allow linksToSkip to be a function add support for an optional link filtering function Nov 19, 2019
@zeke
Copy link
Contributor Author

zeke commented Nov 19, 2019

I jumped the gun and opened a PR for this anyway: #120

@JustinBeckwith JustinBeckwith added the enhancement New feature or request label Nov 19, 2019
@JustinBeckwith
Copy link
Owner

This sounds great, and thanks for the PR! I left some feedback over there :)

@JustinBeckwith JustinBeckwith added the help wanted Extra attention is needed label Nov 19, 2019
@JustinBeckwith
Copy link
Owner

Thank you again for the PR! This was fixed in #120 - the release should be coming out momentarily.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

2 participants