UNPKG

lux-framework

Version:

Build scalable, Node.js-powered REST APIs with almost no code.

18 lines (14 loc) 274 B
// @flow /** * @private */ export default function normalizePort(port?: string | number): number { switch (typeof port) { case 'string': return Number.parseInt(port, 10); case 'number': return Math.abs(port); default: return 4000; } }