node-portfinder icon indicating copy to clipboard operation
node-portfinder copied to clipboard

Fix adding options.host to defaultHosts list

Open MasterOdin opened this issue 2 years ago • 0 comments

PR fixes a bug reported in https://github.com/http-party/node-portfinder/pull/120#issuecomment-1502633024, where the current indexOf check will only succeed if options.host was already in exports._defaultHosts, as opposed to the desired behavior of appending it if it's not in the array.

I've also cleaned up the nested conditional to just be one level as the nesting was not necessary.

MasterOdin avatar May 26 '23 16:05 MasterOdin