Skip to content

Commit

Permalink
Merge branch 'master' into gh-92
Browse files Browse the repository at this point in the history
  • Loading branch information
colinbdclark committed May 15, 2019
2 parents 6a47ea5 + 388e526 commit 6c8d34d
Show file tree
Hide file tree
Showing 18 changed files with 251 additions and 210 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,4 @@ bower_components
.npm
.npmrc
.vagrant
package-lock.json
22 changes: 21 additions & 1 deletion Gruntfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,25 @@ module.exports = function(grunt) {
}
},

replace: {
dist: {
options: {
patterns: [
{
match: /\.\.\/osc.js/g,
replacement: "./osc.js"
}
]
},
files: [
{
src: "dist/*.js",
dest: "./"
}
]
}
},

uglify: {
options: {
banner: "<%= oscjs.banners.short %>",
Expand Down Expand Up @@ -115,9 +134,10 @@ module.exports = function(grunt) {

// Load relevant Grunt plugins.
grunt.loadNpmTasks("grunt-contrib-concat");
grunt.loadNpmTasks("grunt-replace");
grunt.loadNpmTasks("grunt-contrib-uglify");
grunt.loadNpmTasks("grunt-contrib-clean");
grunt.loadNpmTasks("grunt-contrib-jshint");

grunt.registerTask("default", ["clean", "jshint", "concat", "uglify"]);
grunt.registerTask("default", ["clean", "jshint", "concat", "replace", "uglify"]);
};
10 changes: 5 additions & 5 deletions dist/osc-browser.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/*! osc.js 2.2.4, Copyright 2018 Colin Clark | github.com/colinbdclark/osc.js */
/*! osc.js 2.3.0, Copyright 2019 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
Expand Down Expand Up @@ -117,7 +117,7 @@ var osc = osc || {};
osc.nativeBuffer = function (obj) {
if (osc.isBufferEnv) {
return osc.isBuffer(obj) ? obj :
new Buffer(obj.buffer ? obj : new Uint8Array(obj));
Buffer.from(obj.buffer ? obj : new Uint8Array(obj));
}

return osc.isTypedArrayView(obj) ? obj : new Uint8Array(obj);
Expand Down Expand Up @@ -1302,9 +1302,9 @@ var osc = osc || {};
}));
;
/*!
* EventEmitter v5.2.5 - git.io/ee
* EventEmitter v5.2.6 - git.io/ee
* Unlicense - http://unlicense.org/
* Oliver Caldwell - http://oli.me.uk/
* Oliver Caldwell - https://oli.me.uk/
* @preserve
*/

Expand Down Expand Up @@ -2021,7 +2021,7 @@ var osc = osc || require("./osc.js"),

/*global WebSocket, require*/

var osc = osc || require("../osc.js");
var osc = osc || require("./osc.js");

(function () {

Expand Down
84 changes: 41 additions & 43 deletions dist/osc-browser.min.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/*! osc.js 2.2.4, Copyright 2018 Colin Clark | github.com/colinbdclark/osc.js */
/*! osc.js 2.3.0, Copyright 2019 Colin Clark | github.com/colinbdclark/osc.js */


var osc = osc || {};
Expand All @@ -25,7 +25,7 @@ var osc = osc || {};
if (!(t instanceof ArrayBuffer || void 0 !== t.length && "string" != typeof t)) throw new Error("Can't wrap a non-array-like object as Uint8Array. Object was: " + JSON.stringify(e, null, 2));
return new Uint8Array(t);
}, osc.nativeBuffer = function(e) {
return osc.isBufferEnv ? osc.isBuffer(e) ? e : new Buffer(e.buffer ? e : new Uint8Array(e)) : osc.isTypedArrayView(e) ? e : new Uint8Array(e);
return osc.isBufferEnv ? osc.isBuffer(e) ? e : Buffer.from(e.buffer ? e : new Uint8Array(e)) : osc.isTypedArrayView(e) ? e : new Uint8Array(e);
}, osc.copyByteArray = function(e, t, r) {
if (osc.isTypedArrayView(e) && osc.isTypedArrayView(t)) t.set(e, r); else for (var n = void 0 === r ? 0 : r, i = Math.min(t.length - r, e.length), s = 0, o = n; s < i; s++,
o++) t[o] = e[s];
Expand Down Expand Up @@ -94,7 +94,7 @@ var osc = osc || {};
var r = osc.readInt32(e, t), n = r + 3 & -4, i = new Uint8Array(e.buffer, t.idx, r);
return t.idx += n, i;
}, osc.writeBlob = function(e) {
var t = (e = osc.byteArray(e)).byteLength, r = new Uint8Array((t + 3 & -4) + 4), n = new DataView(r.buffer);
var t = (e = osc.byteArray(e)).byteLength, r = new Uint8Array(4 + (t + 3 & -4)), n = new DataView(r.buffer);
return osc.writeInt32(t, n), r.set(e, 4), r;
}, osc.readMIDIBytes = function(e, t) {
var r = new Uint8Array(e.buffer, t.idx, 4);
Expand Down Expand Up @@ -368,34 +368,7 @@ var osc = osc || {};
}(), function(e, t) {
"object" == typeof exports && "object" == typeof module ? module.exports = t() : "function" == typeof define && define.amd ? define([], t) : "object" == typeof exports ? exports.Long = t() : e.Long = t();
}("undefined" != typeof self ? self : this, function() {
return function(r) {
function n(e) {
if (i[e]) return i[e].exports;
var t = i[e] = {
i: e,
l: !1,
exports: {}
};
return r[e].call(t.exports, t, t.exports, n), t.l = !0, t.exports;
}
var i = {};
return n.m = r, n.c = i, n.d = function(e, t, r) {
n.o(e, t) || Object.defineProperty(e, t, {
configurable: !1,
enumerable: !0,
get: r
});
}, n.n = function(e) {
var t = e && e.__esModule ? function() {
return e.default;
} : function() {
return e;
};
return n.d(t, "a", t), t;
}, n.o = function(e, t) {
return Object.prototype.hasOwnProperty.call(e, t);
}, n.p = "", n(n.s = 0);
}([ function(e, t) {
return i = {}, n.m = r = [ function(e, t) {
function n(e, t, r) {
this.low = 0 | e, this.high = 0 | t, this.unsigned = !!r;
}
Expand Down Expand Up @@ -442,9 +415,9 @@ var osc = osc || {};
return "number" == typeof e ? l(e, t) : "string" == typeof e ? h(e, t) : p(e.low, e.high, "boolean" == typeof t ? t : e.unsigned);
}
e.exports = n;
var w = null;
var y = null;
try {
w = new WebAssembly.Instance(new WebAssembly.Module(new Uint8Array([ 0, 97, 115, 109, 1, 0, 0, 0, 1, 13, 2, 96, 0, 1, 127, 96, 4, 127, 127, 127, 127, 1, 127, 3, 7, 6, 0, 1, 1, 1, 1, 1, 6, 6, 1, 127, 1, 65, 0, 11, 7, 50, 6, 3, 109, 117, 108, 0, 1, 5, 100, 105, 118, 95, 115, 0, 2, 5, 100, 105, 118, 95, 117, 0, 3, 5, 114, 101, 109, 95, 115, 0, 4, 5, 114, 101, 109, 95, 117, 0, 5, 8, 103, 101, 116, 95, 104, 105, 103, 104, 0, 0, 10, 191, 1, 6, 4, 0, 35, 0, 11, 36, 1, 1, 126, 32, 0, 173, 32, 1, 173, 66, 32, 134, 132, 32, 2, 173, 32, 3, 173, 66, 32, 134, 132, 126, 34, 4, 66, 32, 135, 167, 36, 0, 32, 4, 167, 11, 36, 1, 1, 126, 32, 0, 173, 32, 1, 173, 66, 32, 134, 132, 32, 2, 173, 32, 3, 173, 66, 32, 134, 132, 127, 34, 4, 66, 32, 135, 167, 36, 0, 32, 4, 167, 11, 36, 1, 1, 126, 32, 0, 173, 32, 1, 173, 66, 32, 134, 132, 32, 2, 173, 32, 3, 173, 66, 32, 134, 132, 128, 34, 4, 66, 32, 135, 167, 36, 0, 32, 4, 167, 11, 36, 1, 1, 126, 32, 0, 173, 32, 1, 173, 66, 32, 134, 132, 32, 2, 173, 32, 3, 173, 66, 32, 134, 132, 129, 34, 4, 66, 32, 135, 167, 36, 0, 32, 4, 167, 11, 36, 1, 1, 126, 32, 0, 173, 32, 1, 173, 66, 32, 134, 132, 32, 2, 173, 32, 3, 173, 66, 32, 134, 132, 130, 34, 4, 66, 32, 135, 167, 36, 0, 32, 4, 167, 11 ])), {}).exports;
y = new WebAssembly.Instance(new WebAssembly.Module(new Uint8Array([ 0, 97, 115, 109, 1, 0, 0, 0, 1, 13, 2, 96, 0, 1, 127, 96, 4, 127, 127, 127, 127, 1, 127, 3, 7, 6, 0, 1, 1, 1, 1, 1, 6, 6, 1, 127, 1, 65, 0, 11, 7, 50, 6, 3, 109, 117, 108, 0, 1, 5, 100, 105, 118, 95, 115, 0, 2, 5, 100, 105, 118, 95, 117, 0, 3, 5, 114, 101, 109, 95, 115, 0, 4, 5, 114, 101, 109, 95, 117, 0, 5, 8, 103, 101, 116, 95, 104, 105, 103, 104, 0, 0, 10, 191, 1, 6, 4, 0, 35, 0, 11, 36, 1, 1, 126, 32, 0, 173, 32, 1, 173, 66, 32, 134, 132, 32, 2, 173, 32, 3, 173, 66, 32, 134, 132, 126, 34, 4, 66, 32, 135, 167, 36, 0, 32, 4, 167, 11, 36, 1, 1, 126, 32, 0, 173, 32, 1, 173, 66, 32, 134, 132, 32, 2, 173, 32, 3, 173, 66, 32, 134, 132, 127, 34, 4, 66, 32, 135, 167, 36, 0, 32, 4, 167, 11, 36, 1, 1, 126, 32, 0, 173, 32, 1, 173, 66, 32, 134, 132, 32, 2, 173, 32, 3, 173, 66, 32, 134, 132, 128, 34, 4, 66, 32, 135, 167, 36, 0, 32, 4, 167, 11, 36, 1, 1, 126, 32, 0, 173, 32, 1, 173, 66, 32, 134, 132, 32, 2, 173, 32, 3, 173, 66, 32, 134, 132, 129, 34, 4, 66, 32, 135, 167, 36, 0, 32, 4, 167, 11, 36, 1, 1, 126, 32, 0, 173, 32, 1, 173, 66, 32, 134, 132, 32, 2, 173, 32, 3, 173, 66, 32, 134, 132, 130, 34, 4, 66, 32, 135, 167, 36, 0, 32, 4, 167, 11 ])), {}).exports;
} catch (e) {}
Object.defineProperty(n.prototype, "__isLong__", {
value: !0
Expand All @@ -453,7 +426,7 @@ var osc = osc || {};
n.fromInt = r, n.fromNumber = l, n.fromBits = p;
var f = Math.pow;
n.fromString = h, n.fromValue = v;
var i = 4294967296, a = i * i, u = a / 2, y = r(1 << 24), m = r(0);
var i = 4294967296, a = i * i, u = a / 2, w = r(1 << 24), m = r(0);
n.ZERO = m;
var c = r(0, !0);
n.UZERO = c;
Expand Down Expand Up @@ -539,20 +512,20 @@ var osc = osc || {};
return g(e) || (e = v(e)), this.add(e.neg());
}, P.sub = P.subtract, P.multiply = function(e) {
if (this.isZero()) return m;
if (g(e) || (e = v(e)), w) return p(w.mul(this.low, this.high, e.low, e.high), w.get_high(), this.unsigned);
if (g(e) || (e = v(e)), y) return p(y.mul(this.low, this.high, e.low, e.high), y.get_high(), this.unsigned);
if (e.isZero()) return m;
if (this.eq(B)) return e.isOdd() ? B : m;
if (e.eq(B)) return this.isOdd() ? B : m;
if (this.isNegative()) return e.isNegative() ? this.neg().mul(e.neg()) : this.neg().mul(e).neg();
if (e.isNegative()) return this.mul(e.neg()).neg();
if (this.lt(y) && e.lt(y)) return l(this.toNumber() * e.toNumber(), this.unsigned);
if (this.lt(w) && e.lt(w)) return l(this.toNumber() * e.toNumber(), this.unsigned);
var t = this.high >>> 16, r = 65535 & this.high, n = this.low >>> 16, i = 65535 & this.low, s = e.high >>> 16, o = 65535 & e.high, a = e.low >>> 16, u = 65535 & e.low, c = 0, h = 0, f = 0, d = 0;
return f += (d += i * u) >>> 16, h += (f += n * u) >>> 16, f &= 65535, h += (f += i * a) >>> 16,
c += (h += r * u) >>> 16, h &= 65535, c += (h += n * a) >>> 16, h &= 65535, c += (h += i * o) >>> 16,
c += t * u + r * a + n * o + i * s, p((f &= 65535) << 16 | (d &= 65535), (c &= 65535) << 16 | (h &= 65535), this.unsigned);
}, P.mul = P.multiply, P.divide = function(e) {
if (g(e) || (e = v(e)), e.isZero()) throw Error("division by zero");
if (w) return this.unsigned || -2147483648 !== this.high || -1 !== e.low || -1 !== e.high ? p((this.unsigned ? w.div_u : w.div_s)(this.low, this.high, e.low, e.high), w.get_high(), this.unsigned) : this;
if (y) return this.unsigned || -2147483648 !== this.high || -1 !== e.low || -1 !== e.high ? p((this.unsigned ? y.div_u : y.div_s)(this.low, this.high, e.low, e.high), y.get_high(), this.unsigned) : this;
if (this.isZero()) return this.unsigned ? c : m;
var t, r, n;
if (this.unsigned) {
Expand All @@ -574,7 +547,7 @@ var osc = osc || {};
}
return n;
}, P.div = P.divide, P.modulo = function(e) {
return g(e) || (e = v(e)), w ? p((this.unsigned ? w.rem_u : w.rem_s)(this.low, this.high, e.low, e.high), w.get_high(), this.unsigned) : this.sub(this.div(e).mul(e));
return g(e) || (e = v(e)), y ? p((this.unsigned ? y.rem_u : y.rem_s)(this.low, this.high, e.low, e.high), y.get_high(), this.unsigned) : this.sub(this.div(e).mul(e));
}, P.mod = P.modulo, P.rem = P.modulo, P.not = function() {
return p(~this.low, ~this.high, this.unsigned);
}, P.and = function(e) {
Expand Down Expand Up @@ -610,7 +583,32 @@ var osc = osc || {};
}, n.fromBytesBE = function(e, t) {
return new n(e[4] << 24 | e[5] << 16 | e[6] << 8 | e[7], e[0] << 24 | e[1] << 16 | e[2] << 8 | e[3], t);
};
} ]);
} ], n.c = i, n.d = function(e, t, r) {
n.o(e, t) || Object.defineProperty(e, t, {
configurable: !1,
enumerable: !0,
get: r
});
}, n.n = function(e) {
var t = e && e.__esModule ? function() {
return e.default;
} : function() {
return e;
};
return n.d(t, "a", t), t;
}, n.o = function(e, t) {
return Object.prototype.hasOwnProperty.call(e, t);
}, n.p = "", n(n.s = 0);
function n(e) {
if (i[e]) return i[e].exports;
var t = i[e] = {
i: e,
l: !1,
exports: {}
};
return r[e].call(t.exports, t, t.exports, n), t.l = !0, t.exports;
}
var r, i;
}), function(t, r) {
"use strict";
"object" == typeof exports ? (t.slip = exports, r(exports)) : "function" == typeof define && define.amd ? define([ "exports" ], function(e) {
Expand Down Expand Up @@ -734,7 +732,7 @@ var osc = osc || {};
return this;
}, r.removeEvent = function(e) {
var t, r = typeof e, n = this._getEvents();
if ("string" === r) delete n[e]; else if (e instanceof RegExp) for (t in n) n.hasOwnProperty(t) && e.test(t) && delete n[t]; else delete this._events;
if ("string" == r) delete n[e]; else if (e instanceof RegExp) for (t in n) n.hasOwnProperty(t) && e.test(t) && delete n[t]; else delete this._events;
return this;
}, r.removeAllListeners = i("removeEvent"), r.emitEvent = function(e, t) {
var r, n, i, s, o = this.getListenersAsObject(e);
Expand Down Expand Up @@ -823,9 +821,9 @@ var slip = slip || require("slip"), EventEmitter = EventEmitter || require("even
this.decoder.decode(e, t);
}, osc.relay = function(e, t, r, n, i, s) {
r = r || "message", n = n || "send", i = i || function() {}, s = s ? [ null ].concat(s) : [];
var o = function(e) {
function o(e) {
s[0] = e, e = i(e), t[n].apply(t, s);
};
}
return e.on(r, o), {
eventName: r,
listener: o
Expand All @@ -851,7 +849,7 @@ var slip = slip || require("slip"), EventEmitter = EventEmitter || require("even
}, "undefined" != typeof module && module.exports && (module.exports = osc);
}();

osc = osc || require("../osc.js");
osc = osc || require("./osc.js");

!function() {
"use strict";
Expand Down
10 changes: 5 additions & 5 deletions dist/osc-chromeapp.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/*! osc.js 2.2.4, Copyright 2018 Colin Clark | github.com/colinbdclark/osc.js */
/*! osc.js 2.3.0, Copyright 2019 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
Expand Down Expand Up @@ -117,7 +117,7 @@ var osc = osc || {};
osc.nativeBuffer = function (obj) {
if (osc.isBufferEnv) {
return osc.isBuffer(obj) ? obj :
new Buffer(obj.buffer ? obj : new Uint8Array(obj));
Buffer.from(obj.buffer ? obj : new Uint8Array(obj));
}

return osc.isTypedArrayView(obj) ? obj : new Uint8Array(obj);
Expand Down Expand Up @@ -1302,9 +1302,9 @@ var osc = osc || {};
}));
;
/*!
* EventEmitter v5.2.5 - git.io/ee
* EventEmitter v5.2.6 - git.io/ee
* Unlicense - http://unlicense.org/
* Oliver Caldwell - http://oli.me.uk/
* Oliver Caldwell - https://oli.me.uk/
* @preserve
*/

Expand Down Expand Up @@ -2021,7 +2021,7 @@ var osc = osc || require("./osc.js"),

/*global WebSocket, require*/

var osc = osc || require("../osc.js");
var osc = osc || require("./osc.js");

(function () {

Expand Down
Loading

0 comments on commit 6c8d34d

Please sign in to comment.