node-portfinder
node-portfinder copied to clipboard
Fix adding options.host to defaultHosts list
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.