unjs / get-port-please

πŸ”Œ Get an available open port
MIT License
245 stars 12 forks source link

feat: automatically fallback hostname for invalid hosts #62

Closed pi0 closed 1 year ago

pi0 commented 1 year ago

πŸ”— Linked issue

❓ Type of change

πŸ“š Description

resolves #57

When hostname is (misconfigured) and invalid, instead of throwing a hard error, get-port listens on a fallback (IPv4) hostname (127.0.0.1 or 0.0.0.0 if public flag is explicitly set)

πŸ“ Checklist

codecov[bot] commented 1 year ago

Codecov Report

Merging #62 (666ca9a) into main (7d4d6bb) will increase coverage by 1.14%. The diff coverage is 100.00%.

@@            Coverage Diff             @@
##             main      #62      +/-   ##
==========================================
+ Coverage   85.20%   86.35%   +1.14%     
==========================================
  Files           5        5              
  Lines         365      381      +16     
  Branches       47       48       +1     
==========================================
+ Hits          311      329      +18     
+ Misses         54       52       -2     
Files Changed Coverage Ξ”
src/_internal.ts 89.58% <100.00%> (+3.70%) :arrow_up:
src/get-port.ts 74.85% <100.00%> (+0.61%) :arrow_up:
src/types.ts 100.00% <100.00%> (ΓΈ)