New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

node-osc

Package Overview
Dependencies
Maintainers
1
Versions
96
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

node-osc - npm Package Compare versions

Comparing version 4.1.6 to 4.1.7

43

lib/Client.js

@@ -30,6 +30,9 @@ 'use strict';

let message = args[0];
let callback = () => {};
let callback;
if (typeof args[args.length - 1] === 'function') {
callback = args.pop();
}
else {
callback = () => {};
}

@@ -45,18 +48,26 @@ if (message instanceof Array) {

let buf;
switch (typeof message) {
case 'object':
buf = toBuffer(message);
this._sock.send(buf, 0, buf.length, this.port, this.host, callback);
break;
case 'string':
mes = new Message(args[0]);
for (let i = 1; i < args.length; i++) {
mes.append(args[i]);
}
buf = toBuffer(mes);
this._sock.send(buf, 0, buf.length, this.port, this.host, callback);
break;
default:
throw new Error('That Message Just Doesn\'t Seem Right');
try {
switch (typeof message) {
case 'object':
buf = toBuffer(message);
this._sock.send(buf, 0, buf.length, this.port, this.host, callback);
break;
case 'string':
mes = new Message(args[0]);
for (let i = 1; i < args.length; i++) {
mes.append(args[i]);
}
buf = toBuffer(mes);
this._sock.send(buf, 0, buf.length, this.port, this.host, callback);
break;
default:
throw new TypeError('That Message Just Doesn\'t Seem Right');
}
}
catch (e) {
if (e.code !== 'ERR_SOCKET_DGRAM_NOT_RUNNING') throw e;
const error = new ReferenceError('Cannot send message on closed socket.');
error.code = e.code;
callback(error);
}
}

@@ -63,0 +74,0 @@ }

{
"name": "node-osc",
"description": "pyOSC inspired library",
"version": "4.1.6",
"version": "4.1.7",
"main": "./lib/index.js",

@@ -6,0 +6,0 @@ "exports": {

@@ -76,3 +76,4 @@ 'use strict';

t.plan(1);
t.plan(2);
t.throws(() => {

@@ -84,2 +85,5 @@ client.send(123, (err) => {

client.close();
client.send('/boom', (err) => {
t.equals(err.code, 'ERR_SOCKET_DGRAM_NOT_RUNNING');
});
});
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc