-
-
Notifications
You must be signed in to change notification settings - Fork 2.3k
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 isIPRange validator #842
Conversation
src/lib/isIPRange.js
Outdated
|
||
export default function isIPRange(str) { | ||
assertString(str); | ||
const [ip, subnet, err] = str.split('/'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do you mind avoiding this array destructuring syntax? It adds a fairly large helper function to validator.js
and so validator.min.js
Example:
const parts = str.split('/', 3);
if (parts.length !== 2) {
return false;
}
const ip = parts[0];
const subnet = parts[0];
Thanks for the PR 😄 |
Awesome, thank you.
…On Tue, Jun 12, 2018 at 1:32 PM chriso ***@***.***> wrote:
Merged #842 <#842>.
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#842 (comment)>, or mute
the thread
<https://github.com/notifications/unsubscribe-auth/AQOT1pBpLUj-3cpjAzHmFhi7SCJiYqeWks5t8CVigaJpZM4UfP-9>
.
|
Any timeline on getting this released? |
@gabegorelick |
@chriso Awesome! Thanks for the quick turnaround. |
Validate IP Ranges for IPv4.