Branded numeric type for 16-bit unsigned integers. Range: [0, 2^16 - 1] or [0, 65,535]
const isUint16 = (x: number): x is Uint16 => Number.isSafeInteger(x) && x >= 0 && x <= 2**16 - 1;const port = (num: Uint16) => ({ port: num });const characterCode = (code: Uint16) => String.fromCharCode(code); Copy
const isUint16 = (x: number): x is Uint16 => Number.isSafeInteger(x) && x >= 0 && x <= 2**16 - 1;const port = (num: Uint16) => ({ port: num });const characterCode = (code: Uint16) => String.fromCharCode(code);
Branded numeric type for 16-bit unsigned integers. Range: [0, 2^16 - 1] or [0, 65,535]