mirror of
https://github.com/jwetzell/osc-js.git
synced 2026-08-20 14:29:00 +00:00
add support for osc infinitum type
This commit is contained in:
@@ -173,7 +173,7 @@ export const oscTypeConverterMap: { [key: string]: OSCTypeConverter } = {
|
|||||||
},
|
},
|
||||||
r: {
|
r: {
|
||||||
toBuffer: (color) => {
|
toBuffer: (color) => {
|
||||||
if (color === undefined || color === null){
|
if (color === undefined || color === null) {
|
||||||
throw new TypeError('osc type r called with undefined or null value');
|
throw new TypeError('osc type r called with undefined or null value');
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -228,4 +228,12 @@ export const oscTypeConverterMap: { [key: string]: OSCTypeConverter } = {
|
|||||||
return [null, buffer];
|
return [null, buffer];
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
I: {
|
||||||
|
toBuffer: () => {
|
||||||
|
return new Uint8Array();
|
||||||
|
},
|
||||||
|
fromBuffer: (buffer) => {
|
||||||
|
return [Number.MAX_SAFE_INTEGER, buffer];
|
||||||
|
},
|
||||||
|
},
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -48,6 +48,11 @@ const tests = [
|
|||||||
bytes: new Uint8Array([47, 104, 101, 108, 108, 111, 0, 0, 44, 78, 0, 0]),
|
bytes: new Uint8Array([47, 104, 101, 108, 108, 111, 0, 0, 44, 78, 0, 0]),
|
||||||
expected: { address: '/hello', args: [{ type: 'N', value: null }] },
|
expected: { address: '/hello', args: [{ type: 'N', value: null }] },
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
description: 'simple address Inifinitum arg',
|
||||||
|
bytes: new Uint8Array([47, 104, 101, 108, 108, 111, 0, 0, 44, 73, 0, 0]),
|
||||||
|
expected: { address: '/hello', args: [{ type: 'I', value: Number.MAX_SAFE_INTEGER }] },
|
||||||
|
},
|
||||||
{
|
{
|
||||||
description: 'osc 1.0 spec example 1',
|
description: 'osc 1.0 spec example 1',
|
||||||
bytes: new Uint8Array([
|
bytes: new Uint8Array([
|
||||||
|
|||||||
Reference in New Issue
Block a user