npm run format:write

This commit is contained in:
2024-11-04 19:19:33 -06:00
parent 2453189b50
commit a995cf9cc9
3 changed files with 44 additions and 45 deletions
+10 -8
View File
@@ -7,11 +7,13 @@ export * from './message';
export * from './bundle';
export function fromBuffer(bytes: Uint8Array): [OSCBundle | OSCMessage | undefined, Uint8Array | undefined] {
if (bytes[0] === 47) { // starts with '/'
return messageFromBuffer(bytes);
} else if (bytes[0] === 35) { // starts with '#'
return bundleFromBuffer(bytes)
} else {
throw new Error('bytes do not look like an OSC message or bundle');
}
}
if (bytes[0] === 47) {
// starts with '/'
return messageFromBuffer(bytes);
} else if (bytes[0] === 35) {
// starts with '#'
return bundleFromBuffer(bytes);
} else {
throw new Error('bytes do not look like an OSC message or bundle');
}
}