1/**
2 * Normalize a port into a number, string, or false.
3 */
4function normalizePort(val) {
5 var port = parseInt(val, 10);
6
7 if (isNaN(port)) {
8 // named pipe
9 return val;
10 }
11
12 if (port >= 0) {
13 // port number
14 return port;
15 }
16
17 return false;
18}
19