MCPcopy Create free account
hub / github.com/adobe/Marinus / normalizePort

Function normalizePort

web_server/config/env.js:31–45  ·  view source on GitHub ↗

* Normalize a port into a number, string, or false. * @param {String} val The port as a string * @return {*} The port as a number, string, or false.

(val)

Source from the content-addressed store, hash-verified

29 * @return {*} The port as a number, string, or false.
30 */
31function normalizePort(val) {
32 let port = parseInt(val, 10);
33
34 if (isNaN(port)) {
35 // named pipe
36 return val;
37 }
38
39 if (port >= 0) {
40 // port number
41 return port;
42 }
43
44 return false;
45}
46
47
48const envConfigurations = {

Callers 1

env.jsFile · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected