validator.js icon indicating copy to clipboard operation
validator.js copied to clipboard

feat(isIP): allow usage of options object

Open pixelbucket-dev opened this issue 3 years ago • 10 comments

This PR implements steps 1 and 2 of https://github.com/validatorjs/validator.js/issues/1874 for isIP and builds upon https://github.com/validatorjs/validator.js/pull/2075.

This PR extracts tests for isIP into a separate test file ⇾ test/validators/isIP.test.js (inspired by https://github.com/validatorjs/validator.js/pull/1793).

I have also added three more tests to guard against other possible values for version.

Checklist

  • [x] PR contains only changes related; no stray files, etc.
  • [x] README updated (where applicable)
  • [x] Tests written (where applicable)

pixelbucket-dev avatar Oct 25 '22 16:10 pixelbucket-dev

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Project coverage is 100.00%. Comparing base (54d330c) to head (0cace52). Report is 98 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff            @@
##            master     #2089   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files          105       105           
  Lines         2324      2324           
  Branches       586       587    +1     
=========================================
  Hits          2324      2324           

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

:rocket: New features to boost your workflow:
  • :snowflake: Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • :package: JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

codecov[bot] avatar Oct 25 '22 18:10 codecov[bot]

if we rebase/merge this with #2091, the diff will be much cleaner and easier to review

braaar avatar Oct 26 '22 06:10 braaar

if we rebase/merge this with #2091, the diff will be much cleaner and easier to review

I've merged #2091 into this branch. But the diff won't be improved until #2091 is merged.

pixelbucket-dev avatar Oct 26 '22 09:10 pixelbucket-dev

if we rebase/merge this with #2091, the diff will be much cleaner and easier to review

I've merged #2091 into this branch. But the diff won't be improved until #2091 is merged.

Ah, of course. And I suppose it's possible to set 2091 as the base branch, either.

braaar avatar Oct 26 '22 09:10 braaar

Ah, of course. And I suppose it's possible to set 2091 as the base branch, either.

It is possible, but then it would be a PR in my fork and not this repo directly. So we'll have to deal with this workaround for now

WikiRik avatar Oct 26 '22 10:10 WikiRik

I think this should be good to go :).

pixelbucket-dev avatar Feb 05 '23 17:02 pixelbucket-dev

Can you undo the changes to the isAlpha tests?

Sorry, what exactly do you mean? I cannot see anything related to isAlpha in the diff view.

pixelbucket-dev avatar Feb 05 '23 19:02 pixelbucket-dev

In the big test file you removed too much for this PR causing the codecov check to fail

WikiRik avatar Feb 05 '23 19:02 WikiRik

In the big test file you removed too much for this PR causing the codecov check to fail

Done :).

pixelbucket-dev avatar Feb 06 '23 20:02 pixelbucket-dev

Can this be re-reviewed?

pixelbucket-dev avatar Jul 09 '24 09:07 pixelbucket-dev