mirror of
https://github.com/jwetzell/osc-js.git
synced 2026-08-12 10:43:40 +00:00
messageToBuffer should error on invalid address
This commit is contained in:
@@ -28,6 +28,10 @@ function argsToBuffer(args: OSCArg[]) {
|
||||
}
|
||||
|
||||
export function messageToBuffer(message: OSCMessage): Uint8Array {
|
||||
if (!message.address.startsWith('/')) {
|
||||
throw new Error('osc message must start with a /');
|
||||
}
|
||||
|
||||
const addressBuffer = oscTypeConverterMap.s.toBuffer(message.address);
|
||||
if (addressBuffer === undefined) {
|
||||
throw new Error('problem encoding address');
|
||||
|
||||
Reference in New Issue
Block a user