From 071a7fd7ed0a020c80c306ba2aa86b0ed84d3542 Mon Sep 17 00:00:00 2001 From: Colin Clark Date: Wed, 13 Apr 2022 12:38:06 -0400 Subject: [PATCH] Updates to latest version of all third party dependencies. --- dist/osc-browser.js | 13 +++++++------ dist/osc-browser.min.js | 13 ++++++------- dist/osc-chromeapp.js | 13 +++++++------ dist/osc-chromeapp.min.js | 13 ++++++------- dist/osc-module.js | 13 +++++++------ dist/osc-module.min.js | 13 ++++++------- dist/osc.js | 13 +++++++------ dist/osc.min.js | 13 ++++++------- package.json | 18 +++++++++--------- tests/electron-tests/package.json | 7 ++++--- 10 files changed, 65 insertions(+), 64 deletions(-) diff --git a/dist/osc-browser.js b/dist/osc-browser.js index 2e9edb4..128e554 100644 --- a/dist/osc-browser.js +++ b/dist/osc-browser.js @@ -1,4 +1,4 @@ -/*! osc.js 2.4.2, Copyright 2022 Colin Clark | github.com/colinbdclark/osc.js */ +/*! osc.js 2.4.3, Copyright 2022 Colin Clark | github.com/colinbdclark/osc.js */ /* * osc.js: An Open Sound Control library for JavaScript that works in both the browser and Node.js @@ -209,20 +209,21 @@ var osc = osc || {}; * @return {Uint8Array} a buffer containing the OSC-formatted string */ osc.writeString = function (str) { - var terminated = str + "\u0000", - len = terminated.length, - paddedLen = (len + 3) & ~0x03, - arr = new Uint8Array(paddedLen); var encoder = osc.isBufferEnv ? osc.writeString.withBuffer : osc.TextEncoder ? osc.writeString.withTextEncoder : null, + terminated = str + "\u0000", encodedStr; if (encoder) { encodedStr = encoder(terminated); } - for (var i = 0; i < terminated.length; i++) { + var len = encoder ? encodedStr.length : terminated.length, + paddedLen = (len + 3) & ~0x03, + arr = new Uint8Array(paddedLen); + + for (var i = 0; i < len - 1; i++) { var charCode = encoder ? encodedStr[i] : terminated.charCodeAt(i); arr[i] = charCode; } diff --git a/dist/osc-browser.min.js b/dist/osc-browser.min.js index 122850e..f6923ed 100644 --- a/dist/osc-browser.min.js +++ b/dist/osc-browser.min.js @@ -1,4 +1,4 @@ -/*! osc.js 2.4.2, Copyright 2022 Colin Clark | github.com/colinbdclark/osc.js */ +/*! osc.js 2.4.3, Copyright 2022 Colin Clark | github.com/colinbdclark/osc.js */ var osc = osc || {}, osc = (!function() { "use strict"; osc.SECS_70YRS = 2208988800, osc.TWO_32 = 4294967296, osc.defaults = { @@ -47,13 +47,12 @@ var osc = osc || {}, osc = (!function() { }, osc.readString.withBuffer = function(e) { return Buffer.from(e).toString("utf-8"); }, osc.writeString = function(e) { - var t, r = e + "\0", e = r.length, n = new Uint8Array(e + 3 & -4), i = osc.isBufferEnv ? osc.writeString.withBuffer : osc.TextEncoder ? osc.writeString.withTextEncoder : null; - i && (t = i(r)); - for (var s = 0; s < r.length; s++) { - var o = i ? t[s] : r.charCodeAt(s); - n[s] = o; + for (var t, r = osc.isBufferEnv ? osc.writeString.withBuffer : osc.TextEncoder ? osc.writeString.withTextEncoder : null, n = e + "\0", i = (r && (t = r(n)), + (r ? t : n).length), s = new Uint8Array(i + 3 & -4), o = 0; o < i - 1; o++) { + var a = r ? t[o] : n.charCodeAt(o); + s[o] = a; } - return n; + return s; }, osc.writeString.withTextEncoder = function(e) { return osc.TextEncoder.encode(e); }, osc.writeString.withBuffer = function(e) { diff --git a/dist/osc-chromeapp.js b/dist/osc-chromeapp.js index 7ed6788..5d52eef 100644 --- a/dist/osc-chromeapp.js +++ b/dist/osc-chromeapp.js @@ -1,4 +1,4 @@ -/*! osc.js 2.4.2, Copyright 2022 Colin Clark | github.com/colinbdclark/osc.js */ +/*! osc.js 2.4.3, Copyright 2022 Colin Clark | github.com/colinbdclark/osc.js */ /* * osc.js: An Open Sound Control library for JavaScript that works in both the browser and Node.js @@ -209,20 +209,21 @@ var osc = osc || {}; * @return {Uint8Array} a buffer containing the OSC-formatted string */ osc.writeString = function (str) { - var terminated = str + "\u0000", - len = terminated.length, - paddedLen = (len + 3) & ~0x03, - arr = new Uint8Array(paddedLen); var encoder = osc.isBufferEnv ? osc.writeString.withBuffer : osc.TextEncoder ? osc.writeString.withTextEncoder : null, + terminated = str + "\u0000", encodedStr; if (encoder) { encodedStr = encoder(terminated); } - for (var i = 0; i < terminated.length; i++) { + var len = encoder ? encodedStr.length : terminated.length, + paddedLen = (len + 3) & ~0x03, + arr = new Uint8Array(paddedLen); + + for (var i = 0; i < len - 1; i++) { var charCode = encoder ? encodedStr[i] : terminated.charCodeAt(i); arr[i] = charCode; } diff --git a/dist/osc-chromeapp.min.js b/dist/osc-chromeapp.min.js index 7e1cc1e..90fa031 100644 --- a/dist/osc-chromeapp.min.js +++ b/dist/osc-chromeapp.min.js @@ -1,4 +1,4 @@ -/*! osc.js 2.4.2, Copyright 2022 Colin Clark | github.com/colinbdclark/osc.js */ +/*! osc.js 2.4.3, Copyright 2022 Colin Clark | github.com/colinbdclark/osc.js */ var osc = osc || {}, osc = (!function() { "use strict"; osc.SECS_70YRS = 2208988800, osc.TWO_32 = 4294967296, osc.defaults = { @@ -47,13 +47,12 @@ var osc = osc || {}, osc = (!function() { }, osc.readString.withBuffer = function(e) { return Buffer.from(e).toString("utf-8"); }, osc.writeString = function(e) { - var t, r = e + "\0", e = r.length, n = new Uint8Array(e + 3 & -4), i = osc.isBufferEnv ? osc.writeString.withBuffer : osc.TextEncoder ? osc.writeString.withTextEncoder : null; - i && (t = i(r)); - for (var s = 0; s < r.length; s++) { - var o = i ? t[s] : r.charCodeAt(s); - n[s] = o; + for (var t, r = osc.isBufferEnv ? osc.writeString.withBuffer : osc.TextEncoder ? osc.writeString.withTextEncoder : null, n = e + "\0", i = (r && (t = r(n)), + (r ? t : n).length), s = new Uint8Array(i + 3 & -4), o = 0; o < i - 1; o++) { + var c = r ? t[o] : n.charCodeAt(o); + s[o] = c; } - return n; + return s; }, osc.writeString.withTextEncoder = function(e) { return osc.TextEncoder.encode(e); }, osc.writeString.withBuffer = function(e) { diff --git a/dist/osc-module.js b/dist/osc-module.js index b561651..1719c57 100644 --- a/dist/osc-module.js +++ b/dist/osc-module.js @@ -1,4 +1,4 @@ -/*! osc.js 2.4.2, Copyright 2022 Colin Clark | github.com/colinbdclark/osc.js */ +/*! osc.js 2.4.3, Copyright 2022 Colin Clark | github.com/colinbdclark/osc.js */ (function (root, factory) { if (typeof exports === "object") { @@ -227,20 +227,21 @@ var osc = osc || {}; * @return {Uint8Array} a buffer containing the OSC-formatted string */ osc.writeString = function (str) { - var terminated = str + "\u0000", - len = terminated.length, - paddedLen = (len + 3) & ~0x03, - arr = new Uint8Array(paddedLen); var encoder = osc.isBufferEnv ? osc.writeString.withBuffer : osc.TextEncoder ? osc.writeString.withTextEncoder : null, + terminated = str + "\u0000", encodedStr; if (encoder) { encodedStr = encoder(terminated); } - for (var i = 0; i < terminated.length; i++) { + var len = encoder ? encodedStr.length : terminated.length, + paddedLen = (len + 3) & ~0x03, + arr = new Uint8Array(paddedLen); + + for (var i = 0; i < len - 1; i++) { var charCode = encoder ? encodedStr[i] : terminated.charCodeAt(i); arr[i] = charCode; } diff --git a/dist/osc-module.min.js b/dist/osc-module.min.js index 6b95b98..7796d94 100644 --- a/dist/osc-module.min.js +++ b/dist/osc-module.min.js @@ -1,4 +1,4 @@ -/*! osc.js 2.4.2, Copyright 2022 Colin Clark | github.com/colinbdclark/osc.js */ +/*! osc.js 2.4.3, Copyright 2022 Colin Clark | github.com/colinbdclark/osc.js */ !function(i, o) { "object" == typeof exports ? (i.osc = exports, o(0, require("slip"), require("EventEmitter"), require("long"))) : "function" == typeof define && define.amd ? define([ "exports", "slip", "EventEmitter", "long" ], function(e, t, r, n) { return i.osc = e, i.osc, o(0, t, r, n); @@ -51,13 +51,12 @@ }, c.readString.withBuffer = function(e) { return Buffer.from(e).toString("utf-8"); }, c.writeString = function(e) { - var t, r = e + "\0", e = r.length, n = new Uint8Array(e + 3 & -4), i = c.isBufferEnv ? c.writeString.withBuffer : c.TextEncoder ? c.writeString.withTextEncoder : null; - i && (t = i(r)); - for (var o = 0; o < r.length; o++) { - var a = i ? t[o] : r.charCodeAt(o); - n[o] = a; + for (var t, r = c.isBufferEnv ? c.writeString.withBuffer : c.TextEncoder ? c.writeString.withTextEncoder : null, n = e + "\0", i = (r && (t = r(n)), + (r ? t : n).length), o = new Uint8Array(i + 3 & -4), a = 0; a < i - 1; a++) { + var s = r ? t[a] : n.charCodeAt(a); + o[a] = s; } - return n; + return o; }, c.writeString.withTextEncoder = function(e) { return c.TextEncoder.encode(e); }, c.writeString.withBuffer = function(e) { diff --git a/dist/osc.js b/dist/osc.js index a4dc3da..cd42967 100644 --- a/dist/osc.js +++ b/dist/osc.js @@ -1,4 +1,4 @@ -/*! osc.js 2.4.2, Copyright 2022 Colin Clark | github.com/colinbdclark/osc.js */ +/*! osc.js 2.4.3, Copyright 2022 Colin Clark | github.com/colinbdclark/osc.js */ /* * osc.js: An Open Sound Control library for JavaScript that works in both the browser and Node.js @@ -209,20 +209,21 @@ var osc = osc || {}; * @return {Uint8Array} a buffer containing the OSC-formatted string */ osc.writeString = function (str) { - var terminated = str + "\u0000", - len = terminated.length, - paddedLen = (len + 3) & ~0x03, - arr = new Uint8Array(paddedLen); var encoder = osc.isBufferEnv ? osc.writeString.withBuffer : osc.TextEncoder ? osc.writeString.withTextEncoder : null, + terminated = str + "\u0000", encodedStr; if (encoder) { encodedStr = encoder(terminated); } - for (var i = 0; i < terminated.length; i++) { + var len = encoder ? encodedStr.length : terminated.length, + paddedLen = (len + 3) & ~0x03, + arr = new Uint8Array(paddedLen); + + for (var i = 0; i < len - 1; i++) { var charCode = encoder ? encodedStr[i] : terminated.charCodeAt(i); arr[i] = charCode; } diff --git a/dist/osc.min.js b/dist/osc.min.js index cc3dd72..bb099be 100644 --- a/dist/osc.min.js +++ b/dist/osc.min.js @@ -1,4 +1,4 @@ -/*! osc.js 2.4.2, Copyright 2022 Colin Clark | github.com/colinbdclark/osc.js */ +/*! osc.js 2.4.3, Copyright 2022 Colin Clark | github.com/colinbdclark/osc.js */ var osc = osc || {}; !function() { @@ -49,13 +49,12 @@ var osc = osc || {}; }, osc.readString.withBuffer = function(e) { return Buffer.from(e).toString("utf-8"); }, osc.writeString = function(e) { - var r, t = e + "\0", e = t.length, n = new Uint8Array(e + 3 & -4), o = osc.isBufferEnv ? osc.writeString.withBuffer : osc.TextEncoder ? osc.writeString.withTextEncoder : null; - o && (r = o(t)); - for (var i = 0; i < t.length; i++) { - var a = o ? r[i] : t.charCodeAt(i); - n[i] = a; + for (var r, t = osc.isBufferEnv ? osc.writeString.withBuffer : osc.TextEncoder ? osc.writeString.withTextEncoder : null, n = e + "\0", o = (t && (r = t(n)), + (t ? r : n).length), i = new Uint8Array(o + 3 & -4), a = 0; a < o - 1; a++) { + var s = t ? r[a] : n.charCodeAt(a); + i[a] = s; } - return n; + return i; }, osc.writeString.withTextEncoder = function(e) { return osc.TextEncoder.encode(e); }, osc.writeString.withBuffer = function(e) { diff --git a/package.json b/package.json index 3a77470..3580c61 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "osc", "main": "src/platforms/osc-node.js", - "version": "2.4.2", + "version": "2.4.3", "description": "A JavaScript Open Sound Control (OSC) library that works in Node.js and the browser.", "author": "Colin Clark", "homepage": "https://github.com/colinbdclark/osc.js", @@ -24,30 +24,30 @@ ], "readmeFilename": "README.md", "devDependencies": { - "grunt": "1.4.1", + "grunt": "1.5.2", "grunt-contrib-clean": "2.0.0", - "grunt-contrib-concat": "1.0.1", + "grunt-contrib-concat": "2.1.0", "grunt-replace": "2.0.2", - "grunt-contrib-jshint": "3.0.0", - "grunt-contrib-uglify": "5.0.1", - "infusion": "3.0.0-dev.20210706T155146Z.9ffd91df3", + "grunt-contrib-jshint": "3.2.0", + "grunt-contrib-uglify": "5.1.0", + "infusion": "3.0.0", "jquery": "3.6.0", "node-jqunit": "1.1.9", "requirejs": "2.3.6", - "testem": "3.4.2" + "testem": "3.6.0" }, "dependencies": { "long": "4.0.0", "slip": "1.0.2", "wolfy87-eventemitter": "5.2.9", - "ws": "7.5.3" + "ws": "8.5.0" }, "optionalDependencies": { "serialport": "10.4.0" }, "scripts": { "test": "npm run node-test && grunt && npm run browser-test", - "build": "grunt", + "build": "node_modules/.bin/grunt", "node-test": "node tests/node-all-tests.js", "browser-test": "testem ci --file tests/testem.json", "clean-test": "./clean-npm.sh && npm install && npm test" diff --git a/tests/electron-tests/package.json b/tests/electron-tests/package.json index 5fffc98..b7439c3 100644 --- a/tests/electron-tests/package.json +++ b/tests/electron-tests/package.json @@ -5,11 +5,12 @@ "version": "1.0.0", "author": "Colin Clark", "dependencies": { - "electron": "13.1.7", - "infusion-electron": "0.8.0", + "electron": "18.0.3", + "infusion-electron": "0.8.1", "osc": "../.." }, "scripts": { - "test": "npm rebuild && node_modules/.bin/electron ." + "test": "node_modules/.bin/electron .", + "test-rebuild": "npm rebuild && npm test" } }