fromBuffer methods should return any unprocessed results

This commit is contained in:
2024-10-13 15:22:28 -05:00
parent 27585b8f55
commit f47aae936f
2 changed files with 13 additions and 12 deletions
+4 -4
View File
@@ -46,7 +46,7 @@ export function messageToBuffer(message: OSCMessage): Uint8Array {
return buffer;
}
export function messageFromBuffer(bytes: Uint8Array): OSCMessage | undefined {
export function messageFromBuffer(bytes: Uint8Array): [OSCMessage | undefined, Uint8Array | undefined] {
if (bytes[0] !== 47) {
throw new Error('osc message must start with a /');
}
@@ -78,11 +78,11 @@ export function messageFromBuffer(bytes: Uint8Array): OSCMessage | undefined {
}
argsBuffer = remainingBytes;
}
return {
return [{
address,
args: oscArgs,
};
}, argsBuffer];
}
}
return [undefined, undefined]
}