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

feat(isIP): allow usage of options object #2089

Open
wants to merge 21 commits into
base: master
Choose a base branch
from
Open
Changes from 1 commit
Commits
Show all changes
21 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Fix broken isIPRange
  • Loading branch information
pixelbucket-dev committed Oct 25, 2022
commit cf9ebc7379478b03718281a9ad67fb6f06ea9557
4 changes: 2 additions & 2 deletions src/lib/isIPRange.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ export default function isIPRange(str, version = '') {
return false;
}

const isValidIP = isIP(parts[0], version);
const isValidIP = isIP(parts[0], { version });
if (!isValidIP) {
return false;
}
Expand All @@ -40,7 +40,7 @@ export default function isIPRange(str, version = '') {
break;

default:
expectedSubnet = isIP(parts[0], '6') ? v6Subnet : v4Subnet;
expectedSubnet = isIP(parts[0], { version: 6 }) ? v6Subnet : v4Subnet;
}

return parts[1] <= expectedSubnet && parts[1] >= 0;
Expand Down