Fix(isPort): Invalid leading zeros (#2208) by anasshakil · Pull Request #2211 · validatorjs/validator.js

Conversation

@anasshakil

  • Fix leading zeros.
  • Test case updated.
const isValidPort = isPort('0001'); // false

closes #2208

Checklist

  • PR contains only changes related; no stray files, etc.
  • README updated (where applicable)
  • Tests written (where applicable)
  • References provided in PR (where applicable)

@codecov

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 99.95%. Comparing base (9ba1735) to head (fcbe17a).
Report is 18 commits behind head on master.

❗ Current head fcbe17a differs from pull request most recent head 83ae52c. Consider uploading reports for the commit 83ae52c to get more accurate results

Additional details and impacted files
@@           Coverage Diff           @@
##           master    #2211   +/-   ##
=======================================
  Coverage   99.95%   99.95%           
=======================================
  Files         107      107           
  Lines        2405     2405           
  Branches      604      604           
=======================================
  Hits         2404     2404           
  Partials        1        1           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

rubiin

profnandaa

@vky5 vky5 mentioned this pull request

May 31, 2024

This was referenced

Sep 10, 2024

@vky5 vky5 mentioned this pull request

Sep 15, 2024

This was referenced

Sep 19, 2024

Labels