From 7423850bf651cde0cdec206931e98980e0eb2f55 Mon Sep 17 00:00:00 2001 From: Andy Prock Date: Mon, 7 Nov 2016 14:53:58 -0800 Subject: [PATCH] allow options to be passed into createSocket --- UdpSockets.js | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/UdpSockets.js b/UdpSockets.js index e2e3cb6..5335f1c 100644 --- a/UdpSockets.js +++ b/UdpSockets.js @@ -6,10 +6,9 @@ var UdpSocket = require('./UdpSocket'); -exports.createSocket = function(type) { - return new UdpSocket({ - type: type - }) +exports.createSocket = function(options) { + if (typeof options === 'string') options = { type: options } + return new UdpSocket(options) } exports.Socket = UdpSocket;