(str)
| 113 | |
| 114 | // From https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/encodeURIComponent |
| 115 | const fixedEncodeURIComponent = function (str) { |
| 116 | return encodeURIComponent(str).replace(/[!'()*]/g, function(c) { |
| 117 | return '%' + c.charCodeAt(0).toString(16).toUpperCase(); |
| 118 | }); |
| 119 | } |
| 120 | |
| 121 | const parsePortOrDefault = function (value, defaultPort = 9001) { |
| 122 | if (value === null || value === undefined) return defaultPort; |