UNPKG

unicast

Version:

Unicast implementation of UDP Datagram sockets.

15 lines (11 loc) 261 B
'use strict'; const dgram = require('dgram'); module.exports = isSocket; /** * Check if an argument is a valid socket object. * @param {any} maybeSocket * @return {bool} */ function isSocket(maybeSocket) { return maybeSocket instanceof dgram.Socket; }