Merge pull request #28 from tradle/createSocket

allow options to be passed into createSocket
This commit is contained in:
Andy Prock 2016-11-07 14:56:50 -08:00 committed by GitHub
commit 0825e2b1d4

View File

@ -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;