diff --git a/bower.json b/bower.json index 9682a8b..9ccc6a1 100644 --- a/bower.json +++ b/bower.json @@ -1,7 +1,7 @@ { "name": "osc-js", "description": "OSC library for Node.js and the browser, with customizable Plugin API for WebSocket, UDP or bridge networking", - "version": "1.0.2", + "version": "1.0.3", "main": "dist/osc.js", "authors": [ "Andreas Dzialocha" diff --git a/dist/osc.js b/dist/osc.js index af1bd20..f3f6923 100644 --- a/dist/osc.js +++ b/dist/osc.js @@ -1,7 +1,7 @@ (function (global, factory) { - typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() : - typeof define === 'function' && define.amd ? define(factory) : - (global.OSC = factory()); + typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() : + typeof define === 'function' && define.amd ? define(factory) : + (global.OSC = factory()); }(this, (function () { 'use strict'; function isInt(n) { @@ -43,22 +43,6 @@ function dataView(obj) { return new DataView(new Uint8Array(obj)); } -var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { - return typeof obj; -} : function (obj) { - return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; -}; - - - - - - - - - - - var classCallCheck = function (instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); @@ -148,30 +132,6 @@ var possibleConstructorReturn = function (self, call) { return call && (typeof call === "object" || typeof call === "function") ? call : self; }; - - -var set = function set(object, property, value, receiver) { - var desc = Object.getOwnPropertyDescriptor(object, property); - - if (desc === undefined) { - var parent = Object.getPrototypeOf(object); - - if (parent !== null) { - set(parent, property, value, receiver); - } - } else if ("value" in desc && desc.writable) { - desc.value = value; - } else { - var setter = desc.set; - - if (setter !== undefined) { - setter.call(receiver, value); - } - } - - return value; -}; - function typeTag(item) { if (isInt(item)) { return 'i'; @@ -455,7 +415,6 @@ var Message = function () { }, { key: 'pack', value: function pack() { - var _this = this; if (this.address.length === 0 || this.address[0] !== '/') { throw new Error('OSC Message has an invalid address'); } @@ -463,23 +422,21 @@ var Message = function () { encoder.add(new AtomicString(this.address)); encoder.add(new AtomicString(',' + this.types)); if (this.args.length > 0) { - (function () { - var argument = void 0; - _this.args.forEach(function (value) { - if (isInt(value)) { - argument = new AtomicInt32(value); - } else if (isFloat(value)) { - argument = new AtomicFloat32(value); - } else if (isString(value)) { - argument = new AtomicString(value); - } else if (isBlob(value)) { - argument = new AtomicBlob(value); - } else { - throw new Error('OSC Message found unknown argument type'); - } - encoder.add(argument); - }); - })(); + var argument = void 0; + this.args.forEach(function (value) { + if (isInt(value)) { + argument = new AtomicInt32(value); + } else if (isFloat(value)) { + argument = new AtomicFloat32(value); + } else if (isString(value)) { + argument = new AtomicString(value); + } else if (isBlob(value)) { + argument = new AtomicBlob(value); + } else { + throw new Error('OSC Message found unknown argument type'); + } + encoder.add(argument); + }); } return encoder.merge(); } @@ -752,8 +709,7 @@ var EventHandler = function () { open: [], error: [], close: [] - }; - this.uuid = 0; + };this.uuid = 0; } createClass(EventHandler, [{ key: 'dispatch', @@ -766,24 +722,19 @@ var EventHandler = function () { throw new Error('OSC EventHander dispatch() can\'t read empty Packets'); } if (packet.value instanceof Bundle) { - var _ret = function () { - var bundle = packet.value; - return { - v: bundle.bundleElements.forEach(function (bundleItem) { - if (packet.value instanceof Bundle) { - if (bundle.timetag.value.timestamp() < bundleItem.timetag.value.timestamp()) { - throw new Error('OSC Bundle timestamp is older than the timestamp of enclosed Bundles'); - } - return _this.dispatch(bundleItem); - } else if (bundleItem instanceof Message) { - var message = bundleItem; - return _this.notify(message.address, message, bundle.timetag.value.timestamp()); - } - throw new Error('OSC EventHander dispatch() can\'t dispatch unknown Packet value'); - }) - }; - }(); - if ((typeof _ret === 'undefined' ? 'undefined' : _typeof(_ret)) === "object") return _ret.v; + var bundle = packet.value; + return bundle.bundleElements.forEach(function (bundleItem) { + if (packet.value instanceof Bundle) { + if (bundle.timetag.value.timestamp() < bundleItem.timetag.value.timestamp()) { + throw new Error('OSC Bundle timestamp is older than the timestamp of enclosed Bundles'); + } + return _this.dispatch(bundleItem); + } else if (bundleItem instanceof Message) { + var message = bundleItem; + return _this.notify(message.address, message, bundle.timetag.value.timestamp()); + } + throw new Error('OSC EventHander dispatch() can\'t dispatch unknown Packet value'); + }); } else if (packet.value instanceof Message) { var message = packet.value; return this.notify(message.address, message); @@ -818,7 +769,6 @@ var EventHandler = function () { }, { key: 'notify', value: function notify() { - var _this2 = this; for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) { args[_key] = arguments[_key]; } @@ -850,24 +800,17 @@ var EventHandler = function () { } } if (timestamp) { - var _ret2 = function () { - var now = Date.now(); - if (now > timestamp) { - if (!_this2.options.discardLateMessages) { - return { - v: _this2.call(name, data) - }; - } + var now = Date.now(); + if (now > timestamp) { + if (!this.options.discardLateMessages) { + return this.call(name, data); } - var that = _this2; - setTimeout(function () { - that.call(name, data); - }, timestamp - now); - return { - v: true - }; - }(); - if ((typeof _ret2 === 'undefined' ? 'undefined' : _typeof(_ret2)) === "object") return _ret2.v; + } + var that = this; + setTimeout(function () { + that.call(name, data); + }, timestamp - now); + return true; } return this.call(name, data); } @@ -884,8 +827,7 @@ var EventHandler = function () { var handler = { id: this.uuid, callback: callback - }; - if (isString(name) && name in this.eventHandlers) { + };if (isString(name) && name in this.eventHandlers) { this.eventHandlers[name].push(handler); return this.uuid; } @@ -940,17 +882,14 @@ var STATUS$1 = { IS_OPEN: 1, IS_CLOSING: 2, IS_CLOSED: 3 -}; -var defaultOpenOptions = { +};var defaultOpenOptions = { host: 'localhost', port: 41234, exclusive: false -}; -var defaultSendOptions = { +};var defaultSendOptions = { host: 'localhost', port: 41235 -}; -var defaultOptions$2 = { +};var defaultOptions$2 = { type: 'udp4', open: defaultOpenOptions, send: defaultSendOptions @@ -1033,8 +972,7 @@ var STATUS$2 = { IS_OPEN: 1, IS_CLOSING: 2, IS_CLOSED: 3 -}; -var defaultOptions$3 = { +};var defaultOptions$3 = { udpServer: { host: 'localhost', port: 41234, @@ -1049,8 +987,7 @@ var defaultOptions$3 = { port: 8080 }, receiver: 'ws' -}; -function mergeOptions(base, custom) { +};function mergeOptions(base, custom) { return Object.assign({}, defaultOptions$3, base, custom, { udpServer: Object.assign({}, defaultOptions$3.udpServer, base.udpServer, custom.udpServer), udpClient: Object.assign({}, defaultOptions$3.udpClient, base.udpClient, custom.udpClient), @@ -1153,8 +1090,7 @@ var STATUS$3 = { IS_OPEN: 1, IS_CLOSING: 2, IS_CLOSED: 3 -}; -var defaultOptions$4 = { +};var defaultOptions$4 = { host: 'localhost', port: 8080 }; @@ -1230,8 +1166,7 @@ var STATUS$4 = { IS_OPEN: 1, IS_CLOSING: 2, IS_CLOSED: 3 -}; -var defaultOptions$5 = { +};var defaultOptions$5 = { host: 'localhost', port: 8080 }; @@ -1270,14 +1205,10 @@ var WebsocketServerPlugin = function () { this.socket = new WebsocketServer({ host: host, port: port }); this.socket.binaryType = 'arraybuffer'; this.socketStatus = STATUS$4.IS_CONNECTING; - this.socket.on('open', function () { + this.socket.on('listening', function () { _this.socketStatus = STATUS$4.IS_OPEN; _this.notify('open'); }); - this.socket.on('close', function () { - _this.socketStatus = STATUS$4.IS_CLOSED; - _this.notify('close'); - }); this.socket.on('error', function (error) { _this.notify('error', error); }); @@ -1290,8 +1221,12 @@ var WebsocketServerPlugin = function () { }, { key: 'close', value: function close() { + var _this2 = this; this.socketStatus = STATUS$4.IS_CLOSING; - this.socket.close(); + this.socket.close(function () { + _this2.socketStatus = STATUS$4.IS_CLOSED; + _this2.notify('close'); + }); } }, { key: 'send', @@ -1307,8 +1242,7 @@ var WebsocketServerPlugin = function () { var defaultOptions = { plugin: new WebsocketClientPlugin(), discardLateMessages: false -}; -var STATUS = { +};var STATUS = { IS_NOT_INITIALIZED: -1, IS_CONNECTING: 0, IS_OPEN: 1, diff --git a/dist/osc.js.map b/dist/osc.js.map index 8d961ec..856ad3f 100644 --- a/dist/osc.js.map +++ b/dist/osc.js.map @@ -1 +1 @@ -{"version":3,"file":null,"sources":["../src/common/utils.js","../src/common/helpers.js","../src/atomic.js","../src/atomic/int32.js","../src/atomic/float32.js","../src/atomic/string.js","../src/atomic/blob.js","../src/message.js","../src/atomic/timetag.js","../src/bundle.js","../src/packet.js","../src/events.js","../src/plugin/dgram.js","../src/plugin/bridge.js","../src/plugin/wsclient.js","../src/plugin/wsserver.js","../src/osc.js"],"sourcesContent":["/**\n * Check if given object is an integer number\n * @param {*} n\n * @return {boolean}\n */\nexport function isInt(n) {\n return Number(n) === n && n % 1 === 0\n}\n\n/**\n * Check if given object is a float number\n * @param {*} n\n * @return {boolean}\n */\nexport function isFloat(n) {\n return Number(n) === n && n % 1 !== 0\n}\n\n/**\n * Check if given object is a string\n * @param {*} n\n * @return {boolean}\n */\nexport function isString(n) {\n return typeof n === 'string'\n}\n\n/**\n * Check if given object is an array\n * @param {*} n\n * @return {boolean}\n */\nexport function isArray(n) {\n return Object.prototype.toString.call(n) === '[object Array]'\n}\n\n/**\n * Check if given object is an object\n * @param {*} n\n * @return {boolean}\n */\nexport function isObject(n) {\n return Object.prototype.toString.call(n) === '[object Object]'\n}\n\n/**\n * Check if given object is a function\n * @param {*} n\n * @return {boolean}\n */\nexport function isFunction(n) {\n return typeof n === 'function'\n}\n\n/**\n * Check if given object is a Uint8Array\n * @param {*} n\n * @return {boolean}\n */\nexport function isBlob(n) {\n return n instanceof Uint8Array\n}\n\n/**\n * Check if given object is a Date\n * @param {*} n\n * @return {boolean}\n */\nexport function isDate(n) {\n return n instanceof Date\n}\n\n/**\n * Check if given object is undefined\n * @param {*} n\n * @return {boolean}\n */\nexport function isUndefined(n) {\n return typeof n === 'undefined'\n}\n\n/**\n * Return the next multiple of four\n * @param {number} n\n */\nexport function pad(n) {\n return (n + 3) & ~0x03\n}\n\n/**\n * Wrap binary data in DataView\n * @param {*} obj\n * @return {DataView}\n */\nexport function dataView(obj) {\n if (obj.buffer) {\n return new DataView(obj.buffer)\n } else if (obj instanceof ArrayBuffer) {\n return new DataView(obj)\n }\n\n return new DataView(new Uint8Array(obj))\n}\n","import { isArray, isInt, isFloat, isString, isBlob } from './utils'\n\n/**\n * Checks type of given object and returns the regarding OSC\n * Type tag character\n * @param {*} item Any object\n * @return {string} OSC Type tag character\n */\nexport function typeTag(item) {\n if (isInt(item)) {\n return 'i'\n } else if (isFloat(item)) {\n return 'f'\n } else if (isString(item)) {\n return 's'\n } else if (isBlob(item)) {\n return 'b'\n }\n\n throw new Error('OSC typeTag() found unknown value type')\n}\n\n/**\n * Sanitizes an OSC-ready Address Pattern\n * @param {array|string} obj Address as string or array of strings\n * @return {string} Corrected address string\n *\n * @example\n * // all calls return '/test/path' string:\n * prepareAddress('test/path')\n * prepareAddress('/test/path/')\n * prepareAddress([test, path])\n */\nexport function prepareAddress(obj) {\n let address = ''\n\n if (isArray(obj)) {\n return `/${obj.join('/')}`\n } else if (isString(obj)) {\n address = obj\n\n // remove slash at ending of address\n if (address.length > 1 && address[address.length - 1] === '/') {\n address = address.slice(0, address.length - 1)\n }\n\n // add slash at beginning of address\n if (address.length > 1 && address[0] !== '/') {\n address = `/${address}`\n }\n\n return address\n }\n\n throw new Error('OSC prepareAddress() needs addresses of type array or string')\n}\n\n/**\n * Make an OSC address pattern javascript-regex-ready\n * @param {string} str OSC address pattern\n * @return {string} Javascript RegEx string\n */\nexport function prepareRegExPattern(str) {\n let pattern\n\n if (!(isString(str))) {\n throw new Error('OSC prepareRegExPattern() needs strings')\n }\n\n pattern = str.replace(/\\./g, '\\\\.')\n pattern = pattern.replace(/\\(/g, '\\\\(')\n pattern = pattern.replace(/\\)/g, '\\\\)')\n\n pattern = pattern.replace(/\\{/g, '(')\n pattern = pattern.replace(/\\}/g, ')')\n pattern = pattern.replace(/,/g, '|')\n\n pattern = pattern.replace(/\\[!/g, '[^')\n\n pattern = pattern.replace(/\\?/g, '.')\n pattern = pattern.replace(/\\*/g, '.*')\n\n return pattern\n}\n\n/**\n * Holds a list of items and helps to merge them\n * into a single array of packed binary data\n */\nexport default class EncodeHelper {\n /**\n * Create a new EncodeHelper instance\n */\n constructor() {\n /** @type {array} data */\n this.data = []\n /** @type {number} byteLength */\n this.byteLength = 0\n }\n\n /**\n * Packs an item and adds it to the list\n * @param {*} item Any object\n * @return {EncodeHelper}\n */\n add(item) {\n const buffer = item.pack()\n this.byteLength += buffer.byteLength\n this.data.push(buffer)\n\n return this\n }\n\n /**\n * Merge all added items into one Uint8Array\n * @return {Uint8Array} Merged binary data array of all items\n */\n merge() {\n const result = new Uint8Array(this.byteLength)\n let offset = 0\n\n this.data.forEach((data) => {\n result.set(data, offset)\n offset += data.byteLength\n })\n\n return result\n }\n}\n","import { isUndefined } from './common/utils'\n\n/**\n * Base class for OSC Atomic Data Types\n */\nexport default class Atomic {\n /**\n * Create an Atomic instance\n * @param {*} [value] Initial value of any type\n */\n constructor(value) {\n /** @type {*} value */\n this.value = value\n /** @type {number} offset */\n this.offset = 0\n }\n\n /**\n * Interpret the given value of this entity as packed binary data\n * @param {string} method The DataView method to write to the ArrayBuffer\n * @param {number} byteLength Size of array in bytes\n * @return {Uint8Array} Packed binary data\n */\n pack(method, byteLength) {\n if (!(method && byteLength)) {\n throw new Error('OSC Atomic cant\\'t be packed without given method or byteLength')\n }\n\n const data = new Uint8Array(byteLength)\n const dataView = new DataView(data.buffer)\n\n if (isUndefined(this.value)) {\n throw new Error('OSC Atomic cant\\'t be encoded with empty value')\n }\n\n // use DataView to write to ArrayBuffer\n dataView[method](this.offset, this.value, false)\n\n // always return binary Uint8Array after packing\n return data\n }\n\n /**\n * Unpack binary data from DataView according to the given format\n * @param {DataView} dataView The DataView holding the binary representation of the value\n * @param {string} method The DataView method to read the format from the ArrayBuffer\n * @param {number} byteLength Size of array in bytes\n * @param {number} [initialOffset=0] Offset of DataView before unpacking\n * @return {number} Offset after unpacking\n */\n unpack(dataView, method, byteLength, initialOffset = 0) {\n if (!(dataView && method && byteLength)) {\n throw new Error('OSC Atomic cant\\'t be unpacked without given dataView, method or byteLength')\n }\n\n if (!(dataView instanceof DataView)) {\n throw new Error('OSC Atomic expects an instance of type DataView')\n }\n\n // use DataView to read from ArrayBuffer and add offset\n this.value = dataView[method](initialOffset, false)\n this.offset = initialOffset + byteLength\n\n // always return offset number after unpacking\n return this.offset\n }\n}\n","import { isInt } from '../common/utils'\n\nimport Atomic from '../atomic'\n\n/**\n * 32-bit big-endian two's complement integer OSC Atomic Data Type\n */\nexport default class AtomicInt32 extends Atomic {\n /**\n * Create an AtomicInt32 instance\n * @param {number} [value] Initial integer value\n */\n constructor(value) {\n if (value && !isInt(value)) {\n throw new Error('OSC AtomicInt32 constructor expects value of type number')\n }\n\n super(value)\n }\n\n /**\n * Interpret the given number as packed binary data\n * @return {Uint8Array} Packed binary data\n */\n pack() {\n return super.pack('setInt32', 4)\n }\n\n /**\n * Unpack binary data from DataView and read a Int32 number\n * @param {DataView} dataView The DataView holding the binary representation of the value\n * @param {number} [initialOffset=0] Offset of DataView before unpacking\n * @return {number} Offset after unpacking\n */\n unpack(dataView, initialOffset = 0) {\n return super.unpack(dataView, 'getInt32', 4, initialOffset)\n }\n}\n","import { isFloat } from '../common/utils'\n\nimport Atomic from '../atomic'\n\n/**\n * 32-bit big-endian IEEE 754 floating point number OSC Atomic Data Type\n */\nexport default class AtomicFloat32 extends Atomic {\n /**\n * Create an AtomicFloat32 instance\n * @param {number} [value] Float number\n */\n constructor(value) {\n if (value && !isFloat(value)) {\n throw new Error('OSC AtomicFloat32 constructor expects value of type float')\n }\n\n super(value)\n }\n\n /**\n * Interpret the given number as packed binary data\n * @return {Uint8Array} Packed binary data\n */\n pack() {\n return super.pack('setFloat32', 4)\n }\n\n /**\n * Unpack binary data from DataView and read a Float32 number\n * @param {DataView} dataView The DataView holding the binary representation of the value\n * @param {number} [initialOffset=0] Offset of DataView before unpacking\n * @return {number} Offset after unpacking\n */\n unpack(dataView, initialOffset = 0) {\n return super.unpack(dataView, 'getFloat32', 4, initialOffset)\n }\n}\n","import { pad, isString, isUndefined } from '../common/utils'\n\nimport Atomic from '../atomic'\n\n/**\n * A sequence of non-null ASCII characters OSC Atomic Data Type\n */\nexport default class AtomicString extends Atomic {\n /**\n * Create an AtomicString instance\n * @param {string} [value] Initial string value\n */\n constructor(value) {\n if (value && !isString(value)) {\n throw new Error('OSC AtomicString constructor expects value of type string')\n }\n\n super(value)\n }\n\n /**\n * Interpret the given string as packed binary data\n * @return {Uint8Array} Packed binary data\n */\n pack() {\n if (isUndefined(this.value)) {\n throw new Error('OSC AtomicString can not be encoded with empty value')\n }\n\n // add 0-3 null characters for total number of bits a multiple of 32\n const terminated = `${this.value}\\u0000`\n const byteLength = pad(terminated.length)\n\n const buffer = new Uint8Array(byteLength)\n\n for (let i = 0; i < terminated.length; i += 1) {\n buffer[i] = terminated.charCodeAt(i)\n }\n\n return buffer\n }\n\n /**\n * Unpack binary data from DataView and read a string\n * @param {DataView} dataView The DataView holding the binary representation of the string\n * @param {number} [initialOffset=0] Offset of DataView before unpacking\n * @return {number} Offset after unpacking\n */\n unpack(dataView, initialOffset = 0) {\n if (!(dataView instanceof DataView)) {\n throw new Error('OSC AtomicString expects an instance of type DataView')\n }\n\n let offset = initialOffset\n let charcode\n const data = []\n\n for (; offset < dataView.byteLength; offset += 1) {\n charcode = dataView.getUint8(offset)\n\n // check for terminating null character\n if (charcode !== 0) {\n data.push(charcode)\n } else {\n offset += 1\n break\n }\n }\n\n if (offset === dataView.length) {\n throw new Error('OSC AtomicString found a malformed OSC string')\n }\n\n /** @type {number} offset */\n this.offset = pad(offset)\n /** @type {string} value */\n this.value = String.fromCharCode.apply(null, data)\n\n return this.offset\n }\n}\n","import { pad, isBlob, isUndefined } from '../common/utils'\n\nimport Atomic from '../atomic'\n\n/**\n * 8-bit bytes of arbitrary binary data OSC Atomic Data Type\n */\nexport default class AtomicBlob extends Atomic {\n /**\n * Create an AtomicBlob instance\n * @param {Uint8Array} [value] Binary data\n */\n constructor(value) {\n if (value && !isBlob(value)) {\n throw new Error('OSC AtomicBlob constructor expects value of type Uint8Array')\n }\n\n super(value)\n }\n\n /**\n * Interpret the given blob as packed binary data\n * @return {Uint8Array} Packed binary data\n */\n pack() {\n if (isUndefined(this.value)) {\n throw new Error('OSC AtomicBlob can not be encoded with empty value')\n }\n\n const byteLength = pad(this.value.byteLength)\n const data = new Uint8Array(byteLength + 4)\n const dataView = new DataView(data.buffer)\n\n // an int32 size count\n dataView.setInt32(0, this.value.byteLength, false)\n // followed by 8-bit bytes of arbitrary binary data\n data.set(this.value, 4)\n\n return data\n }\n\n /**\n * Unpack binary data from DataView and read a blob\n * @param {DataView} dataView The DataView holding the binary representation of the blob\n * @param {number} [initialOffset=0] Offset of DataView before unpacking\n * @return {number} Offset after unpacking\n */\n unpack(dataView, initialOffset = 0) {\n if (!(dataView instanceof DataView)) {\n throw new Error('OSC AtomicBlob expects an instance of type DataView')\n }\n\n const byteLength = dataView.getInt32(initialOffset, false)\n\n /** @type {Uint8Array} value */\n this.value = new Uint8Array(dataView.buffer, initialOffset + 4, byteLength)\n /** @type {number} offset */\n this.offset = pad(initialOffset + 4 + byteLength)\n\n return this.offset\n }\n}\n","import { isString, isArray, isInt, isFloat, isBlob } from './common/utils'\nimport Helper, { typeTag, prepareAddress } from './common/helpers'\n\nimport AtomicInt32 from './atomic/int32'\nimport AtomicFloat32 from './atomic/float32'\nimport AtomicString from './atomic/string'\nimport AtomicBlob from './atomic/blob'\n\n/**\n * An OSC message consists of an OSC Address Pattern followed\n * by an OSC Type Tag String followed by zero or more OSC Arguments\n */\nexport default class Message {\n /**\n * Create a Message instance\n * @param {array|string} args Address\n * @param {...*} args OSC Atomic Data Types\n *\n * @example\n * const message = new Message(['test', 'path'], 50, 100.52, 'test')\n *\n * @example\n * const message = new Message('/test/path', 51.2)\n */\n constructor(...args) {\n /**\n * @type {number} offset\n * @private\n */\n this.offset = 0\n /** @type {string} address */\n this.address = ''\n /** @type {string} types */\n this.types = ''\n /** @type {array} args */\n this.args = []\n\n if (args.length > 0) {\n if (!(isString(args[0]) || isArray(args[0]))) {\n throw new Error('OSC Message constructor first argument (address) must be a string or array')\n }\n\n this.address = prepareAddress(args.shift())\n this.types = args.map(item => typeTag(item)).join('')\n this.args = args\n }\n }\n\n /**\n * Add an OSC Atomic Data Type to the list of elements\n * @param {*} item\n */\n add(item) {\n if (!item) {\n throw new Error('OSC Message needs a valid OSC Atomic Data Type')\n }\n\n this.args.push(item)\n this.types += typeTag(item)\n }\n\n /**\n * Interpret the Message as packed binary data\n * @return {Uint8Array} Packed binary data\n */\n pack() {\n if (this.address.length === 0 || this.address[0] !== '/') {\n throw new Error('OSC Message has an invalid address')\n }\n\n const encoder = new Helper()\n\n // OSC Address Pattern and Type string\n encoder.add(new AtomicString(this.address))\n encoder.add(new AtomicString(`,${this.types}`))\n\n // followed by zero or more OSC Arguments\n if (this.args.length > 0) {\n let argument\n\n this.args.forEach((value) => {\n if (isInt(value)) {\n argument = new AtomicInt32(value)\n } else if (isFloat(value)) {\n argument = new AtomicFloat32(value)\n } else if (isString(value)) {\n argument = new AtomicString(value)\n } else if (isBlob(value)) {\n argument = new AtomicBlob(value)\n } else {\n throw new Error('OSC Message found unknown argument type')\n }\n\n encoder.add(argument)\n })\n }\n\n return encoder.merge()\n }\n\n /**\n * Unpack binary data to read a Message\n * @param {DataView} dataView The DataView holding the binary representation of a Message\n * @param {number} [initialOffset=0] Offset of DataView before unpacking\n * @return {number} Offset after unpacking\n */\n unpack(dataView, initialOffset = 0) {\n if (!(dataView instanceof DataView)) {\n throw new Error('OSC Message expects an instance of type DataView.')\n }\n\n // read address pattern\n const address = new AtomicString()\n address.unpack(dataView, initialOffset)\n\n // read type string\n const types = new AtomicString()\n types.unpack(dataView, address.offset)\n\n if (address.value.length === 0 || address.value[0] !== '/') {\n throw new Error('OSC Message found malformed or missing address string')\n }\n\n if (types.value.length === 0 && types.value[0] !== ',') {\n throw new Error('OSC Message found malformed or missing type string')\n }\n\n let offset = types.offset\n let next\n let type\n\n const args = []\n\n // read message arguments (OSC Atomic Data Types)\n for (let i = 1; i < types.value.length; i += 1) {\n type = types.value[i]\n\n if (type === 'i') {\n next = new AtomicInt32()\n } else if (type === 'f') {\n next = new AtomicFloat32()\n } else if (type === 's') {\n next = new AtomicString()\n } else if (type === 'b') {\n next = new AtomicBlob()\n } else {\n throw new Error('OSC Message found non-standard argument type')\n }\n\n offset = next.unpack(dataView, offset)\n args.push(next.value)\n }\n\n this.offset = offset\n this.address = address.value\n this.types = types.value\n this.args = args\n\n return this.offset\n }\n}\n","import { isInt, isDate, isUndefined } from '../common/utils'\n\nimport Atomic from '../atomic'\n\n/** 70 years in seconds */\nexport const SECONDS_70_YEARS = 2208988800\n/** 2^32 */\nexport const TWO_POWER_32 = 4294967296\n\n/**\n * Timetag helper class for representing NTP timestamps\n * and conversion between them and javascript representation\n */\nexport class Timetag {\n /**\n * Create a Timetag instance\n * @param {number} [seconds=0] Initial NTP *seconds* value\n * @param {number} [fractions=0] Initial NTP *fractions* value\n */\n constructor(seconds = 0, fractions = 0) {\n if (!(isInt(seconds) && isInt(fractions))) {\n throw new Error('OSC Timetag constructor expects values of type integer number')\n }\n\n /** @type {number} seconds */\n this.seconds = seconds\n /** @type {number} fractions */\n this.fractions = fractions\n }\n\n /**\n * Converts from NTP to JS representation and back\n * @param {number} [milliseconds] Converts from JS milliseconds to NTP.\n * Leave empty for converting from NTP to JavaScript representation\n * @return {number} Javascript timestamp\n */\n timestamp(milliseconds) {\n let seconds\n\n if (typeof milliseconds === 'number') {\n seconds = milliseconds / 1000\n const rounded = Math.floor(seconds)\n\n this.seconds = rounded + SECONDS_70_YEARS\n this.fractions = Math.round(TWO_POWER_32 * (seconds - rounded))\n\n return milliseconds\n }\n\n seconds = this.seconds - SECONDS_70_YEARS\n return (seconds + (this.fractions / TWO_POWER_32)) * 1000\n }\n}\n\n/**\n * 64-bit big-endian fixed-point time tag, semantics\n * defined below OSC Atomic Data Type\n */\nexport default class AtomicTimetag extends Atomic {\n /**\n * Create a AtomicTimetag instance\n * @param {number|Timetag|Date} [value] Initial date, leave empty if\n * you want it to be the current date\n */\n constructor(value = Date.now()) {\n let timetag = new Timetag()\n\n if (value instanceof Timetag) {\n timetag = value\n } else if (isInt(value)) {\n timetag.timestamp(value)\n } else if (isDate(value)) {\n timetag.timestamp(value.getTime())\n }\n\n super(timetag)\n }\n\n /**\n * Interpret the given timetag as packed binary data\n * @return {Uint8Array} Packed binary data\n */\n pack() {\n if (isUndefined(this.value)) {\n throw new Error('OSC AtomicTimetag can not be encoded with empty value')\n }\n\n const { seconds, fractions } = this.value\n const data = new Uint8Array(8)\n const dataView = new DataView(data.buffer)\n\n dataView.setInt32(0, seconds, false)\n dataView.setInt32(4, fractions, false)\n\n return data\n }\n\n /**\n * Unpack binary data from DataView and read a timetag\n * @param {DataView} dataView The DataView holding the binary representation of the timetag\n * @param {number} [initialOffset=0] Offset of DataView before unpacking\n * @return {number} Offset after unpacking\n */\n unpack(dataView, initialOffset = 0) {\n if (!(dataView instanceof DataView)) {\n throw new Error('OSC AtomicTimetag expects an instance of type DataView')\n }\n\n const seconds = dataView.getUint32(initialOffset, false)\n const fractions = dataView.getUint32(initialOffset + 4, false)\n\n /** @type {Timetag} value */\n this.value = new Timetag(seconds, fractions)\n /** @type {number} offset */\n this.offset = initialOffset + 8\n\n return this.offset\n }\n}\n","import { isArray, isInt } from './common/utils'\nimport EncodeHelper from './common/helpers'\n\nimport Packet from './packet'\nimport Message from './message'\nimport AtomicString from './atomic/string'\nimport AtomicInt32 from './atomic/int32'\nimport AtomicTimetag from './atomic/timetag'\n\n/** OSC Bundle string */\nexport const BUNDLE_TAG = '#bundle'\n\n/**\n * An OSC Bundle consist of a Timetag and one or many Bundle Elements.\n * The elements are either OSC Messages or more OSC Bundles\n */\nexport default class Bundle {\n /**\n * Create a Bundle instance\n * @param {...*} [args] Timetag and elements. See examples for options\n *\n * @example\n * const bundle = new Bundle(new Date() + 500)\n *\n * @example\n * const message = new Message('/test/path', 51.2)\n * const anotherBundle = new Bundle([message], Date.now() + 1500)\n *\n * @example\n * const message = new Message('/test/path', 51.2)\n * const anotherMessage = new Message('/test/message', 'test', 12)\n * const anotherBundle = new Bundle(message, anotherMessage)\n */\n constructor(...args) {\n /**\n * @type {number} offset\n * @private\n */\n this.offset = 0\n /** @type {AtomicTimetag} timetag */\n this.timetag = new AtomicTimetag()\n /** @type {array} bundleElements */\n this.bundleElements = []\n\n if (args.length > 0) {\n // first argument is an Date or js timestamp (number)\n if (args[0] instanceof Date || isInt(args[0])) {\n this.timetag = new AtomicTimetag(args[0])\n } else if (isArray(args[0])) {\n // first argument is an Array of Bundle elements\n args[0].forEach((item) => {\n this.add(item)\n })\n\n // second argument is an Date or js timestamp (number)\n if (args.length > 1 && (args[1] instanceof Date || isInt(args[0]))) {\n this.timetag = new AtomicTimetag(args[1])\n }\n } else {\n // take all arguments as Bundle elements\n args.forEach((item) => {\n this.add(item)\n })\n }\n }\n }\n\n /**\n * Take a JavaScript timestamp to set the Bundle's timetag\n * @param {number} ms JS timestamp in milliseconds\n *\n * @example\n * const bundle = new Bundle()\n * bundle.timestamp(Date.now() + 5000) // in 5 seconds\n */\n timestamp(ms) {\n if (!isInt(ms)) {\n throw new Error('OSC Bundle needs an integer for setting the timestamp')\n }\n\n this.timetag = new AtomicTimetag(ms)\n }\n\n /**\n * Add a Message or Bundle to the list of elements\n * @param {Bundle|Message} item\n */\n add(item) {\n if (!(item instanceof Message || item instanceof Bundle)) {\n throw new Error('OSC Bundle contains only Messages and Bundles')\n }\n\n this.bundleElements.push(item)\n }\n\n /**\n * Interpret the Bundle as packed binary data\n * @return {Uint8Array} Packed binary data\n */\n pack() {\n const encoder = new EncodeHelper()\n\n // an OSC Bundle consists of the OSC-string \"#bundle\"\n encoder.add(new AtomicString(BUNDLE_TAG))\n\n // followed by an OSC Time Tag\n if (!this.timetag) {\n this.timetag = new AtomicTimetag()\n }\n\n encoder.add(this.timetag)\n\n // followed by zero or more OSC Bundle Elements\n this.bundleElements.forEach((item) => {\n encoder.add(new AtomicInt32(item.pack().byteLength))\n encoder.add(item)\n })\n\n return encoder.merge()\n }\n\n /**\n * Unpack binary data to read a Bundle\n * @param {DataView} dataView The DataView holding the binary representation of a Bundle\n * @param {number} [initialOffset=0] Offset of DataView before unpacking\n * @return {number} Offset after unpacking\n */\n unpack(dataView, initialOffset = 0) {\n if (!(dataView instanceof DataView)) {\n throw new Error('OSC Bundle expects an instance of type DataView')\n }\n\n // read the beginning bundle string\n const head = new AtomicString()\n head.unpack(dataView, initialOffset)\n\n if (head.value !== BUNDLE_TAG) {\n throw new Error('OSC Bundle does not contain a valid #bundle head')\n }\n\n // read the timetag\n const timetag = new AtomicTimetag()\n let offset = timetag.unpack(dataView, head.offset)\n\n // read the bundle elements\n this.bundleElements = []\n\n while (offset < dataView.byteLength) {\n const packet = new Packet()\n const size = new AtomicInt32()\n\n offset = size.unpack(dataView, offset)\n offset = packet.unpack(dataView, offset, this.timetag)\n\n this.bundleElements.push(packet.value)\n }\n\n this.offset = offset\n this.timetag = timetag\n\n return this.offset\n }\n}\n","import Bundle, { BUNDLE_TAG } from './bundle'\nimport Message from './message'\nimport AtomicString from './atomic/string'\n\n/**\n * The unit of transmission of OSC is an OSC Packet. The contents\n * of an OSC packet must be either an OSC Message or an OSC Bundle\n */\nexport default class Packet {\n /**\n * Create a Packet instance holding a Message or Bundle\n * @param {Message|Bundle} [value] Initial Packet value\n */\n constructor(value) {\n if (value && !(value instanceof Message || value instanceof Bundle)) {\n throw new Error('OSC Packet value has to be Message or Bundle')\n }\n\n /** @type {Message|Bundle} value */\n this.value = value\n /**\n * @type {number} offset\n * @private\n */\n this.offset = 0\n }\n\n /**\n * Packs the Packet value. This implementation is more like\n * a wrapper due to OSC specifications, you could also skip the\n * Packet and directly work with the Message or Bundle instance\n * @return {Uint8Array} Packed binary data\n *\n * @example\n * const message = new Message('/test/path', 21.5, 'test')\n * const packet = new Packet(message)\n * const packetBinary = packet.pack() // then send it via udp etc.\n *\n * // or skip the Packet for convenience\n * const messageBinary = message.pack()\n */\n pack() {\n if (!this.value) {\n throw new Error('OSC Packet can not be encoded with empty body')\n }\n\n return this.value.pack()\n }\n\n /**\n * Unpack binary data from DataView to read Messages or Bundles\n * @param {DataView} dataView The DataView holding a binary representation of a Packet\n * @param {number} [initialOffset=0] Offset of DataView before unpacking\n * @return {number} Offset after unpacking\n */\n unpack(dataView, initialOffset = 0) {\n if (!(dataView instanceof DataView)) {\n throw new Error('OSC Packet expects an instance of type DataView')\n }\n\n if (dataView.byteLength % 4 !== 0) {\n throw new Error('OSC Packet byteLength has to be a multiple of four')\n }\n\n const head = new AtomicString()\n head.unpack(dataView, initialOffset)\n\n let item\n\n // check if Packet is a Bundle or a Message\n if (head.value === BUNDLE_TAG) {\n item = new Bundle()\n } else {\n item = new Message()\n }\n\n item.unpack(dataView, initialOffset)\n\n this.offset = item.offset\n this.value = item\n\n return this.offset\n }\n}\n","import { isArray, isString, isInt, isFunction, dataView } from './common/utils'\nimport { prepareAddress, prepareRegExPattern } from './common/helpers'\n\nimport Packet from './packet'\nimport Bundle from './bundle'\nimport Message from './message'\n\n/**\n * Default options\n * @private\n */\nconst defaultOptions = {\n discardLateMessages: false,\n}\n\n/**\n * EventHandler to notify listeners on matching OSC messages and\n * status changes of plugins\n */\nexport default class EventHandler {\n /**\n * Create an EventHandler instance\n * @param {object} options Custom options\n */\n constructor(options) {\n /**\n * @type {object} options\n * @private\n */\n this.options = Object.assign({}, defaultOptions, options)\n /**\n * @type {array} addressHandlers\n * @private\n */\n this.addressHandlers = []\n /**\n * @type {object} eventHandlers\n * @private\n */\n this.eventHandlers = {\n open: [],\n error: [],\n close: [],\n }\n /**\n * @type {number} uuid\n * @private\n */\n this.uuid = 0\n }\n\n /**\n * Internally used method to dispatch OSC Packets. Extracts\n * given Timetags and dispatches them accordingly\n * @param {Packet} packet\n * @return {boolean} Success state\n * @private\n */\n dispatch(packet) {\n if (!(packet instanceof Packet)) {\n throw new Error('OSC EventHander dispatch() accepts only arguments of type Packet')\n }\n\n if (!packet.value) {\n throw new Error('OSC EventHander dispatch() can\\'t read empty Packets')\n }\n\n if (packet.value instanceof Bundle) {\n const bundle = packet.value\n\n return bundle.bundleElements.forEach((bundleItem) => {\n if (packet.value instanceof Bundle) {\n if (bundle.timetag.value.timestamp() < bundleItem.timetag.value.timestamp()) {\n throw new Error('OSC Bundle timestamp is older than the timestamp of enclosed Bundles')\n }\n return this.dispatch(bundleItem)\n } else if (bundleItem instanceof Message) {\n const message = bundleItem\n return this.notify(message.address, message, bundle.timetag.value.timestamp())\n }\n\n throw new Error('OSC EventHander dispatch() can\\'t dispatch unknown Packet value')\n })\n } else if (packet.value instanceof Message) {\n const message = packet.value\n return this.notify(message.address, message)\n }\n\n throw new Error('OSC EventHander dispatch() can\\'t dispatch unknown Packet value')\n }\n\n /**\n * Internally used method to invoke listener callbacks. Uses regular\n * expression pattern matching for OSC addresses\n * @param {string} name OSC address or event name\n * @param {*} [data] The data of the event\n * @return {boolean} Success state\n * @private\n */\n call(name, data) {\n let success = false\n\n // call event handlers\n if (isString(name) && name in this.eventHandlers) {\n this.eventHandlers[name].forEach((handler) => {\n handler.callback(data)\n success = true\n })\n\n return success\n }\n\n // call address handlers\n const handlerKeys = Object.keys(this.addressHandlers)\n const handlers = this.addressHandlers\n\n handlerKeys.forEach((key) => {\n const regex = new RegExp(prepareRegExPattern(prepareAddress(name)), 'g')\n const test = regex.test(key)\n\n // found a matching address in our callback handlers\n if (test && key.length === regex.lastIndex) {\n handlers[key].forEach((handler) => {\n handler.callback(data)\n success = true\n })\n }\n })\n\n return success\n }\n\n /**\n * Notify the EventHandler of incoming OSC messages or status\n * changes (*open*, *close*, *error*). Handles OSC address patterns\n * and executes timed messages. Use binary arrays when\n * handling directly incoming network data. Packet's or Messages can\n * also be used\n * @param {...*} args\n * The OSC address pattern / event name as string}. For convenience and\n * Plugin API communication you can also use Message or Packet instances\n * or ArrayBuffer, Buffer instances (low-level access). The latter will\n * automatically be unpacked\n * When using a string you can also pass on data as a second argument\n * (any type). All regarding listeners will be notified with this data.\n * As a third argument you can define a javascript timestamp (number or\n * Date instance) for timed notification of the listeners.\n * @return {boolean} Success state of notification\n *\n * @example\n * const socket = dgram.createSocket('udp4')\n * socket.on('message', (message) => {\n * this.notify(message)\n * })\n *\n * @example\n * this.notify('error', error.message)\n *\n * @example\n * const message = new OSC.Message('/test/path', 55)\n * this.notify(message)\n *\n * @example\n * const message = new OSC.Message('/test/path', 55)\n * // override timestamp\n * this.notify(message.address, message, Date.now() + 5000)\n */\n notify(...args) {\n if (args.length === 0) {\n throw new Error('OSC EventHandler can not be called without any argument')\n }\n\n // check for incoming dispatchable OSC data\n if (args[0] instanceof Packet) {\n return this.dispatch(args[0])\n } else if (args[0] instanceof Bundle || args[0] instanceof Message) {\n return this.dispatch(new Packet(args[0]))\n } else if (!isString(args[0])) {\n const packet = new Packet()\n packet.unpack(dataView(args[0]))\n return this.dispatch(packet)\n }\n\n const name = args[0]\n\n // data argument\n let data = null\n\n if (args.length > 1) {\n data = args[1]\n }\n\n // timestamp argument\n let timestamp = null\n\n if (args.length > 2) {\n if (isInt(args[2])) {\n timestamp = args[2]\n } else if (args[2] instanceof Date) {\n timestamp = args[2].getTime()\n } else {\n throw new Error('OSC EventHandler timestamp has to be a number or Date')\n }\n }\n\n // notify now or later\n if (timestamp) {\n const now = Date.now()\n\n // is message outdated?\n if (now > timestamp) {\n if (!this.options.discardLateMessages) {\n return this.call(name, data)\n }\n }\n\n // notify later\n const that = this\n\n setTimeout(() => {\n that.call(name, data)\n }, timestamp - now)\n\n return true\n }\n\n return this.call(name, data)\n }\n\n /**\n * Subscribe to a new address or event you want to listen to\n * @param {string} name The OSC address or event name\n * @param {function} callback Callback function on notification\n * @return {number} Subscription identifier (needed to unsubscribe)\n */\n on(name, callback) {\n if (!(isString(name) || isArray(name))) {\n throw new Error('OSC EventHandler accepts only strings or arrays for address patterns')\n }\n\n if (!isFunction(callback)) {\n throw new Error('OSC EventHandler callback has to be a function')\n }\n\n // get next id\n this.uuid += 1\n\n // prepare handler\n const handler = {\n id: this.uuid,\n callback,\n }\n\n // register event listener\n if (isString(name) && name in this.eventHandlers) {\n this.eventHandlers[name].push(handler)\n return this.uuid\n }\n\n // register address listener\n const address = prepareAddress(name)\n const regex = new RegExp(/[#*\\s[\\],/{}|?]/g)\n\n if (regex.test(address.split('/').join(''))) {\n throw new Error('OSC EventHandler address string contains invalid characters')\n }\n\n if (!(address in this.addressHandlers)) {\n this.addressHandlers[address] = []\n }\n\n this.addressHandlers[address].push(handler)\n\n return this.uuid\n }\n\n /**\n * Unsubscribe listener from event notification or address handler\n * @param {string} name The OSC address or event name\n * @param {number} subscriptionId Subscription id to identify the handler\n * @return {boolean} Success state\n */\n off(name, subscriptionId) {\n if (!(isString(name) || isArray(name))) {\n throw new Error('OSC EventHandler accepts only strings or arrays for address patterns')\n }\n\n if (!isInt(subscriptionId)) {\n throw new Error('OSC EventHandler subscription id has to be a number')\n }\n\n let key\n let haystack\n\n // event or address listener\n if (isString(name) && name in this.eventHandlers) {\n key = name\n haystack = this.eventHandlers\n } else {\n key = prepareAddress(name)\n haystack = this.addressHandlers\n }\n\n // remove the entry\n if (key in haystack) {\n return haystack[key].some((item, index) => {\n if (item.id === subscriptionId) {\n haystack[key].splice(index, 1)\n return true\n }\n\n return false\n })\n }\n\n return false\n }\n}\n","const dgram = typeof __dirname !== 'undefined' ? require('dgram') : undefined\n\n/**\n * Status flags\n * @private\n */\nconst STATUS = {\n IS_NOT_INITIALIZED: -1,\n IS_CONNECTING: 0,\n IS_OPEN: 1,\n IS_CLOSING: 2,\n IS_CLOSED: 3,\n}\n\n/**\n * Default options for open method\n * @private\n */\nconst defaultOpenOptions = {\n host: 'localhost',\n port: 41234,\n exclusive: false,\n}\n\n/**\n * Default options for send method\n * @private\n */\nconst defaultSendOptions = {\n host: 'localhost',\n port: 41235,\n}\n\n/**\n * Default options\n * @private\n */\nconst defaultOptions = {\n type: 'udp4',\n open: defaultOpenOptions,\n send: defaultSendOptions,\n}\n\n/**\n * OSC plugin for simple OSC messaging via udp client\n * and udp server\n */\nexport default class DatagramPlugin {\n /**\n * Create an OSC Plugin instance with given options. Defaults to\n * localhost:41234 for server and localhost:41235 for client messaging\n * @param {object} [options] Custom options\n * @param {string} [options.type='udp4'] 'udp4' or 'udp6'\n * @param {string} [options.open.host='localhost'] Hostname of udp server to bind to\n * @param {number} [options.open.port=41234] Port of udp server to bind to\n * @param {boolean} [options.open.exclusive=false] Exclusive flag\n * @param {string} [options.send.host='localhost'] Hostname of udp client for messaging\n * @param {number} [options.send.port=41235] Port of udp client for messaging\n *\n * @example\n * const plugin = new OSC.DatagramPlugin({ send: { port: 9912 } })\n * const osc = new OSC({ plugin: plugin })\n */\n constructor(customOptions = {}) {\n if (!dgram) {\n throw new Error('DatagramPlugin can not be used in browser context')\n }\n\n /**\n * @type {object} options\n * @private\n */\n this.options = Object.assign({}, defaultOptions, customOptions)\n\n /**\n * @type {object} socket\n * @private\n */\n this.socket = dgram.createSocket(this.options.type)\n /**\n * @type {number} socketStatus\n * @private\n */\n this.socketStatus = STATUS.IS_NOT_INITIALIZED\n\n // register events\n this.socket.on('message', (message) => {\n this.notify(message)\n })\n\n this.socket.on('error', (error) => {\n this.notify('error', error)\n })\n\n /**\n * @type {function} notify\n * @private\n */\n this.notify = () => {}\n }\n\n /**\n * Internal method to hook into osc library's\n * EventHandler notify method\n * @param {function} fn Notify callback\n * @private\n */\n registerNotify(fn) {\n this.notify = fn\n }\n\n /**\n * Returns the current status of the connection\n * @return {number} Status ID\n */\n status() {\n return this.socketStatus\n }\n\n /**\n * Bind a udp socket to a hostname and port\n * @param {object} [customOptions] Custom options\n * @param {string} [customOptions.host='localhost'] Hostname of udp server to bind to\n * @param {number} [customOptions.port=41234] Port of udp server to bind to\n * @param {boolean} [customOptions.exclusive=false] Exclusive flag\n */\n open(customOptions = {}) {\n const options = Object.assign({}, this.options.openOptions, customOptions)\n const { port, exclusive } = options\n\n this.socketStatus = STATUS.IS_CONNECTING\n\n this.socket.bind({\n address: options.host,\n port,\n exclusive,\n }, () => {\n this.socketStatus = STATUS.IS_OPEN\n this.notify('open')\n })\n }\n\n /**\n * Close udp socket\n */\n close() {\n this.socketStatus = STATUS.IS_CLOSING\n\n this.socket.close(() => {\n this.socketStatus = STATUS.IS_CLOSED\n this.notify('close')\n })\n }\n\n /**\n * Send an OSC Packet, Bundle or Message. Use options here for\n * custom port and hostname, otherwise the global options will\n * be taken\n * @param {Uint8Array} binary Binary representation of OSC Packet\n * @param {object} [customOptions] Custom options for udp socket\n * @param {string} [customOptions.host] Hostname of udp client\n * @param {number} [customOptions.port] Port of udp client\n */\n send(binary, customOptions = {}) {\n const options = Object.assign({}, this.options.sendOptions, customOptions)\n const { port, host } = options\n\n this.socket.send(new Buffer(binary), 0, binary.byteLength, port, host)\n }\n}\n","const dgram = typeof __dirname !== 'undefined' ? require('dgram') : undefined\nconst WebSocket = typeof __dirname !== 'undefined' ? require('ws').Server : undefined\n\n/**\n * Status flags\n * @private\n */\nconst STATUS = {\n IS_NOT_INITIALIZED: -1,\n IS_CONNECTING: 0,\n IS_OPEN: 1,\n IS_CLOSING: 2,\n IS_CLOSED: 3,\n}\n\n/**\n * Default options\n * @private\n */\nconst defaultOptions = {\n udpServer: {\n host: 'localhost',\n port: 41234,\n exclusive: false,\n },\n udpClient: {\n host: 'localhost',\n port: 41235,\n },\n wsServer: {\n host: 'localhost',\n port: 8080,\n },\n receiver: 'ws',\n}\n\n/**\n * Helper method to merge nested objects\n * @private\n */\nfunction mergeOptions(base, custom) {\n return Object.assign({}, defaultOptions, base, custom, {\n udpServer: Object.assign({}, defaultOptions.udpServer, base.udpServer, custom.udpServer),\n udpClient: Object.assign({}, defaultOptions.udpClient, base.udpClient, custom.udpClient),\n wsServer: Object.assign({}, defaultOptions.wsServer, base.wsServer, custom.wsServer),\n })\n}\n\n/**\n * OSC plugin for setting up communication between a Websocket\n * client and a udp client with a bridge inbetween\n */\nexport default class BridgePlugin {\n /**\n * Create an OSC Bridge instance with given options. Defaults to\n * localhost:41234 for udp server, localhost:41235 for udp client and\n * localhost:8080 for Websocket server\n * @param {object} [options] Custom options\n * @param {string} [options.udpServer.host='localhost'] Hostname of udp server to bind to\n * @param {number} [options.udpServer.port=41234] Port of udp server to bind to\n * @param {boolean} [options.udpServer.exclusive=false] Exclusive flag\n * @param {string} [options.udpClient.host='localhost'] Hostname of udp client for messaging\n * @param {number} [options.udpClient.port=41235] Port of udp client for messaging\n * @param {string} [options.wsServer.host='localhost'] Hostname of Websocket server\n * @param {number} [options.wsServer.port=8080] Port of Websocket server\n * @param {string} [options.receiver='ws'] Where messages sent via 'send' method will be\n * delivered to, 'ws' for Websocket clients, 'udp' for udp client\n *\n * @example\n * const plugin = new OSC.BridgePlugin({ wsServer: { port: 9912 } })\n * const osc = new OSC({ plugin: plugin })\n */\n constructor(customOptions = {}) {\n if (!dgram || !WebSocket) {\n throw new Error('BridgePlugin can not be used in browser context')\n }\n\n /** @type {object} options\n * @private\n */\n this.options = mergeOptions({}, customOptions)\n\n /**\n * @type {object} websocket\n * @private\n */\n this.websocket = null\n\n /**\n * @type {object} socket\n * @private\n */\n this.socket = dgram.createSocket('udp4')\n /**\n * @type {number} socketStatus\n * @private\n */\n this.socketStatus = STATUS.IS_NOT_INITIALIZED\n\n // register udp events\n this.socket.on('message', (message) => {\n this.send(message, { receiver: 'ws' })\n this.notify(message.buffer)\n })\n\n this.socket.on('error', (error) => {\n this.notify('error', error)\n })\n\n /**\n * @type {function} notify\n * @private\n */\n this.notify = () => {}\n }\n\n /**\n * Internal method to hook into osc library's\n * EventHandler notify method\n * @param {function} fn Notify callback\n * @private\n */\n registerNotify(fn) {\n this.notify = fn\n }\n\n /**\n * Returns the current status of the connection\n * @return {number} Status ID\n */\n status() {\n return this.socketStatus\n }\n\n /**\n * Bind a udp socket to a hostname and port\n * @param {object} [customOptions] Custom options\n * @param {string} [customOptions.host='localhost'] Hostname of udp server to bind to\n * @param {number} [customOptions.port=41234] Port of udp server to bind to\n * @param {boolean} [customOptions.exclusive=false] Exclusive flag\n */\n open(customOptions = {}) {\n const options = mergeOptions(this.options, customOptions)\n\n this.socketStatus = STATUS.IS_CONNECTING\n\n // bind udp server\n this.socket.bind({\n address: options.udpServer.host,\n port: options.udpServer.port,\n exclusive: options.udpServer.exclusive,\n }, () => {\n // bind Websocket server\n this.websocket = new WebSocket({ host: options.wsServer.host, port: options.wsServer.port })\n this.websocket.binaryType = 'arraybuffer'\n\n // register Websocket events\n this.websocket.on('error', (error) => {\n this.notify('error', error)\n })\n\n this.websocket.on('connection', (client) => {\n client.on('message', (message) => {\n this.send(message, { receiver: 'udp' })\n this.notify(new Uint8Array(message))\n })\n })\n\n this.notify('open')\n })\n }\n\n /**\n * Close udp socket and Websocket server\n */\n close() {\n this.socketStatus = STATUS.IS_CLOSING\n\n // close udp socket\n this.socket.close(() => {\n this.socketStatus = STATUS.IS_CLOSED\n this.notify('close')\n\n // close Websocket\n this.websocket.close()\n })\n }\n\n /**\n * Send an OSC Packet, Bundle or Message. Use options here for\n * custom receiver, otherwise the global options will be taken\n * @param {Uint8Array} binary Binary representation of OSC Packet\n * @param {object} [customOptions] Custom options\n * @param {string} [customOptions.udpClient.host='localhost'] Hostname of udp client for messaging\n * @param {number} [customOptions.udpClient.port=41235] Port of udp client for messaging\n * @param {string} [customOptions.receiver='ws'] Messages will be delivered to Websocket ('ws')\n * clients or udp client ('udp')\n */\n send(binary, customOptions = {}) {\n const options = mergeOptions(this.options, customOptions)\n const { receiver } = options\n\n if (receiver === 'udp') {\n // send data to udp client\n const data = binary instanceof Buffer ? binary : new Buffer(binary)\n this.socket.send(\n data,\n 0,\n data.byteLength,\n options.udpClient.port,\n options.udpClient.host,\n )\n } else if (receiver === 'ws') {\n // send data to all Websocket clients\n this.websocket.clients.forEach((client) => {\n client.send(binary, { binary: true })\n })\n } else {\n throw new Error('BridgePlugin can not send message to unknown receiver')\n }\n }\n}\n","// eslint-disable-next-line no-undef, no-use-before-define\nconst WebsocketClient = typeof __dirname === 'undefined' ? WebSocket : require('ws')\n\n/**\n * Status flags\n * @private\n */\nconst STATUS = {\n IS_NOT_INITIALIZED: -1,\n IS_CONNECTING: 0,\n IS_OPEN: 1,\n IS_CLOSING: 2,\n IS_CLOSED: 3,\n}\n\n/**\n * Default options\n * @private\n */\nconst defaultOptions = {\n host: 'localhost',\n port: 8080,\n}\n\n/**\n * OSC plugin for a Websocket client running in node or browser context\n */\nexport default class WebsocketClientPlugin {\n /**\n * Create an OSC WebsocketClientPlugin instance with given options.\n * Defaults to *localhost:8080* for connecting to a Websocket server\n * @param {object} [options] Custom options\n * @param {string} [options.host='localhost'] Hostname of Websocket server\n * @param {number} [options.port=8080] Port of Websocket server\n *\n * @example\n * const plugin = new OSC.WebsocketClientPlugin({ port: 9912 })\n * const osc = new OSC({ plugin: plugin })\n */\n constructor(customOptions) {\n if (!WebsocketClient) {\n throw new Error('WebsocketClientPlugin can\\'t find a WebSocket class')\n }\n\n /**\n * @type {object} options\n * @private\n */\n this.options = Object.assign({}, defaultOptions, customOptions)\n\n /**\n * @type {object} socket\n * @private\n */\n this.socket = null\n /**\n * @type {number} socketStatus\n * @private\n */\n this.socketStatus = STATUS.IS_NOT_INITIALIZED\n\n /**\n * @type {function} notify\n * @private\n */\n this.notify = () => {}\n }\n\n /**\n * Internal method to hook into osc library's\n * EventHandler notify method\n * @param {function} fn Notify callback\n * @private\n */\n registerNotify(fn) {\n this.notify = fn\n }\n\n /**\n * Returns the current status of the connection\n * @return {number} Status identifier\n */\n status() {\n return this.socketStatus\n }\n\n /**\n * Connect to a Websocket server. Defaults to global options\n * @param {object} [customOptions] Custom options\n * @param {string} [customOptions.host] Hostname of Websocket server\n * @param {number} [customOptions.port] Port of Websocket server\n */\n open(customOptions = {}) {\n const options = Object.assign({}, this.options, customOptions)\n const { port, host } = options\n\n // close socket when already given\n if (this.socket) {\n this.close()\n }\n\n // create websocket client\n this.socket = new WebsocketClient(`ws://${host}:${port}`)\n this.socket.binaryType = 'arraybuffer'\n this.socketStatus = STATUS.IS_CONNECTING\n\n // register events\n this.socket.onopen = () => {\n this.socketStatus = STATUS.IS_OPEN\n this.notify('open')\n }\n\n this.socket.onclose = () => {\n this.socketStatus = STATUS.IS_CLOSED\n this.notify('close')\n }\n\n this.socket.onerror = (error) => {\n this.notify('error', error)\n }\n\n this.socket.onmessage = (message) => {\n this.notify(message.data)\n }\n }\n\n /**\n * Close Websocket\n */\n close() {\n this.socketStatus = STATUS.IS_CLOSING\n this.socket.close()\n }\n\n /**\n * Send an OSC Packet, Bundle or Message to Websocket server\n * @param {Uint8Array} binary Binary representation of OSC Packet\n */\n send(binary) {\n this.socket.send(binary)\n }\n}\n","const WebsocketServer = typeof __dirname !== 'undefined' ? require('ws').Server : undefined\n\n/**\n * Status flags\n * @private\n */\nconst STATUS = {\n IS_NOT_INITIALIZED: -1,\n IS_CONNECTING: 0,\n IS_OPEN: 1,\n IS_CLOSING: 2,\n IS_CLOSED: 3,\n}\n\n/**\n * Default options\n * @private\n */\nconst defaultOptions = {\n host: 'localhost',\n port: 8080,\n}\n\n/**\n * OSC plugin for a Websocket client running in node or browser context\n */\nexport default class WebsocketServerPlugin {\n /**\n * Create an OSC WebsocketServerPlugin instance with given options.\n * Defaults to *localhost:8080* for the Websocket server\n * @param {object} [options] Custom options\n * @param {string} [options.host='localhost'] Hostname of Websocket server\n * @param {number} [options.port=8080] Port of Websocket server\n *\n * @example\n * const plugin = new OSC.WebsocketServerPlugin({ port: 9912 })\n * const osc = new OSC({ plugin: plugin })\n *\n * osc.open() // start server\n */\n constructor(customOptions) {\n if (!WebsocketServer) {\n throw new Error('WebsocketServerPlugin can not be used in browser context')\n }\n\n /**\n * @type {object} options\n * @private\n */\n this.options = Object.assign({}, defaultOptions, customOptions)\n\n /**\n * @type {object} socket\n * @private\n */\n this.socket = null\n /**\n * @type {number} socketStatus\n * @private\n */\n this.socketStatus = STATUS.IS_NOT_INITIALIZED\n\n /**\n * @type {function} notify\n * @private\n */\n this.notify = () => {}\n }\n\n /**\n * Internal method to hook into osc library's\n * EventHandler notify method\n * @param {function} fn Notify callback\n * @private\n */\n registerNotify(fn) {\n this.notify = fn\n }\n\n /**\n * Returns the current status of the connection\n * @return {number} Status identifier\n */\n status() {\n return this.socketStatus\n }\n\n /**\n * Start a Websocket server. Defaults to global options\n * @param {object} [customOptions] Custom options\n * @param {string} [customOptions.host] Hostname of Websocket server\n * @param {number} [customOptions.port] Port of Websocket server\n */\n open(customOptions = {}) {\n const options = Object.assign({}, this.options, customOptions)\n const { port, host } = options\n\n // close socket when already given\n if (this.socket) {\n this.close()\n }\n\n // create websocket server\n this.socket = new WebsocketServer({ host, port })\n this.socket.binaryType = 'arraybuffer'\n this.socketStatus = STATUS.IS_CONNECTING\n\n // register events\n this.socket.on('open', () => {\n this.socketStatus = STATUS.IS_OPEN\n this.notify('open')\n })\n\n this.socket.on('close', () => {\n this.socketStatus = STATUS.IS_CLOSED\n this.notify('close')\n })\n\n this.socket.on('error', (error) => {\n this.notify('error', error)\n })\n\n this.socket.on('connection', (client) => {\n client.on('message', (message) => {\n this.notify(new Uint8Array(message))\n })\n })\n }\n\n /**\n * Close Websocket server\n */\n close() {\n this.socketStatus = STATUS.IS_CLOSING\n this.socket.close()\n }\n\n /**\n * Send an OSC Packet, Bundle or Message to Websocket clients\n * @param {Uint8Array} binary Binary representation of OSC Packet\n */\n send(binary) {\n this.socket.clients.forEach((client) => {\n client.send(binary, { binary: true })\n })\n }\n}\n","import { isObject, isString, isFunction, isInt } from './common/utils'\n\nimport Packet from './packet'\nimport Bundle from './bundle'\nimport Message from './message'\n\nimport EventHandler from './events'\n\nimport DatagramPlugin from './plugin/dgram'\nimport BridgePlugin from './plugin/bridge'\nimport WebsocketClientPlugin from './plugin/wsclient'\nimport WebsocketServerPlugin from './plugin/wsserver'\n\n/**\n * Default options\n * @private\n */\nconst defaultOptions = {\n plugin: new WebsocketClientPlugin(),\n discardLateMessages: false,\n}\n\n/**\n * Status flags\n */\nconst STATUS = {\n IS_NOT_INITIALIZED: -1,\n IS_CONNECTING: 0,\n IS_OPEN: 1,\n IS_CLOSING: 2,\n IS_CLOSED: 3,\n}\n\n/**\n * OSC interface to send OSC Packets and to listen to status-changes and\n * incoming message events. Offers a Plugin API for different network\n * protocols, defaults to a simple Websocket client for OSC communication\n * between a browser js-app and a js-node server\n *\n * @example\n * const osc = new OSC()\n *\n * osc.on('/input/test', (message) => {\n * // print incoming OSC message arguments\n * console.log(message.args)\n * })\n *\n * osc.on('open', () => {\n * const message = new Message('/test/path', 55.12, 'hello')\n * osc.send(message)\n * })\n *\n * osc.open({ host: '192.168.178.115', port: 9012 })\n */\nclass OSC {\n /**\n * Create an OSC instance with given options\n * @param {object} [options] Custom options\n * @param {boolean} [options.discardLateMessages=false] Ignore incoming\n * messages when given timetag lies in the past\n * @param {Plugin} [options.plugin=WebsocketClientPlugin] Add a connection plugin\n * to this interface, defaults to a plugin with Websocket client.\n * Open README.md for further information on how to handle plugins or\n * how to write your own with the Plugin API\n *\n * @example\n * const osc = new OSC() // default options with Websocket client\n *\n * @example\n * const osc = new OSC({ discardLateMessages: true })\n *\n * @example\n * const websocketPlugin = new OSC.WebsocketClientPlugin()\n * const osc = new OSC({ plugin: websocketPlugin })\n */\n constructor(options) {\n if (options && !isObject(options)) {\n throw new Error('OSC options argument has to be an object.')\n }\n\n /**\n * @type {object} options\n * @private\n */\n this.options = Object.assign({}, defaultOptions, options)\n /**\n * @type {EventHandler} eventHandler\n * @private\n */\n this.eventHandler = new EventHandler({\n discardLateMessages: this.options.discardLateMessages,\n })\n\n // pass EventHandler's notify() to plugin\n const eventHandler = this.eventHandler\n if (this.options.plugin && this.options.plugin.registerNotify) {\n this.options.plugin.registerNotify((...args) =>\n eventHandler.notify(...args)\n )\n }\n }\n\n /**\n * Listen to a status-change event or incoming OSC message with\n * address pattern matching\n * @param {string} eventName Event name or OSC address pattern\n * @param {function} callback Function which is called on notification\n * @return {number} Subscription id (needed to unsubscribe)\n *\n * @example\n * // will be called when server receives /in!trument/* for example\n * osc.on('/instrument/1', (message) => {\n * console.log(message)\n * })\n *\n * @example\n * // will be called on network socket error\n * osc.on('error', (message) => {\n * console.log(message)\n * })\n */\n on(eventName, callback) {\n if (!(isString(eventName) && isFunction(callback))) {\n throw new Error('OSC on() needs event- or address string and callback function')\n }\n\n return this.eventHandler.on(eventName, callback)\n }\n\n /**\n * Unsubscribe an event listener\n * @param {string} eventName Event name or OSC address pattern\n * @param {number} subscriptionId The subscription id\n * @return {boolean} Success state\n *\n * @example\n * const listenerId = osc.on('error', (message) => {\n * console.log(message)\n * })\n * osc.off('error', listenerId) // unsubscribe from error event\n */\n off(eventName, subscriptionId) {\n if (!(isString(eventName) && isInt(subscriptionId))) {\n throw new Error('OSC off() needs string and number (subscriptionId) to unsubscribe')\n }\n\n return this.eventHandler.off(eventName, subscriptionId)\n }\n\n /**\n * Open network socket with plugin. This method is used by\n * plugins and is not available without (see Plugin API for more information)\n * @param {object} [options] Custom global options for plugin instance\n *\n * @example\n * const osc = new OSC({ plugin: new OSC.DatagramPlugin() })\n * osc.open({ host: '127.0.0.1', port: 8080 })\n */\n open(options) {\n if (options && !isObject(options)) {\n throw new Error('OSC open() options argument needs to be an object')\n }\n\n if (!(this.options.plugin && isFunction(this.options.plugin.open))) {\n throw new Error('OSC Plugin API #open is not implemented!')\n }\n\n return this.options.plugin.open(options)\n }\n\n /**\n * Returns the current status of the connection. See *STATUS* for\n * different possible states. This method is used by plugins\n * and is not available without (see Plugin API for more information)\n * @return {number} Status identifier\n *\n * @example\n * import OSC, { STATUS } from 'osc'\n * const osc = new OSC()\n * if (osc.status() === STATUS.IS_CONNECTING) {\n * // do something\n * }\n */\n status() {\n if (!(this.options.plugin && isFunction(this.options.plugin.status))) {\n throw new Error('OSC Plugin API #status is not implemented!')\n }\n\n return this.options.plugin.status()\n }\n\n /**\n * Close connection. This method is used by plugins and is not\n * available without (see Plugin API for more information)\n */\n close() {\n if (!(this.options.plugin && isFunction(this.options.plugin.close))) {\n throw new Error('OSC Plugin API #close is not implemented!')\n }\n\n return this.options.plugin.close()\n }\n\n /**\n * Send an OSC Packet, Bundle or Message. This method is used by plugins\n * and is not available without (see Plugin API for more information)\n * @param {Packet|Bundle|Message} packet OSC Packet, Bundle or Message instance\n * @param {object} [options] Custom options\n *\n * @example\n * const osc = new OSC({ plugin: new OSC.DatagramPlugin() })\n * osc.open({ host: '127.0.0.1', port: 8080 })\n *\n * const message = new OSC.Message('/test/path', 55.1, 57)\n * osc.send(message)\n *\n * // send message again to custom address\n * osc.send(message, { host: '192.168.178.115', port: 9001 })\n */\n send(packet, options) {\n if (!(this.options.plugin && isFunction(this.options.plugin.send))) {\n throw new Error('OSC Plugin API #send is not implemented!')\n }\n\n if (!(packet instanceof Message || packet instanceof Bundle || packet instanceof Packet)) {\n throw new Error('OSC send() needs Messages, Bundles or Packets')\n }\n\n if (options && !isObject(options)) {\n throw new Error('OSC send() options argument has to be an object')\n }\n\n return this.options.plugin.send(packet.pack(), options)\n }\n}\n\n// expose status flags\nOSC.STATUS = STATUS\n\n// expose OSC classes\nOSC.Packet = Packet\nOSC.Bundle = Bundle\nOSC.Message = Message\n\n// expose plugins\nOSC.DatagramPlugin = DatagramPlugin\nOSC.WebsocketClientPlugin = WebsocketClientPlugin\nOSC.WebsocketServerPlugin = WebsocketServerPlugin\nOSC.BridgePlugin = BridgePlugin\n\nexport default OSC\n"],"names":["isInt","n","Number","isFloat","isString","isArray","Object","prototype","toString","call","isObject","isFunction","isBlob","Uint8Array","isDate","Date","isUndefined","pad","dataView","obj","buffer","DataView","ArrayBuffer","typeTag","item","Error","prepareAddress","address","join","length","slice","prepareRegExPattern","str","pattern","replace","EncodeHelper","data","byteLength","pack","push","result","offset","forEach","set","Atomic","value","method","initialOffset","AtomicInt32","AtomicFloat32","AtomicString","terminated","i","charCodeAt","charcode","getUint8","String","fromCharCode","apply","AtomicBlob","setInt32","getInt32","Message","types","args","shift","map","encoder","Helper","add","argument","merge","unpack","next","type","SECONDS_70_YEARS","TWO_POWER_32","Timetag","seconds","fractions","milliseconds","rounded","Math","floor","round","AtomicTimetag","now","timetag","timestamp","getTime","getUint32","BUNDLE_TAG","Bundle","bundleElements","ms","head","packet","Packet","size","defaultOptions","EventHandler","options","assign","addressHandlers","eventHandlers","uuid","bundle","bundleItem","dispatch","message","notify","name","success","handler","callback","handlerKeys","keys","handlers","key","regex","RegExp","test","lastIndex","discardLateMessages","that","split","subscriptionId","haystack","some","index","id","splice","dgram","__dirname","require","undefined","STATUS","defaultOpenOptions","defaultSendOptions","DatagramPlugin","customOptions","socket","createSocket","socketStatus","IS_NOT_INITIALIZED","on","error","fn","openOptions","port","exclusive","IS_CONNECTING","bind","host","IS_OPEN","IS_CLOSING","close","IS_CLOSED","binary","sendOptions","send","Buffer","WebSocket","Server","mergeOptions","base","custom","udpServer","udpClient","wsServer","BridgePlugin","websocket","receiver","binaryType","client","clients","WebsocketClient","WebsocketClientPlugin","onopen","onclose","onerror","onmessage","WebsocketServer","WebsocketServerPlugin","OSC","eventHandler","plugin","registerNotify","eventName","off","open","status"],"mappings":";;;;;;AAKO,SAASA,KAAT,CAAeC,CAAf,EAAkB;SAChBC,OAAOD,CAAP,MAAcA,CAAd,IAAmBA,IAAI,CAAJ,KAAU,CAApC;;AAQF,AAAO,SAASE,OAAT,CAAiBF,CAAjB,EAAoB;SAClBC,OAAOD,CAAP,MAAcA,CAAd,IAAmBA,IAAI,CAAJ,KAAU,CAApC;;AAQF,AAAO,SAASG,QAAT,CAAkBH,CAAlB,EAAqB;SACnB,OAAOA,CAAP,KAAa,QAApB;;AAQF,AAAO,SAASI,OAAT,CAAiBJ,CAAjB,EAAoB;SAClBK,OAAOC,SAAP,CAAiBC,QAAjB,CAA0BC,IAA1B,CAA+BR,CAA/B,MAAsC,gBAA7C;;AAQF,AAAO,SAASS,QAAT,CAAkBT,CAAlB,EAAqB;SACnBK,OAAOC,SAAP,CAAiBC,QAAjB,CAA0BC,IAA1B,CAA+BR,CAA/B,MAAsC,iBAA7C;;A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src/common/helpers.js","../src/atomic.js","../src/atomic/int32.js","../src/atomic/float32.js","../src/atomic/string.js","../src/atomic/blob.js","../src/message.js","../src/atomic/timetag.js","../src/bundle.js","../src/packet.js","../src/events.js","../src/plugin/dgram.js","../src/plugin/bridge.js","../src/plugin/wsclient.js","../src/plugin/wsserver.js","../src/osc.js"],"sourcesContent":["/**\n * Check if given object is an integer number\n * @param {*} n\n * @return {boolean}\n */\nexport function isInt(n) {\n return Number(n) === n && n % 1 === 0\n}\n\n/**\n * Check if given object is a float number\n * @param {*} n\n * @return {boolean}\n */\nexport function isFloat(n) {\n return Number(n) === n && n % 1 !== 0\n}\n\n/**\n * Check if given object is a string\n * @param {*} n\n * @return {boolean}\n */\nexport function isString(n) {\n return typeof n === 'string'\n}\n\n/**\n * Check if given object is an array\n * @param {*} n\n * @return {boolean}\n */\nexport function isArray(n) {\n return Object.prototype.toString.call(n) === '[object Array]'\n}\n\n/**\n * Check if given object is an object\n * @param {*} n\n * @return {boolean}\n */\nexport function isObject(n) {\n return Object.prototype.toString.call(n) === '[object Object]'\n}\n\n/**\n * Check if given object is a function\n * @param {*} n\n * @return {boolean}\n */\nexport function isFunction(n) {\n return typeof n === 'function'\n}\n\n/**\n * Check if given object is a Uint8Array\n * @param {*} n\n * @return {boolean}\n */\nexport function isBlob(n) {\n return n instanceof Uint8Array\n}\n\n/**\n * Check if given object is a Date\n * @param {*} n\n * @return {boolean}\n */\nexport function isDate(n) {\n return n instanceof Date\n}\n\n/**\n * Check if given object is undefined\n * @param {*} n\n * @return {boolean}\n */\nexport function isUndefined(n) {\n return typeof n === 'undefined'\n}\n\n/**\n * Return the next multiple of four\n * @param {number} n\n */\nexport function pad(n) {\n return (n + 3) & ~0x03\n}\n\n/**\n * Wrap binary data in DataView\n * @param {*} obj\n * @return {DataView}\n */\nexport function dataView(obj) {\n if (obj.buffer) {\n return new DataView(obj.buffer)\n } else if (obj instanceof ArrayBuffer) {\n return new DataView(obj)\n }\n\n return new DataView(new Uint8Array(obj))\n}\n","import { isArray, isInt, isFloat, isString, isBlob } from './utils'\n\n/**\n * Checks type of given object and returns the regarding OSC\n * Type tag character\n * @param {*} item Any object\n * @return {string} OSC Type tag character\n */\nexport function typeTag(item) {\n if (isInt(item)) {\n return 'i'\n } else if (isFloat(item)) {\n return 'f'\n } else if (isString(item)) {\n return 's'\n } else if (isBlob(item)) {\n return 'b'\n }\n\n throw new Error('OSC typeTag() found unknown value type')\n}\n\n/**\n * Sanitizes an OSC-ready Address Pattern\n * @param {array|string} obj Address as string or array of strings\n * @return {string} Corrected address string\n *\n * @example\n * // all calls return '/test/path' string:\n * prepareAddress('test/path')\n * prepareAddress('/test/path/')\n * prepareAddress([test, path])\n */\nexport function prepareAddress(obj) {\n let address = ''\n\n if (isArray(obj)) {\n return `/${obj.join('/')}`\n } else if (isString(obj)) {\n address = obj\n\n // remove slash at ending of address\n if (address.length > 1 && address[address.length - 1] === '/') {\n address = address.slice(0, address.length - 1)\n }\n\n // add slash at beginning of address\n if (address.length > 1 && address[0] !== '/') {\n address = `/${address}`\n }\n\n return address\n }\n\n throw new Error('OSC prepareAddress() needs addresses of type array or string')\n}\n\n/**\n * Make an OSC address pattern javascript-regex-ready\n * @param {string} str OSC address pattern\n * @return {string} Javascript RegEx string\n */\nexport function prepareRegExPattern(str) {\n let pattern\n\n if (!(isString(str))) {\n throw new Error('OSC prepareRegExPattern() needs strings')\n }\n\n pattern = str.replace(/\\./g, '\\\\.')\n pattern = pattern.replace(/\\(/g, '\\\\(')\n pattern = pattern.replace(/\\)/g, '\\\\)')\n\n pattern = pattern.replace(/\\{/g, '(')\n pattern = pattern.replace(/\\}/g, ')')\n pattern = pattern.replace(/,/g, '|')\n\n pattern = pattern.replace(/\\[!/g, '[^')\n\n pattern = pattern.replace(/\\?/g, '.')\n pattern = pattern.replace(/\\*/g, '.*')\n\n return pattern\n}\n\n/**\n * Holds a list of items and helps to merge them\n * into a single array of packed binary data\n */\nexport default class EncodeHelper {\n /**\n * Create a new EncodeHelper instance\n */\n constructor() {\n /** @type {array} data */\n this.data = []\n /** @type {number} byteLength */\n this.byteLength = 0\n }\n\n /**\n * Packs an item and adds it to the list\n * @param {*} item Any object\n * @return {EncodeHelper}\n */\n add(item) {\n const buffer = item.pack()\n this.byteLength += buffer.byteLength\n this.data.push(buffer)\n\n return this\n }\n\n /**\n * Merge all added items into one Uint8Array\n * @return {Uint8Array} Merged binary data array of all items\n */\n merge() {\n const result = new Uint8Array(this.byteLength)\n let offset = 0\n\n this.data.forEach((data) => {\n result.set(data, offset)\n offset += data.byteLength\n })\n\n return result\n }\n}\n","import { isUndefined } from './common/utils'\n\n/**\n * Base class for OSC Atomic Data Types\n */\nexport default class Atomic {\n /**\n * Create an Atomic instance\n * @param {*} [value] Initial value of any type\n */\n constructor(value) {\n /** @type {*} value */\n this.value = value\n /** @type {number} offset */\n this.offset = 0\n }\n\n /**\n * Interpret the given value of this entity as packed binary data\n * @param {string} method The DataView method to write to the ArrayBuffer\n * @param {number} byteLength Size of array in bytes\n * @return {Uint8Array} Packed binary data\n */\n pack(method, byteLength) {\n if (!(method && byteLength)) {\n throw new Error('OSC Atomic cant\\'t be packed without given method or byteLength')\n }\n\n const data = new Uint8Array(byteLength)\n const dataView = new DataView(data.buffer)\n\n if (isUndefined(this.value)) {\n throw new Error('OSC Atomic cant\\'t be encoded with empty value')\n }\n\n // use DataView to write to ArrayBuffer\n dataView[method](this.offset, this.value, false)\n\n // always return binary Uint8Array after packing\n return data\n }\n\n /**\n * Unpack binary data from DataView according to the given format\n * @param {DataView} dataView The DataView holding the binary representation of the value\n * @param {string} method The DataView method to read the format from the ArrayBuffer\n * @param {number} byteLength Size of array in bytes\n * @param {number} [initialOffset=0] Offset of DataView before unpacking\n * @return {number} Offset after unpacking\n */\n unpack(dataView, method, byteLength, initialOffset = 0) {\n if (!(dataView && method && byteLength)) {\n throw new Error('OSC Atomic cant\\'t be unpacked without given dataView, method or byteLength')\n }\n\n if (!(dataView instanceof DataView)) {\n throw new Error('OSC Atomic expects an instance of type DataView')\n }\n\n // use DataView to read from ArrayBuffer and add offset\n this.value = dataView[method](initialOffset, false)\n this.offset = initialOffset + byteLength\n\n // always return offset number after unpacking\n return this.offset\n }\n}\n","import { isInt } from '../common/utils'\n\nimport Atomic from '../atomic'\n\n/**\n * 32-bit big-endian two's complement integer OSC Atomic Data Type\n */\nexport default class AtomicInt32 extends Atomic {\n /**\n * Create an AtomicInt32 instance\n * @param {number} [value] Initial integer value\n */\n constructor(value) {\n if (value && !isInt(value)) {\n throw new Error('OSC AtomicInt32 constructor expects value of type number')\n }\n\n super(value)\n }\n\n /**\n * Interpret the given number as packed binary data\n * @return {Uint8Array} Packed binary data\n */\n pack() {\n return super.pack('setInt32', 4)\n }\n\n /**\n * Unpack binary data from DataView and read a Int32 number\n * @param {DataView} dataView The DataView holding the binary representation of the value\n * @param {number} [initialOffset=0] Offset of DataView before unpacking\n * @return {number} Offset after unpacking\n */\n unpack(dataView, initialOffset = 0) {\n return super.unpack(dataView, 'getInt32', 4, initialOffset)\n }\n}\n","import { isFloat } from '../common/utils'\n\nimport Atomic from '../atomic'\n\n/**\n * 32-bit big-endian IEEE 754 floating point number OSC Atomic Data Type\n */\nexport default class AtomicFloat32 extends Atomic {\n /**\n * Create an AtomicFloat32 instance\n * @param {number} [value] Float number\n */\n constructor(value) {\n if (value && !isFloat(value)) {\n throw new Error('OSC AtomicFloat32 constructor expects value of type float')\n }\n\n super(value)\n }\n\n /**\n * Interpret the given number as packed binary data\n * @return {Uint8Array} Packed binary data\n */\n pack() {\n return super.pack('setFloat32', 4)\n }\n\n /**\n * Unpack binary data from DataView and read a Float32 number\n * @param {DataView} dataView The DataView holding the binary representation of the value\n * @param {number} [initialOffset=0] Offset of DataView before unpacking\n * @return {number} Offset after unpacking\n */\n unpack(dataView, initialOffset = 0) {\n return super.unpack(dataView, 'getFloat32', 4, initialOffset)\n }\n}\n","import { pad, isString, isUndefined } from '../common/utils'\n\nimport Atomic from '../atomic'\n\n/**\n * A sequence of non-null ASCII characters OSC Atomic Data Type\n */\nexport default class AtomicString extends Atomic {\n /**\n * Create an AtomicString instance\n * @param {string} [value] Initial string value\n */\n constructor(value) {\n if (value && !isString(value)) {\n throw new Error('OSC AtomicString constructor expects value of type string')\n }\n\n super(value)\n }\n\n /**\n * Interpret the given string as packed binary data\n * @return {Uint8Array} Packed binary data\n */\n pack() {\n if (isUndefined(this.value)) {\n throw new Error('OSC AtomicString can not be encoded with empty value')\n }\n\n // add 0-3 null characters for total number of bits a multiple of 32\n const terminated = `${this.value}\\u0000`\n const byteLength = pad(terminated.length)\n\n const buffer = new Uint8Array(byteLength)\n\n for (let i = 0; i < terminated.length; i += 1) {\n buffer[i] = terminated.charCodeAt(i)\n }\n\n return buffer\n }\n\n /**\n * Unpack binary data from DataView and read a string\n * @param {DataView} dataView The DataView holding the binary representation of the string\n * @param {number} [initialOffset=0] Offset of DataView before unpacking\n * @return {number} Offset after unpacking\n */\n unpack(dataView, initialOffset = 0) {\n if (!(dataView instanceof DataView)) {\n throw new Error('OSC AtomicString expects an instance of type DataView')\n }\n\n let offset = initialOffset\n let charcode\n const data = []\n\n for (; offset < dataView.byteLength; offset += 1) {\n charcode = dataView.getUint8(offset)\n\n // check for terminating null character\n if (charcode !== 0) {\n data.push(charcode)\n } else {\n offset += 1\n break\n }\n }\n\n if (offset === dataView.length) {\n throw new Error('OSC AtomicString found a malformed OSC string')\n }\n\n /** @type {number} offset */\n this.offset = pad(offset)\n /** @type {string} value */\n this.value = String.fromCharCode.apply(null, data)\n\n return this.offset\n }\n}\n","import { pad, isBlob, isUndefined } from '../common/utils'\n\nimport Atomic from '../atomic'\n\n/**\n * 8-bit bytes of arbitrary binary data OSC Atomic Data Type\n */\nexport default class AtomicBlob extends Atomic {\n /**\n * Create an AtomicBlob instance\n * @param {Uint8Array} [value] Binary data\n */\n constructor(value) {\n if (value && !isBlob(value)) {\n throw new Error('OSC AtomicBlob constructor expects value of type Uint8Array')\n }\n\n super(value)\n }\n\n /**\n * Interpret the given blob as packed binary data\n * @return {Uint8Array} Packed binary data\n */\n pack() {\n if (isUndefined(this.value)) {\n throw new Error('OSC AtomicBlob can not be encoded with empty value')\n }\n\n const byteLength = pad(this.value.byteLength)\n const data = new Uint8Array(byteLength + 4)\n const dataView = new DataView(data.buffer)\n\n // an int32 size count\n dataView.setInt32(0, this.value.byteLength, false)\n // followed by 8-bit bytes of arbitrary binary data\n data.set(this.value, 4)\n\n return data\n }\n\n /**\n * Unpack binary data from DataView and read a blob\n * @param {DataView} dataView The DataView holding the binary representation of the blob\n * @param {number} [initialOffset=0] Offset of DataView before unpacking\n * @return {number} Offset after unpacking\n */\n unpack(dataView, initialOffset = 0) {\n if (!(dataView instanceof DataView)) {\n throw new Error('OSC AtomicBlob expects an instance of type DataView')\n }\n\n const byteLength = dataView.getInt32(initialOffset, false)\n\n /** @type {Uint8Array} value */\n this.value = new Uint8Array(dataView.buffer, initialOffset + 4, byteLength)\n /** @type {number} offset */\n this.offset = pad(initialOffset + 4 + byteLength)\n\n return this.offset\n }\n}\n","import { isString, isArray, isInt, isFloat, isBlob } from './common/utils'\nimport Helper, { typeTag, prepareAddress } from './common/helpers'\n\nimport AtomicInt32 from './atomic/int32'\nimport AtomicFloat32 from './atomic/float32'\nimport AtomicString from './atomic/string'\nimport AtomicBlob from './atomic/blob'\n\n/**\n * An OSC message consists of an OSC Address Pattern followed\n * by an OSC Type Tag String followed by zero or more OSC Arguments\n */\nexport default class Message {\n /**\n * Create a Message instance\n * @param {array|string} args Address\n * @param {...*} args OSC Atomic Data Types\n *\n * @example\n * const message = new Message(['test', 'path'], 50, 100.52, 'test')\n *\n * @example\n * const message = new Message('/test/path', 51.2)\n */\n constructor(...args) {\n /**\n * @type {number} offset\n * @private\n */\n this.offset = 0\n /** @type {string} address */\n this.address = ''\n /** @type {string} types */\n this.types = ''\n /** @type {array} args */\n this.args = []\n\n if (args.length > 0) {\n if (!(isString(args[0]) || isArray(args[0]))) {\n throw new Error('OSC Message constructor first argument (address) must be a string or array')\n }\n\n this.address = prepareAddress(args.shift())\n this.types = args.map(item => typeTag(item)).join('')\n this.args = args\n }\n }\n\n /**\n * Add an OSC Atomic Data Type to the list of elements\n * @param {*} item\n */\n add(item) {\n if (!item) {\n throw new Error('OSC Message needs a valid OSC Atomic Data Type')\n }\n\n this.args.push(item)\n this.types += typeTag(item)\n }\n\n /**\n * Interpret the Message as packed binary data\n * @return {Uint8Array} Packed binary data\n */\n pack() {\n if (this.address.length === 0 || this.address[0] !== '/') {\n throw new Error('OSC Message has an invalid address')\n }\n\n const encoder = new Helper()\n\n // OSC Address Pattern and Type string\n encoder.add(new AtomicString(this.address))\n encoder.add(new AtomicString(`,${this.types}`))\n\n // followed by zero or more OSC Arguments\n if (this.args.length > 0) {\n let argument\n\n this.args.forEach((value) => {\n if (isInt(value)) {\n argument = new AtomicInt32(value)\n } else if (isFloat(value)) {\n argument = new AtomicFloat32(value)\n } else if (isString(value)) {\n argument = new AtomicString(value)\n } else if (isBlob(value)) {\n argument = new AtomicBlob(value)\n } else {\n throw new Error('OSC Message found unknown argument type')\n }\n\n encoder.add(argument)\n })\n }\n\n return encoder.merge()\n }\n\n /**\n * Unpack binary data to read a Message\n * @param {DataView} dataView The DataView holding the binary representation of a Message\n * @param {number} [initialOffset=0] Offset of DataView before unpacking\n * @return {number} Offset after unpacking\n */\n unpack(dataView, initialOffset = 0) {\n if (!(dataView instanceof DataView)) {\n throw new Error('OSC Message expects an instance of type DataView.')\n }\n\n // read address pattern\n const address = new AtomicString()\n address.unpack(dataView, initialOffset)\n\n // read type string\n const types = new AtomicString()\n types.unpack(dataView, address.offset)\n\n if (address.value.length === 0 || address.value[0] !== '/') {\n throw new Error('OSC Message found malformed or missing address string')\n }\n\n if (types.value.length === 0 && types.value[0] !== ',') {\n throw new Error('OSC Message found malformed or missing type string')\n }\n\n let offset = types.offset\n let next\n let type\n\n const args = []\n\n // read message arguments (OSC Atomic Data Types)\n for (let i = 1; i < types.value.length; i += 1) {\n type = types.value[i]\n\n if (type === 'i') {\n next = new AtomicInt32()\n } else if (type === 'f') {\n next = new AtomicFloat32()\n } else if (type === 's') {\n next = new AtomicString()\n } else if (type === 'b') {\n next = new AtomicBlob()\n } else {\n throw new Error('OSC Message found non-standard argument type')\n }\n\n offset = next.unpack(dataView, offset)\n args.push(next.value)\n }\n\n this.offset = offset\n this.address = address.value\n this.types = types.value\n this.args = args\n\n return this.offset\n }\n}\n","import { isInt, isDate, isUndefined } from '../common/utils'\n\nimport Atomic from '../atomic'\n\n/** 70 years in seconds */\nexport const SECONDS_70_YEARS = 2208988800\n/** 2^32 */\nexport const TWO_POWER_32 = 4294967296\n\n/**\n * Timetag helper class for representing NTP timestamps\n * and conversion between them and javascript representation\n */\nexport class Timetag {\n /**\n * Create a Timetag instance\n * @param {number} [seconds=0] Initial NTP *seconds* value\n * @param {number} [fractions=0] Initial NTP *fractions* value\n */\n constructor(seconds = 0, fractions = 0) {\n if (!(isInt(seconds) && isInt(fractions))) {\n throw new Error('OSC Timetag constructor expects values of type integer number')\n }\n\n /** @type {number} seconds */\n this.seconds = seconds\n /** @type {number} fractions */\n this.fractions = fractions\n }\n\n /**\n * Converts from NTP to JS representation and back\n * @param {number} [milliseconds] Converts from JS milliseconds to NTP.\n * Leave empty for converting from NTP to JavaScript representation\n * @return {number} Javascript timestamp\n */\n timestamp(milliseconds) {\n let seconds\n\n if (typeof milliseconds === 'number') {\n seconds = milliseconds / 1000\n const rounded = Math.floor(seconds)\n\n this.seconds = rounded + SECONDS_70_YEARS\n this.fractions = Math.round(TWO_POWER_32 * (seconds - rounded))\n\n return milliseconds\n }\n\n seconds = this.seconds - SECONDS_70_YEARS\n return (seconds + (this.fractions / TWO_POWER_32)) * 1000\n }\n}\n\n/**\n * 64-bit big-endian fixed-point time tag, semantics\n * defined below OSC Atomic Data Type\n */\nexport default class AtomicTimetag extends Atomic {\n /**\n * Create a AtomicTimetag instance\n * @param {number|Timetag|Date} [value] Initial date, leave empty if\n * you want it to be the current date\n */\n constructor(value = Date.now()) {\n let timetag = new Timetag()\n\n if (value instanceof Timetag) {\n timetag = value\n } else if (isInt(value)) {\n timetag.timestamp(value)\n } else if (isDate(value)) {\n timetag.timestamp(value.getTime())\n }\n\n super(timetag)\n }\n\n /**\n * Interpret the given timetag as packed binary data\n * @return {Uint8Array} Packed binary data\n */\n pack() {\n if (isUndefined(this.value)) {\n throw new Error('OSC AtomicTimetag can not be encoded with empty value')\n }\n\n const { seconds, fractions } = this.value\n const data = new Uint8Array(8)\n const dataView = new DataView(data.buffer)\n\n dataView.setInt32(0, seconds, false)\n dataView.setInt32(4, fractions, false)\n\n return data\n }\n\n /**\n * Unpack binary data from DataView and read a timetag\n * @param {DataView} dataView The DataView holding the binary representation of the timetag\n * @param {number} [initialOffset=0] Offset of DataView before unpacking\n * @return {number} Offset after unpacking\n */\n unpack(dataView, initialOffset = 0) {\n if (!(dataView instanceof DataView)) {\n throw new Error('OSC AtomicTimetag expects an instance of type DataView')\n }\n\n const seconds = dataView.getUint32(initialOffset, false)\n const fractions = dataView.getUint32(initialOffset + 4, false)\n\n /** @type {Timetag} value */\n this.value = new Timetag(seconds, fractions)\n /** @type {number} offset */\n this.offset = initialOffset + 8\n\n return this.offset\n }\n}\n","import { isArray, isInt } from './common/utils'\nimport EncodeHelper from './common/helpers'\n\nimport Packet from './packet'\nimport Message from './message'\nimport AtomicString from './atomic/string'\nimport AtomicInt32 from './atomic/int32'\nimport AtomicTimetag from './atomic/timetag'\n\n/** OSC Bundle string */\nexport const BUNDLE_TAG = '#bundle'\n\n/**\n * An OSC Bundle consist of a Timetag and one or many Bundle Elements.\n * The elements are either OSC Messages or more OSC Bundles\n */\nexport default class Bundle {\n /**\n * Create a Bundle instance\n * @param {...*} [args] Timetag and elements. See examples for options\n *\n * @example\n * const bundle = new Bundle(new Date() + 500)\n *\n * @example\n * const message = new Message('/test/path', 51.2)\n * const anotherBundle = new Bundle([message], Date.now() + 1500)\n *\n * @example\n * const message = new Message('/test/path', 51.2)\n * const anotherMessage = new Message('/test/message', 'test', 12)\n * const anotherBundle = new Bundle(message, anotherMessage)\n */\n constructor(...args) {\n /**\n * @type {number} offset\n * @private\n */\n this.offset = 0\n /** @type {AtomicTimetag} timetag */\n this.timetag = new AtomicTimetag()\n /** @type {array} bundleElements */\n this.bundleElements = []\n\n if (args.length > 0) {\n // first argument is an Date or js timestamp (number)\n if (args[0] instanceof Date || isInt(args[0])) {\n this.timetag = new AtomicTimetag(args[0])\n } else if (isArray(args[0])) {\n // first argument is an Array of Bundle elements\n args[0].forEach((item) => {\n this.add(item)\n })\n\n // second argument is an Date or js timestamp (number)\n if (args.length > 1 && (args[1] instanceof Date || isInt(args[0]))) {\n this.timetag = new AtomicTimetag(args[1])\n }\n } else {\n // take all arguments as Bundle elements\n args.forEach((item) => {\n this.add(item)\n })\n }\n }\n }\n\n /**\n * Take a JavaScript timestamp to set the Bundle's timetag\n * @param {number} ms JS timestamp in milliseconds\n *\n * @example\n * const bundle = new Bundle()\n * bundle.timestamp(Date.now() + 5000) // in 5 seconds\n */\n timestamp(ms) {\n if (!isInt(ms)) {\n throw new Error('OSC Bundle needs an integer for setting the timestamp')\n }\n\n this.timetag = new AtomicTimetag(ms)\n }\n\n /**\n * Add a Message or Bundle to the list of elements\n * @param {Bundle|Message} item\n */\n add(item) {\n if (!(item instanceof Message || item instanceof Bundle)) {\n throw new Error('OSC Bundle contains only Messages and Bundles')\n }\n\n this.bundleElements.push(item)\n }\n\n /**\n * Interpret the Bundle as packed binary data\n * @return {Uint8Array} Packed binary data\n */\n pack() {\n const encoder = new EncodeHelper()\n\n // an OSC Bundle consists of the OSC-string \"#bundle\"\n encoder.add(new AtomicString(BUNDLE_TAG))\n\n // followed by an OSC Time Tag\n if (!this.timetag) {\n this.timetag = new AtomicTimetag()\n }\n\n encoder.add(this.timetag)\n\n // followed by zero or more OSC Bundle Elements\n this.bundleElements.forEach((item) => {\n encoder.add(new AtomicInt32(item.pack().byteLength))\n encoder.add(item)\n })\n\n return encoder.merge()\n }\n\n /**\n * Unpack binary data to read a Bundle\n * @param {DataView} dataView The DataView holding the binary representation of a Bundle\n * @param {number} [initialOffset=0] Offset of DataView before unpacking\n * @return {number} Offset after unpacking\n */\n unpack(dataView, initialOffset = 0) {\n if (!(dataView instanceof DataView)) {\n throw new Error('OSC Bundle expects an instance of type DataView')\n }\n\n // read the beginning bundle string\n const head = new AtomicString()\n head.unpack(dataView, initialOffset)\n\n if (head.value !== BUNDLE_TAG) {\n throw new Error('OSC Bundle does not contain a valid #bundle head')\n }\n\n // read the timetag\n const timetag = new AtomicTimetag()\n let offset = timetag.unpack(dataView, head.offset)\n\n // read the bundle elements\n this.bundleElements = []\n\n while (offset < dataView.byteLength) {\n const packet = new Packet()\n const size = new AtomicInt32()\n\n offset = size.unpack(dataView, offset)\n offset = packet.unpack(dataView, offset, this.timetag)\n\n this.bundleElements.push(packet.value)\n }\n\n this.offset = offset\n this.timetag = timetag\n\n return this.offset\n }\n}\n","import Bundle, { BUNDLE_TAG } from './bundle'\nimport Message from './message'\nimport AtomicString from './atomic/string'\n\n/**\n * The unit of transmission of OSC is an OSC Packet. The contents\n * of an OSC packet must be either an OSC Message or an OSC Bundle\n */\nexport default class Packet {\n /**\n * Create a Packet instance holding a Message or Bundle\n * @param {Message|Bundle} [value] Initial Packet value\n */\n constructor(value) {\n if (value && !(value instanceof Message || value instanceof Bundle)) {\n throw new Error('OSC Packet value has to be Message or Bundle')\n }\n\n /** @type {Message|Bundle} value */\n this.value = value\n /**\n * @type {number} offset\n * @private\n */\n this.offset = 0\n }\n\n /**\n * Packs the Packet value. This implementation is more like\n * a wrapper due to OSC specifications, you could also skip the\n * Packet and directly work with the Message or Bundle instance\n * @return {Uint8Array} Packed binary data\n *\n * @example\n * const message = new Message('/test/path', 21.5, 'test')\n * const packet = new Packet(message)\n * const packetBinary = packet.pack() // then send it via udp etc.\n *\n * // or skip the Packet for convenience\n * const messageBinary = message.pack()\n */\n pack() {\n if (!this.value) {\n throw new Error('OSC Packet can not be encoded with empty body')\n }\n\n return this.value.pack()\n }\n\n /**\n * Unpack binary data from DataView to read Messages or Bundles\n * @param {DataView} dataView The DataView holding a binary representation of a Packet\n * @param {number} [initialOffset=0] Offset of DataView before unpacking\n * @return {number} Offset after unpacking\n */\n unpack(dataView, initialOffset = 0) {\n if (!(dataView instanceof DataView)) {\n throw new Error('OSC Packet expects an instance of type DataView')\n }\n\n if (dataView.byteLength % 4 !== 0) {\n throw new Error('OSC Packet byteLength has to be a multiple of four')\n }\n\n const head = new AtomicString()\n head.unpack(dataView, initialOffset)\n\n let item\n\n // check if Packet is a Bundle or a Message\n if (head.value === BUNDLE_TAG) {\n item = new Bundle()\n } else {\n item = new Message()\n }\n\n item.unpack(dataView, initialOffset)\n\n this.offset = item.offset\n this.value = item\n\n return this.offset\n }\n}\n","import { isArray, isString, isInt, isFunction, dataView } from './common/utils'\nimport { prepareAddress, prepareRegExPattern } from './common/helpers'\n\nimport Packet from './packet'\nimport Bundle from './bundle'\nimport Message from './message'\n\n/**\n * Default options\n * @private\n */\nconst defaultOptions = {\n discardLateMessages: false,\n}\n\n/**\n * EventHandler to notify listeners on matching OSC messages and\n * status changes of plugins\n */\nexport default class EventHandler {\n /**\n * Create an EventHandler instance\n * @param {object} options Custom options\n */\n constructor(options) {\n /**\n * @type {object} options\n * @private\n */\n this.options = Object.assign({}, defaultOptions, options)\n /**\n * @type {array} addressHandlers\n * @private\n */\n this.addressHandlers = []\n /**\n * @type {object} eventHandlers\n * @private\n */\n this.eventHandlers = {\n open: [],\n error: [],\n close: [],\n }\n /**\n * @type {number} uuid\n * @private\n */\n this.uuid = 0\n }\n\n /**\n * Internally used method to dispatch OSC Packets. Extracts\n * given Timetags and dispatches them accordingly\n * @param {Packet} packet\n * @return {boolean} Success state\n * @private\n */\n dispatch(packet) {\n if (!(packet instanceof Packet)) {\n throw new Error('OSC EventHander dispatch() accepts only arguments of type Packet')\n }\n\n if (!packet.value) {\n throw new Error('OSC EventHander dispatch() can\\'t read empty Packets')\n }\n\n if (packet.value instanceof Bundle) {\n const bundle = packet.value\n\n return bundle.bundleElements.forEach((bundleItem) => {\n if (packet.value instanceof Bundle) {\n if (bundle.timetag.value.timestamp() < bundleItem.timetag.value.timestamp()) {\n throw new Error('OSC Bundle timestamp is older than the timestamp of enclosed Bundles')\n }\n return this.dispatch(bundleItem)\n } else if (bundleItem instanceof Message) {\n const message = bundleItem\n return this.notify(message.address, message, bundle.timetag.value.timestamp())\n }\n\n throw new Error('OSC EventHander dispatch() can\\'t dispatch unknown Packet value')\n })\n } else if (packet.value instanceof Message) {\n const message = packet.value\n return this.notify(message.address, message)\n }\n\n throw new Error('OSC EventHander dispatch() can\\'t dispatch unknown Packet value')\n }\n\n /**\n * Internally used method to invoke listener callbacks. Uses regular\n * expression pattern matching for OSC addresses\n * @param {string} name OSC address or event name\n * @param {*} [data] The data of the event\n * @return {boolean} Success state\n * @private\n */\n call(name, data) {\n let success = false\n\n // call event handlers\n if (isString(name) && name in this.eventHandlers) {\n this.eventHandlers[name].forEach((handler) => {\n handler.callback(data)\n success = true\n })\n\n return success\n }\n\n // call address handlers\n const handlerKeys = Object.keys(this.addressHandlers)\n const handlers = this.addressHandlers\n\n handlerKeys.forEach((key) => {\n const regex = new RegExp(prepareRegExPattern(prepareAddress(name)), 'g')\n const test = regex.test(key)\n\n // found a matching address in our callback handlers\n if (test && key.length === regex.lastIndex) {\n handlers[key].forEach((handler) => {\n handler.callback(data)\n success = true\n })\n }\n })\n\n return success\n }\n\n /**\n * Notify the EventHandler of incoming OSC messages or status\n * changes (*open*, *close*, *error*). Handles OSC address patterns\n * and executes timed messages. Use binary arrays when\n * handling directly incoming network data. Packet's or Messages can\n * also be used\n * @param {...*} args\n * The OSC address pattern / event name as string}. For convenience and\n * Plugin API communication you can also use Message or Packet instances\n * or ArrayBuffer, Buffer instances (low-level access). The latter will\n * automatically be unpacked\n * When using a string you can also pass on data as a second argument\n * (any type). All regarding listeners will be notified with this data.\n * As a third argument you can define a javascript timestamp (number or\n * Date instance) for timed notification of the listeners.\n * @return {boolean} Success state of notification\n *\n * @example\n * const socket = dgram.createSocket('udp4')\n * socket.on('message', (message) => {\n * this.notify(message)\n * })\n *\n * @example\n * this.notify('error', error.message)\n *\n * @example\n * const message = new OSC.Message('/test/path', 55)\n * this.notify(message)\n *\n * @example\n * const message = new OSC.Message('/test/path', 55)\n * // override timestamp\n * this.notify(message.address, message, Date.now() + 5000)\n */\n notify(...args) {\n if (args.length === 0) {\n throw new Error('OSC EventHandler can not be called without any argument')\n }\n\n // check for incoming dispatchable OSC data\n if (args[0] instanceof Packet) {\n return this.dispatch(args[0])\n } else if (args[0] instanceof Bundle || args[0] instanceof Message) {\n return this.dispatch(new Packet(args[0]))\n } else if (!isString(args[0])) {\n const packet = new Packet()\n packet.unpack(dataView(args[0]))\n return this.dispatch(packet)\n }\n\n const name = args[0]\n\n // data argument\n let data = null\n\n if (args.length > 1) {\n data = args[1]\n }\n\n // timestamp argument\n let timestamp = null\n\n if (args.length > 2) {\n if (isInt(args[2])) {\n timestamp = args[2]\n } else if (args[2] instanceof Date) {\n timestamp = args[2].getTime()\n } else {\n throw new Error('OSC EventHandler timestamp has to be a number or Date')\n }\n }\n\n // notify now or later\n if (timestamp) {\n const now = Date.now()\n\n // is message outdated?\n if (now > timestamp) {\n if (!this.options.discardLateMessages) {\n return this.call(name, data)\n }\n }\n\n // notify later\n const that = this\n\n setTimeout(() => {\n that.call(name, data)\n }, timestamp - now)\n\n return true\n }\n\n return this.call(name, data)\n }\n\n /**\n * Subscribe to a new address or event you want to listen to\n * @param {string} name The OSC address or event name\n * @param {function} callback Callback function on notification\n * @return {number} Subscription identifier (needed to unsubscribe)\n */\n on(name, callback) {\n if (!(isString(name) || isArray(name))) {\n throw new Error('OSC EventHandler accepts only strings or arrays for address patterns')\n }\n\n if (!isFunction(callback)) {\n throw new Error('OSC EventHandler callback has to be a function')\n }\n\n // get next id\n this.uuid += 1\n\n // prepare handler\n const handler = {\n id: this.uuid,\n callback,\n }\n\n // register event listener\n if (isString(name) && name in this.eventHandlers) {\n this.eventHandlers[name].push(handler)\n return this.uuid\n }\n\n // register address listener\n const address = prepareAddress(name)\n const regex = new RegExp(/[#*\\s[\\],/{}|?]/g)\n\n if (regex.test(address.split('/').join(''))) {\n throw new Error('OSC EventHandler address string contains invalid characters')\n }\n\n if (!(address in this.addressHandlers)) {\n this.addressHandlers[address] = []\n }\n\n this.addressHandlers[address].push(handler)\n\n return this.uuid\n }\n\n /**\n * Unsubscribe listener from event notification or address handler\n * @param {string} name The OSC address or event name\n * @param {number} subscriptionId Subscription id to identify the handler\n * @return {boolean} Success state\n */\n off(name, subscriptionId) {\n if (!(isString(name) || isArray(name))) {\n throw new Error('OSC EventHandler accepts only strings or arrays for address patterns')\n }\n\n if (!isInt(subscriptionId)) {\n throw new Error('OSC EventHandler subscription id has to be a number')\n }\n\n let key\n let haystack\n\n // event or address listener\n if (isString(name) && name in this.eventHandlers) {\n key = name\n haystack = this.eventHandlers\n } else {\n key = prepareAddress(name)\n haystack = this.addressHandlers\n }\n\n // remove the entry\n if (key in haystack) {\n return haystack[key].some((item, index) => {\n if (item.id === subscriptionId) {\n haystack[key].splice(index, 1)\n return true\n }\n\n return false\n })\n }\n\n return false\n }\n}\n","const dgram = typeof __dirname !== 'undefined' ? require('dgram') : undefined\n\n/**\n * Status flags\n * @private\n */\nconst STATUS = {\n IS_NOT_INITIALIZED: -1,\n IS_CONNECTING: 0,\n IS_OPEN: 1,\n IS_CLOSING: 2,\n IS_CLOSED: 3,\n}\n\n/**\n * Default options for open method\n * @private\n */\nconst defaultOpenOptions = {\n host: 'localhost',\n port: 41234,\n exclusive: false,\n}\n\n/**\n * Default options for send method\n * @private\n */\nconst defaultSendOptions = {\n host: 'localhost',\n port: 41235,\n}\n\n/**\n * Default options\n * @private\n */\nconst defaultOptions = {\n type: 'udp4',\n open: defaultOpenOptions,\n send: defaultSendOptions,\n}\n\n/**\n * OSC plugin for simple OSC messaging via udp client\n * and udp server\n */\nexport default class DatagramPlugin {\n /**\n * Create an OSC Plugin instance with given options. Defaults to\n * localhost:41234 for server and localhost:41235 for client messaging\n * @param {object} [options] Custom options\n * @param {string} [options.type='udp4'] 'udp4' or 'udp6'\n * @param {string} [options.open.host='localhost'] Hostname of udp server to bind to\n * @param {number} [options.open.port=41234] Port of udp server to bind to\n * @param {boolean} [options.open.exclusive=false] Exclusive flag\n * @param {string} [options.send.host='localhost'] Hostname of udp client for messaging\n * @param {number} [options.send.port=41235] Port of udp client for messaging\n *\n * @example\n * const plugin = new OSC.DatagramPlugin({ send: { port: 9912 } })\n * const osc = new OSC({ plugin: plugin })\n */\n constructor(customOptions = {}) {\n if (!dgram) {\n throw new Error('DatagramPlugin can not be used in browser context')\n }\n\n /**\n * @type {object} options\n * @private\n */\n this.options = Object.assign({}, defaultOptions, customOptions)\n\n /**\n * @type {object} socket\n * @private\n */\n this.socket = dgram.createSocket(this.options.type)\n /**\n * @type {number} socketStatus\n * @private\n */\n this.socketStatus = STATUS.IS_NOT_INITIALIZED\n\n // register events\n this.socket.on('message', (message) => {\n this.notify(message)\n })\n\n this.socket.on('error', (error) => {\n this.notify('error', error)\n })\n\n /**\n * @type {function} notify\n * @private\n */\n this.notify = () => {}\n }\n\n /**\n * Internal method to hook into osc library's\n * EventHandler notify method\n * @param {function} fn Notify callback\n * @private\n */\n registerNotify(fn) {\n this.notify = fn\n }\n\n /**\n * Returns the current status of the connection\n * @return {number} Status ID\n */\n status() {\n return this.socketStatus\n }\n\n /**\n * Bind a udp socket to a hostname and port\n * @param {object} [customOptions] Custom options\n * @param {string} [customOptions.host='localhost'] Hostname of udp server to bind to\n * @param {number} [customOptions.port=41234] Port of udp server to bind to\n * @param {boolean} [customOptions.exclusive=false] Exclusive flag\n */\n open(customOptions = {}) {\n const options = Object.assign({}, this.options.openOptions, customOptions)\n const { port, exclusive } = options\n\n this.socketStatus = STATUS.IS_CONNECTING\n\n this.socket.bind({\n address: options.host,\n port,\n exclusive,\n }, () => {\n this.socketStatus = STATUS.IS_OPEN\n this.notify('open')\n })\n }\n\n /**\n * Close udp socket\n */\n close() {\n this.socketStatus = STATUS.IS_CLOSING\n\n this.socket.close(() => {\n this.socketStatus = STATUS.IS_CLOSED\n this.notify('close')\n })\n }\n\n /**\n * Send an OSC Packet, Bundle or Message. Use options here for\n * custom port and hostname, otherwise the global options will\n * be taken\n * @param {Uint8Array} binary Binary representation of OSC Packet\n * @param {object} [customOptions] Custom options for udp socket\n * @param {string} [customOptions.host] Hostname of udp client\n * @param {number} [customOptions.port] Port of udp client\n */\n send(binary, customOptions = {}) {\n const options = Object.assign({}, this.options.sendOptions, customOptions)\n const { port, host } = options\n\n this.socket.send(new Buffer(binary), 0, binary.byteLength, port, host)\n }\n}\n","const dgram = typeof __dirname !== 'undefined' ? require('dgram') : undefined\nconst WebSocket = typeof __dirname !== 'undefined' ? require('ws').Server : undefined\n\n/**\n * Status flags\n * @private\n */\nconst STATUS = {\n IS_NOT_INITIALIZED: -1,\n IS_CONNECTING: 0,\n IS_OPEN: 1,\n IS_CLOSING: 2,\n IS_CLOSED: 3,\n}\n\n/**\n * Default options\n * @private\n */\nconst defaultOptions = {\n udpServer: {\n host: 'localhost',\n port: 41234,\n exclusive: false,\n },\n udpClient: {\n host: 'localhost',\n port: 41235,\n },\n wsServer: {\n host: 'localhost',\n port: 8080,\n },\n receiver: 'ws',\n}\n\n/**\n * Helper method to merge nested objects\n * @private\n */\nfunction mergeOptions(base, custom) {\n return Object.assign({}, defaultOptions, base, custom, {\n udpServer: Object.assign({}, defaultOptions.udpServer, base.udpServer, custom.udpServer),\n udpClient: Object.assign({}, defaultOptions.udpClient, base.udpClient, custom.udpClient),\n wsServer: Object.assign({}, defaultOptions.wsServer, base.wsServer, custom.wsServer),\n })\n}\n\n/**\n * OSC plugin for setting up communication between a Websocket\n * client and a udp client with a bridge inbetween\n */\nexport default class BridgePlugin {\n /**\n * Create an OSC Bridge instance with given options. Defaults to\n * localhost:41234 for udp server, localhost:41235 for udp client and\n * localhost:8080 for Websocket server\n * @param {object} [options] Custom options\n * @param {string} [options.udpServer.host='localhost'] Hostname of udp server to bind to\n * @param {number} [options.udpServer.port=41234] Port of udp server to bind to\n * @param {boolean} [options.udpServer.exclusive=false] Exclusive flag\n * @param {string} [options.udpClient.host='localhost'] Hostname of udp client for messaging\n * @param {number} [options.udpClient.port=41235] Port of udp client for messaging\n * @param {string} [options.wsServer.host='localhost'] Hostname of Websocket server\n * @param {number} [options.wsServer.port=8080] Port of Websocket server\n * @param {string} [options.receiver='ws'] Where messages sent via 'send' method will be\n * delivered to, 'ws' for Websocket clients, 'udp' for udp client\n *\n * @example\n * const plugin = new OSC.BridgePlugin({ wsServer: { port: 9912 } })\n * const osc = new OSC({ plugin: plugin })\n */\n constructor(customOptions = {}) {\n if (!dgram || !WebSocket) {\n throw new Error('BridgePlugin can not be used in browser context')\n }\n\n /** @type {object} options\n * @private\n */\n this.options = mergeOptions({}, customOptions)\n\n /**\n * @type {object} websocket\n * @private\n */\n this.websocket = null\n\n /**\n * @type {object} socket\n * @private\n */\n this.socket = dgram.createSocket('udp4')\n /**\n * @type {number} socketStatus\n * @private\n */\n this.socketStatus = STATUS.IS_NOT_INITIALIZED\n\n // register udp events\n this.socket.on('message', (message) => {\n this.send(message, { receiver: 'ws' })\n this.notify(message.buffer)\n })\n\n this.socket.on('error', (error) => {\n this.notify('error', error)\n })\n\n /**\n * @type {function} notify\n * @private\n */\n this.notify = () => {}\n }\n\n /**\n * Internal method to hook into osc library's\n * EventHandler notify method\n * @param {function} fn Notify callback\n * @private\n */\n registerNotify(fn) {\n this.notify = fn\n }\n\n /**\n * Returns the current status of the connection\n * @return {number} Status ID\n */\n status() {\n return this.socketStatus\n }\n\n /**\n * Bind a udp socket to a hostname and port\n * @param {object} [customOptions] Custom options\n * @param {string} [customOptions.host='localhost'] Hostname of udp server to bind to\n * @param {number} [customOptions.port=41234] Port of udp server to bind to\n * @param {boolean} [customOptions.exclusive=false] Exclusive flag\n */\n open(customOptions = {}) {\n const options = mergeOptions(this.options, customOptions)\n\n this.socketStatus = STATUS.IS_CONNECTING\n\n // bind udp server\n this.socket.bind({\n address: options.udpServer.host,\n port: options.udpServer.port,\n exclusive: options.udpServer.exclusive,\n }, () => {\n // bind Websocket server\n this.websocket = new WebSocket({ host: options.wsServer.host, port: options.wsServer.port })\n this.websocket.binaryType = 'arraybuffer'\n\n // register Websocket events\n this.websocket.on('error', (error) => {\n this.notify('error', error)\n })\n\n this.websocket.on('connection', (client) => {\n client.on('message', (message) => {\n this.send(message, { receiver: 'udp' })\n this.notify(new Uint8Array(message))\n })\n })\n\n this.notify('open')\n })\n }\n\n /**\n * Close udp socket and Websocket server\n */\n close() {\n this.socketStatus = STATUS.IS_CLOSING\n\n // close udp socket\n this.socket.close(() => {\n this.socketStatus = STATUS.IS_CLOSED\n this.notify('close')\n\n // close Websocket\n this.websocket.close()\n })\n }\n\n /**\n * Send an OSC Packet, Bundle or Message. Use options here for\n * custom receiver, otherwise the global options will be taken\n * @param {Uint8Array} binary Binary representation of OSC Packet\n * @param {object} [customOptions] Custom options\n * @param {string} [customOptions.udpClient.host='localhost'] Hostname of udp client for messaging\n * @param {number} [customOptions.udpClient.port=41235] Port of udp client for messaging\n * @param {string} [customOptions.receiver='ws'] Messages will be delivered to Websocket ('ws')\n * clients or udp client ('udp')\n */\n send(binary, customOptions = {}) {\n const options = mergeOptions(this.options, customOptions)\n const { receiver } = options\n\n if (receiver === 'udp') {\n // send data to udp client\n const data = binary instanceof Buffer ? binary : new Buffer(binary)\n this.socket.send(\n data,\n 0,\n data.byteLength,\n options.udpClient.port,\n options.udpClient.host,\n )\n } else if (receiver === 'ws') {\n // send data to all Websocket clients\n this.websocket.clients.forEach((client) => {\n client.send(binary, { binary: true })\n })\n } else {\n throw new Error('BridgePlugin can not send message to unknown receiver')\n }\n }\n}\n","// eslint-disable-next-line no-undef, no-use-before-define\nconst WebsocketClient = typeof __dirname === 'undefined' ? WebSocket : require('ws')\n\n/**\n * Status flags\n * @private\n */\nconst STATUS = {\n IS_NOT_INITIALIZED: -1,\n IS_CONNECTING: 0,\n IS_OPEN: 1,\n IS_CLOSING: 2,\n IS_CLOSED: 3,\n}\n\n/**\n * Default options\n * @private\n */\nconst defaultOptions = {\n host: 'localhost',\n port: 8080,\n}\n\n/**\n * OSC plugin for a Websocket client running in node or browser context\n */\nexport default class WebsocketClientPlugin {\n /**\n * Create an OSC WebsocketClientPlugin instance with given options.\n * Defaults to *localhost:8080* for connecting to a Websocket server\n * @param {object} [options] Custom options\n * @param {string} [options.host='localhost'] Hostname of Websocket server\n * @param {number} [options.port=8080] Port of Websocket server\n *\n * @example\n * const plugin = new OSC.WebsocketClientPlugin({ port: 9912 })\n * const osc = new OSC({ plugin: plugin })\n */\n constructor(customOptions) {\n if (!WebsocketClient) {\n throw new Error('WebsocketClientPlugin can\\'t find a WebSocket class')\n }\n\n /**\n * @type {object} options\n * @private\n */\n this.options = Object.assign({}, defaultOptions, customOptions)\n\n /**\n * @type {object} socket\n * @private\n */\n this.socket = null\n /**\n * @type {number} socketStatus\n * @private\n */\n this.socketStatus = STATUS.IS_NOT_INITIALIZED\n\n /**\n * @type {function} notify\n * @private\n */\n this.notify = () => {}\n }\n\n /**\n * Internal method to hook into osc library's\n * EventHandler notify method\n * @param {function} fn Notify callback\n * @private\n */\n registerNotify(fn) {\n this.notify = fn\n }\n\n /**\n * Returns the current status of the connection\n * @return {number} Status identifier\n */\n status() {\n return this.socketStatus\n }\n\n /**\n * Connect to a Websocket server. Defaults to global options\n * @param {object} [customOptions] Custom options\n * @param {string} [customOptions.host] Hostname of Websocket server\n * @param {number} [customOptions.port] Port of Websocket server\n */\n open(customOptions = {}) {\n const options = Object.assign({}, this.options, customOptions)\n const { port, host } = options\n\n // close socket when already given\n if (this.socket) {\n this.close()\n }\n\n // create websocket client\n this.socket = new WebsocketClient(`ws://${host}:${port}`)\n this.socket.binaryType = 'arraybuffer'\n this.socketStatus = STATUS.IS_CONNECTING\n\n // register events\n this.socket.onopen = () => {\n this.socketStatus = STATUS.IS_OPEN\n this.notify('open')\n }\n\n this.socket.onclose = () => {\n this.socketStatus = STATUS.IS_CLOSED\n this.notify('close')\n }\n\n this.socket.onerror = (error) => {\n this.notify('error', error)\n }\n\n this.socket.onmessage = (message) => {\n this.notify(message.data)\n }\n }\n\n /**\n * Close Websocket\n */\n close() {\n this.socketStatus = STATUS.IS_CLOSING\n this.socket.close()\n }\n\n /**\n * Send an OSC Packet, Bundle or Message to Websocket server\n * @param {Uint8Array} binary Binary representation of OSC Packet\n */\n send(binary) {\n this.socket.send(binary)\n }\n}\n","const WebsocketServer = typeof __dirname !== 'undefined' ? require('ws').Server : undefined\n\n/**\n * Status flags\n * @private\n */\nconst STATUS = {\n IS_NOT_INITIALIZED: -1,\n IS_CONNECTING: 0,\n IS_OPEN: 1,\n IS_CLOSING: 2,\n IS_CLOSED: 3,\n}\n\n/**\n * Default options\n * @private\n */\nconst defaultOptions = {\n host: 'localhost',\n port: 8080,\n}\n\n/**\n * OSC plugin for a Websocket client running in node or browser context\n */\nexport default class WebsocketServerPlugin {\n /**\n * Create an OSC WebsocketServerPlugin instance with given options.\n * Defaults to *localhost:8080* for the Websocket server\n * @param {object} [options] Custom options\n * @param {string} [options.host='localhost'] Hostname of Websocket server\n * @param {number} [options.port=8080] Port of Websocket server\n *\n * @example\n * const plugin = new OSC.WebsocketServerPlugin({ port: 9912 })\n * const osc = new OSC({ plugin: plugin })\n *\n * osc.open() // start server\n */\n constructor(customOptions) {\n if (!WebsocketServer) {\n throw new Error('WebsocketServerPlugin can not be used in browser context')\n }\n\n /**\n * @type {object} options\n * @private\n */\n this.options = Object.assign({}, defaultOptions, customOptions)\n\n /**\n * @type {object} socket\n * @private\n */\n this.socket = null\n /**\n * @type {number} socketStatus\n * @private\n */\n this.socketStatus = STATUS.IS_NOT_INITIALIZED\n\n /**\n * @type {function} notify\n * @private\n */\n this.notify = () => {}\n }\n\n /**\n * Internal method to hook into osc library's\n * EventHandler notify method\n * @param {function} fn Notify callback\n * @private\n */\n registerNotify(fn) {\n this.notify = fn\n }\n\n /**\n * Returns the current status of the connection\n * @return {number} Status identifier\n */\n status() {\n return this.socketStatus\n }\n\n /**\n * Start a Websocket server. Defaults to global options\n * @param {object} [customOptions] Custom options\n * @param {string} [customOptions.host] Hostname of Websocket server\n * @param {number} [customOptions.port] Port of Websocket server\n */\n open(customOptions = {}) {\n const options = Object.assign({}, this.options, customOptions)\n const { port, host } = options\n\n // close socket when already given\n if (this.socket) {\n this.close()\n }\n\n // create websocket server\n this.socket = new WebsocketServer({ host, port })\n this.socket.binaryType = 'arraybuffer'\n this.socketStatus = STATUS.IS_CONNECTING\n\n // register events\n this.socket.on('listening', () => {\n this.socketStatus = STATUS.IS_OPEN\n this.notify('open')\n })\n\n this.socket.on('error', (error) => {\n this.notify('error', error)\n })\n\n this.socket.on('connection', (client) => {\n client.on('message', (message) => {\n this.notify(new Uint8Array(message))\n })\n })\n }\n\n /**\n * Close Websocket server\n */\n close() {\n this.socketStatus = STATUS.IS_CLOSING\n this.socket.close(() => {\n this.socketStatus = STATUS.IS_CLOSED\n this.notify('close')\n })\n }\n\n /**\n * Send an OSC Packet, Bundle or Message to Websocket clients\n * @param {Uint8Array} binary Binary representation of OSC Packet\n */\n send(binary) {\n this.socket.clients.forEach((client) => {\n client.send(binary, { binary: true })\n })\n }\n}\n","import { isObject, isString, isFunction, isInt } from './common/utils'\n\nimport Packet from './packet'\nimport Bundle from './bundle'\nimport Message from './message'\n\nimport EventHandler from './events'\n\nimport DatagramPlugin from './plugin/dgram'\nimport BridgePlugin from './plugin/bridge'\nimport WebsocketClientPlugin from './plugin/wsclient'\nimport WebsocketServerPlugin from './plugin/wsserver'\n\n/**\n * Default options\n * @private\n */\nconst defaultOptions = {\n plugin: new WebsocketClientPlugin(),\n discardLateMessages: false,\n}\n\n/**\n * Status flags\n */\nconst STATUS = {\n IS_NOT_INITIALIZED: -1,\n IS_CONNECTING: 0,\n IS_OPEN: 1,\n IS_CLOSING: 2,\n IS_CLOSED: 3,\n}\n\n/**\n * OSC interface to send OSC Packets and to listen to status-changes and\n * incoming message events. Offers a Plugin API for different network\n * protocols, defaults to a simple Websocket client for OSC communication\n * between a browser js-app and a js-node server\n *\n * @example\n * const osc = new OSC()\n *\n * osc.on('/input/test', (message) => {\n * // print incoming OSC message arguments\n * console.log(message.args)\n * })\n *\n * osc.on('open', () => {\n * const message = new Message('/test/path', 55.12, 'hello')\n * osc.send(message)\n * })\n *\n * osc.open({ host: '192.168.178.115', port: 9012 })\n */\nclass OSC {\n /**\n * Create an OSC instance with given options\n * @param {object} [options] Custom options\n * @param {boolean} [options.discardLateMessages=false] Ignore incoming\n * messages when given timetag lies in the past\n * @param {Plugin} [options.plugin=WebsocketClientPlugin] Add a connection plugin\n * to this interface, defaults to a plugin with Websocket client.\n * Open README.md for further information on how to handle plugins or\n * how to write your own with the Plugin API\n *\n * @example\n * const osc = new OSC() // default options with Websocket client\n *\n * @example\n * const osc = new OSC({ discardLateMessages: true })\n *\n * @example\n * const websocketPlugin = new OSC.WebsocketClientPlugin()\n * const osc = new OSC({ plugin: websocketPlugin })\n */\n constructor(options) {\n if (options && !isObject(options)) {\n throw new Error('OSC options argument has to be an object.')\n }\n\n /**\n * @type {object} options\n * @private\n */\n this.options = Object.assign({}, defaultOptions, options)\n /**\n * @type {EventHandler} eventHandler\n * @private\n */\n this.eventHandler = new EventHandler({\n discardLateMessages: this.options.discardLateMessages,\n })\n\n // pass EventHandler's notify() to plugin\n const eventHandler = this.eventHandler\n if (this.options.plugin && this.options.plugin.registerNotify) {\n this.options.plugin.registerNotify((...args) =>\n eventHandler.notify(...args)\n )\n }\n }\n\n /**\n * Listen to a status-change event or incoming OSC message with\n * address pattern matching\n * @param {string} eventName Event name or OSC address pattern\n * @param {function} callback Function which is called on notification\n * @return {number} Subscription id (needed to unsubscribe)\n *\n * @example\n * // will be called when server receives /in!trument/* for example\n * osc.on('/instrument/1', (message) => {\n * console.log(message)\n * })\n *\n * @example\n * // will be called on network socket error\n * osc.on('error', (message) => {\n * console.log(message)\n * })\n */\n on(eventName, callback) {\n if (!(isString(eventName) && isFunction(callback))) {\n throw new Error('OSC on() needs event- or address string and callback function')\n }\n\n return this.eventHandler.on(eventName, callback)\n }\n\n /**\n * Unsubscribe an event listener\n * @param {string} eventName Event name or OSC address pattern\n * @param {number} subscriptionId The subscription id\n * @return {boolean} Success state\n *\n * @example\n * const listenerId = osc.on('error', (message) => {\n * console.log(message)\n * })\n * osc.off('error', listenerId) // unsubscribe from error event\n */\n off(eventName, subscriptionId) {\n if (!(isString(eventName) && isInt(subscriptionId))) {\n throw new Error('OSC off() needs string and number (subscriptionId) to unsubscribe')\n }\n\n return this.eventHandler.off(eventName, subscriptionId)\n }\n\n /**\n * Open network socket with plugin. This method is used by\n * plugins and is not available without (see Plugin API for more information)\n * @param {object} [options] Custom global options for plugin instance\n *\n * @example\n * const osc = new OSC({ plugin: new OSC.DatagramPlugin() })\n * osc.open({ host: '127.0.0.1', port: 8080 })\n */\n open(options) {\n if (options && !isObject(options)) {\n throw new Error('OSC open() options argument needs to be an object')\n }\n\n if (!(this.options.plugin && isFunction(this.options.plugin.open))) {\n throw new Error('OSC Plugin API #open is not implemented!')\n }\n\n return this.options.plugin.open(options)\n }\n\n /**\n * Returns the current status of the connection. See *STATUS* for\n * different possible states. This method is used by plugins\n * and is not available without (see Plugin API for more information)\n * @return {number} Status identifier\n *\n * @example\n * import OSC, { STATUS } from 'osc'\n * const osc = new OSC()\n * if (osc.status() === STATUS.IS_CONNECTING) {\n * // do something\n * }\n */\n status() {\n if (!(this.options.plugin && isFunction(this.options.plugin.status))) {\n throw new Error('OSC Plugin API #status is not implemented!')\n }\n\n return this.options.plugin.status()\n }\n\n /**\n * Close connection. This method is used by plugins and is not\n * available without (see Plugin API for more information)\n */\n close() {\n if (!(this.options.plugin && isFunction(this.options.plugin.close))) {\n throw new Error('OSC Plugin API #close is not implemented!')\n }\n\n return this.options.plugin.close()\n }\n\n /**\n * Send an OSC Packet, Bundle or Message. This method is used by plugins\n * and is not available without (see Plugin API for more information)\n * @param {Packet|Bundle|Message} packet OSC Packet, Bundle or Message instance\n * @param {object} [options] Custom options\n *\n * @example\n * const osc = new OSC({ plugin: new OSC.DatagramPlugin() })\n * osc.open({ host: '127.0.0.1', port: 8080 })\n *\n * const message = new OSC.Message('/test/path', 55.1, 57)\n * osc.send(message)\n *\n * // send message again to custom address\n * osc.send(message, { host: '192.168.178.115', port: 9001 })\n */\n send(packet, options) {\n if (!(this.options.plugin && isFunction(this.options.plugin.send))) {\n throw new Error('OSC Plugin API #send is not implemented!')\n }\n\n if (!(packet instanceof Message || packet instanceof Bundle || packet instanceof Packet)) {\n throw new Error('OSC send() needs Messages, Bundles or Packets')\n }\n\n if (options && !isObject(options)) {\n throw new Error('OSC send() options argument has to be an object')\n }\n\n return this.options.plugin.send(packet.pack(), options)\n }\n}\n\n// expose status flags\nOSC.STATUS = STATUS\n\n// expose OSC classes\nOSC.Packet = Packet\nOSC.Bundle = Bundle\nOSC.Message = Message\n\n// expose plugins\nOSC.DatagramPlugin = DatagramPlugin\nOSC.WebsocketClientPlugin = WebsocketClientPlugin\nOSC.WebsocketServerPlugin = WebsocketServerPlugin\nOSC.BridgePlugin = BridgePlugin\n\nexport default OSC\n"],"names":["isInt","n","Number","isFloat","isString","isArray","Object","prototype","toString","call","isObject","isFunction","isBlob","Uint8Array","isDate","Date","isUndefined","pad","dataView","obj","buffer","DataView","ArrayBuffer","typeTag","item","Error","prepareAddress","address","join","length","slice","prepareRegExPattern","str","pattern","replace","EncodeHelper","data","byteLength","pack","push","result","offset","forEach","set","Atomic","value","method","initialOffset","AtomicInt32","AtomicFloat32","AtomicString","terminated","i","charCodeAt","charcode","getUint8","String","fromCharCode","apply","AtomicBlob","setInt32","getInt32","Message","types","args","shift","map","encoder","Helper","add","argument","merge","unpack","next","type","SECONDS_70_YEARS","TWO_POWER_32","Timetag","seconds","fractions","milliseconds","rounded","Math","floor","round","AtomicTimetag","now","timetag","timestamp","getTime","getUint32","BUNDLE_TAG","Bundle","bundleElements","ms","head","packet","Packet","size","defaultOptions","EventHandler","options","assign","addressHandlers","eventHandlers","uuid","bundle","bundleItem","dispatch","message","notify","name","success","handler","callback","handlerKeys","keys","handlers","key","regex","RegExp","test","lastIndex","discardLateMessages","that","split","subscriptionId","haystack","some","index","id","splice","dgram","__dirname","require","undefined","STATUS","defaultOpenOptions","defaultSendOptions","DatagramPlugin","customOptions","socket","createSocket","socketStatus","IS_NOT_INITIALIZED","on","error","fn","openOptions","port","exclusive","IS_CONNECTING","bind","host","IS_OPEN","IS_CLOSING","close","IS_CLOSED","binary","sendOptions","send","Buffer","WebSocket","Server","mergeOptions","base","custom","udpServer","udpClient","wsServer","BridgePlugin","websocket","receiver","binaryType","client","clients","WebsocketClient","WebsocketClientPlugin","onopen","onclose","onerror","onmessage","WebsocketServer","WebsocketServerPlugin","OSC","eventHandler","plugin","registerNotify","eventName","off","open","status"],"mappings":";;;;;;AAKO,SAASA,KAAT,CAAeC,CAAf,EAAkB;SAChBC,OAAOD,CAAP,MAAcA,CAAd,IAAmBA,IAAI,CAAJ,KAAU,CAApC;;AAQF,AAAO,SAASE,OAAT,CAAiBF,CAAjB,EAAoB;SAClBC,OAAOD,CAAP,MAAcA,CAAd,IAAmBA,IAAI,CAAJ,KAAU,CAApC;;AAQF,AAAO,SAASG,QAAT,CAAkBH,CAAlB,EAAqB;SACnB,OAAOA,CAAP,KAAa,QAApB;;AAQF,AAAO,SAASI,OAAT,CAAiBJ,CAAjB,EAAoB;SAClBK,OAAOC,SAAP,CAAiBC,QAAjB,CAA0BC,IAA1B,CAA+BR,CAA/B,MAAsC,gBAA7C;;AAQF,AAAO,SAASS,QAAT,CAAkBT,CAAlB,EAAqB;SACnBK,OAAOC,SAAP,CAAiBC,QAAjB,CAA0BC,IAA1B,CAA+BR,CAA/B,MAAsC,iBAA7C;;AAQF,AAAO,SAASU,UAAT,CAA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;;;;4BAOM;UACF,EAAE,KAAK1F,OAAL,CAAaqF,MAAb,IAAuB/K,WAAW,KAAK0F,OAAL,CAAaqF,MAAb,CAAoB9B,KAA/B,CAAzB,CAAJ,EAAqE;cAC7D,IAAInI,KAAJ,CAAU,2CAAV,CAAN;;aAGK,KAAK4E,OAAL,CAAaqF,MAAb,CAAoB9B,KAApB,EAAP;;;;yBAmBG5D,QAAQK,SAAS;UAChB,EAAE,KAAKA,OAAL,CAAaqF,MAAb,IAAuB/K,WAAW,KAAK0F,OAAL,CAAaqF,MAAb,CAAoB1B,IAA/B,CAAzB,CAAJ,EAAoE;cAC5D,IAAIvI,KAAJ,CAAU,0CAAV,CAAN;;UAGE,EAAEuE,kBAAkBlC,OAAlB,IAA6BkC,kBAAkBJ,MAA/C,IAAyDI,kBAAkBC,MAA7E,CAAJ,EAA0F;cAClF,IAAIxE,KAAJ,CAAU,+CAAV,CAAN;;UAGE4E,WAAW,CAAC3F,SAAS2F,OAAT,CAAhB,EAAmC;cAC3B,IAAI5E,KAAJ,CAAU,iDAAV,CAAN;;aAGK,KAAK4E,OAAL,CAAaqF,MAAb,CAAoB1B,IAApB,CAAyBhE,OAAO1D,IAAP,EAAzB,EAAwC+D,OAAxC,CAAP;;;;;AAKJmF,IAAIhD,MAAJ,GAAaA,MAAb;AAGAgD,IAAIvF,MAAJ,GAAaA,MAAb;AACAuF,IAAI5F,MAAJ,GAAaA,MAAb;AACA4F,IAAI1H,OAAJ,GAAcA,OAAd;AAGA0H,IAAI7C,cAAJ,GAAqBA,cAArB;AACA6C,IAAIP,qBAAJ,GAA4BA,qBAA5B;AACAO,IAAID,qBAAJ,GAA4BA,qBAA5B;AACAC,IAAId,YAAJ,GAAmBA,YAAnB,CAEA;;;;"} \ No newline at end of file diff --git a/dist/osc.min.js b/dist/osc.min.js index 41272c3..edd9d01 100644 --- a/dist/osc.min.js +++ b/dist/osc.min.js @@ -1 +1 @@ -!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e():"function"==typeof define&&define.amd?define(e):t.OSC=e()}(this,function(){"use strict";function t(t){return Number(t)===t&&t%1===0}function e(t){return Number(t)===t&&t%1!==0}function n(t){return"string"==typeof t}function r(t){return"[object Array]"===Object.prototype.toString.call(t)}function o(t){return"[object Object]"===Object.prototype.toString.call(t)}function i(t){return"function"==typeof t}function s(t){return t instanceof Uint8Array}function a(t){return t instanceof Date}function u(t){return"undefined"==typeof t}function c(t){return t+3&-4}function f(t){return t.buffer?new DataView(t.buffer):t instanceof ArrayBuffer?new DataView(t):new DataView(new Uint8Array(t))}function h(r){if(t(r))return"i";if(e(r))return"f";if(n(r))return"s";if(s(r))return"b";throw new Error("OSC typeTag() found unknown value type")}function l(t){var e="";if(r(t))return"/"+t.join("/");if(n(t))return e=t,e.length>1&&"/"===e[e.length-1]&&(e=e.slice(0,e.length-1)),e.length>1&&"/"!==e[0]&&(e="/"+e),e;throw new Error("OSC prepareAddress() needs addresses of type array or string")}function p(t){var e=void 0;if(!n(t))throw new Error("OSC prepareRegExPattern() needs strings");return e=t.replace(/\./g,"\\."),e=e.replace(/\(/g,"\\("),e=e.replace(/\)/g,"\\)"),e=e.replace(/\{/g,"("),e=e.replace(/\}/g,")"),e=e.replace(/,/g,"|"),e=e.replace(/\[!/g,"[^"),e=e.replace(/\?/g,"."),e=e.replace(/\*/g,".*")}function d(t,e){return Object.assign({},R,t,e,{udpServer:Object.assign({},R.udpServer,t.udpServer,e.udpServer),udpClient:Object.assign({},R.udpClient,t.udpClient,e.udpClient),wsServer:Object.assign({},R.wsServer,t.wsServer,e.wsServer)})}var v="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},w=function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")},y=function(){function t(t,e){for(var n=0;n3&&void 0!==arguments[3]?arguments[3]:0;if(!(t&&e&&n))throw new Error("OSC Atomic cant't be unpacked without given dataView, method or byteLength");if(!(t instanceof DataView))throw new Error("OSC Atomic expects an instance of type DataView");return this.value=t[e](r,!1),this.offset=r+n,this.offset}}]),t}(),m=function(e){function n(e){if(w(this,n),e&&!t(e))throw new Error("OSC AtomicInt32 constructor expects value of type number");return S(this,(n.__proto__||Object.getPrototypeOf(n)).call(this,e))}return k(n,e),y(n,[{key:"pack",value:function(){return g(n.prototype.__proto__||Object.getPrototypeOf(n.prototype),"pack",this).call(this,"setInt32",4)}},{key:"unpack",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return g(n.prototype.__proto__||Object.getPrototypeOf(n.prototype),"unpack",this).call(this,t,"getInt32",4,e)}}]),n}(O),E=function(t){function n(t){if(w(this,n),t&&!e(t))throw new Error("OSC AtomicFloat32 constructor expects value of type float");return S(this,(n.__proto__||Object.getPrototypeOf(n)).call(this,t))}return k(n,t),y(n,[{key:"pack",value:function(){return g(n.prototype.__proto__||Object.getPrototypeOf(n.prototype),"pack",this).call(this,"setFloat32",4)}},{key:"unpack",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return g(n.prototype.__proto__||Object.getPrototypeOf(n.prototype),"unpack",this).call(this,t,"getFloat32",4,e)}}]),n}(O),I=function(t){function e(t){if(w(this,e),t&&!n(t))throw new Error("OSC AtomicString constructor expects value of type string");return S(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,t))}return k(e,t),y(e,[{key:"pack",value:function(){if(u(this.value))throw new Error("OSC AtomicString can not be encoded with empty value");for(var t=this.value+"\0",e=c(t.length),n=new Uint8Array(e),r=0;r1&&void 0!==arguments[1]?arguments[1]:0;if(!(t instanceof DataView))throw new Error("OSC AtomicString expects an instance of type DataView");for(var n=e,r=void 0,o=[];n1&&void 0!==arguments[1]?arguments[1]:0;if(!(t instanceof DataView))throw new Error("OSC AtomicBlob expects an instance of type DataView");var n=t.getInt32(e,!1);return this.value=new Uint8Array(t.buffer,e+4,n),this.offset=c(e+4+n),this.offset}}]),e}(O),_=function(){function o(){w(this,o),this.offset=0,this.address="",this.types="",this.args=[];for(var t=arguments.length,e=Array(t),i=0;i0){if(!n(e[0])&&!r(e[0]))throw new Error("OSC Message constructor first argument (address) must be a string or array");this.address=l(e.shift()),this.types=e.map(function(t){return h(t)}).join(""),this.args=e}}return y(o,[{key:"add",value:function(t){if(!t)throw new Error("OSC Message needs a valid OSC Atomic Data Type");this.args.push(t),this.types+=h(t)}},{key:"pack",value:function(){var r=this;if(0===this.address.length||"/"!==this.address[0])throw new Error("OSC Message has an invalid address");var o=new b;return o.add(new I(this.address)),o.add(new I(","+this.types)),this.args.length>0&&!function(){var i=void 0;r.args.forEach(function(r){if(t(r))i=new m(r);else if(e(r))i=new E(r);else if(n(r))i=new I(r);else{if(!s(r))throw new Error("OSC Message found unknown argument type");i=new C(r)}o.add(i)})}(),o.merge()}},{key:"unpack",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;if(!(t instanceof DataView))throw new Error("OSC Message expects an instance of type DataView.");var n=new I;n.unpack(t,e);var r=new I;if(r.unpack(t,n.offset),0===n.value.length||"/"!==n.value[0])throw new Error("OSC Message found malformed or missing address string");if(0===r.value.length&&","!==r.value[0])throw new Error("OSC Message found malformed or missing type string");for(var o=r.offset,i=void 0,s=void 0,a=[],u=1;u0&&void 0!==arguments[0]?arguments[0]:0,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;if(w(this,e),!t(n)||!t(r))throw new Error("OSC Timetag constructor expects values of type integer number");this.seconds=n,this.fractions=r}return y(e,[{key:"timestamp",value:function(t){var e=void 0;if("number"==typeof t){e=t/1e3;var n=Math.floor(e);return this.seconds=n+N,this.fractions=Math.round(P*(e-n)),t}return e=this.seconds-N,1e3*(e+this.fractions/P)}}]),e}(),A=function(e){function n(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:Date.now();w(this,n);var r=new D;return e instanceof D?r=e:t(e)?r.timestamp(e):a(e)&&r.timestamp(e.getTime()),S(this,(n.__proto__||Object.getPrototypeOf(n)).call(this,r))}return k(n,e),y(n,[{key:"pack",value:function(){if(u(this.value))throw new Error("OSC AtomicTimetag can not be encoded with empty value");var t=this.value,e=t.seconds,n=t.fractions,r=new Uint8Array(8),o=new DataView(r.buffer);return o.setInt32(0,e,!1),o.setInt32(4,n,!1),r}},{key:"unpack",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;if(!(t instanceof DataView))throw new Error("OSC AtomicTimetag expects an instance of type DataView");var n=t.getUint32(e,!1),r=t.getUint32(e+4,!1);return this.value=new D(n,r),this.offset=e+8,this.offset}}]),n}(O),L="#bundle",j=function(){function e(){var n=this;w(this,e),this.offset=0,this.timetag=new A,this.bundleElements=[];for(var o=arguments.length,i=Array(o),s=0;s0&&(i[0]instanceof Date||t(i[0])?this.timetag=new A(i[0]):r(i[0])?(i[0].forEach(function(t){n.add(t)}),i.length>1&&(i[1]instanceof Date||t(i[0]))&&(this.timetag=new A(i[1]))):i.forEach(function(t){n.add(t)}))}return y(e,[{key:"timestamp",value:function(e){if(!t(e))throw new Error("OSC Bundle needs an integer for setting the timestamp");this.timetag=new A(e)}},{key:"add",value:function(t){if(!(t instanceof _||t instanceof e))throw new Error("OSC Bundle contains only Messages and Bundles");this.bundleElements.push(t)}},{key:"pack",value:function(){var t=new b;return t.add(new I(L)),this.timetag||(this.timetag=new A),t.add(this.timetag),this.bundleElements.forEach(function(e){t.add(new m(e.pack().byteLength)),t.add(e)}),t.merge()}},{key:"unpack",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;if(!(t instanceof DataView))throw new Error("OSC Bundle expects an instance of type DataView");var n=new I;if(n.unpack(t,e),n.value!==L)throw new Error("OSC Bundle does not contain a valid #bundle head");var r=new A,o=r.unpack(t,n.offset);for(this.bundleElements=[];o1&&void 0!==arguments[1]?arguments[1]:0;if(!(t instanceof DataView))throw new Error("OSC Packet expects an instance of type DataView");if(t.byteLength%4!==0)throw new Error("OSC Packet byteLength has to be a multiple of four");var n=new I;n.unpack(t,e);var r=void 0;return r=n.value===L?new j:new _,r.unpack(t,e),this.offset=r.offset,this.value=r,this.offset}}]),t}(),H={discardLateMessages:!1},x=function(){function e(t){w(this,e),this.options=Object.assign({},H,t),this.addressHandlers=[],this.eventHandlers={open:[],error:[],close:[]},this.uuid=0}return y(e,[{key:"dispatch",value:function(t){var e=this;if(!(t instanceof T))throw new Error("OSC EventHander dispatch() accepts only arguments of type Packet");if(!t.value)throw new Error("OSC EventHander dispatch() can't read empty Packets");if(t.value instanceof j){var n=function(){var n=t.value;return{v:n.bundleElements.forEach(function(r){if(t.value instanceof j){if(n.timetag.value.timestamp()1&&(u=o[1]);var c=null;if(o.length>2)if(t(o[2]))c=o[2];else{if(!(o[2]instanceof Date))throw new Error("OSC EventHandler timestamp has to be a number or Date");c=o[2].getTime()}if(c){var h=function(){var t=Date.now();if(t>c&&!e.options.discardLateMessages)return{v:e.call(a,u)};var n=e;return setTimeout(function(){n.call(a,u)},c-t),{v:!0}}();if("object"===("undefined"==typeof h?"undefined":v(h)))return h.v}return this.call(a,u)}},{key:"on",value:function(t,e){if(!n(t)&&!r(t))throw new Error("OSC EventHandler accepts only strings or arrays for address patterns");if(!i(e))throw new Error("OSC EventHandler callback has to be a function");this.uuid+=1;var o={id:this.uuid,callback:e};if(n(t)&&t in this.eventHandlers)return this.eventHandlers[t].push(o),this.uuid;var s=l(t),a=new RegExp(/[#*\s[\],\/{}|?]/g);if(a.test(s.split("/").join("")))throw new Error("OSC EventHandler address string contains invalid characters");return s in this.addressHandlers||(this.addressHandlers[s]=[]),this.addressHandlers[s].push(o),this.uuid}},{key:"off",value:function(e,o){if(!n(e)&&!r(e))throw new Error("OSC EventHandler accepts only strings or arrays for address patterns");if(!t(o))throw new Error("OSC EventHandler subscription id has to be a number");var i=void 0,s=void 0;return n(e)&&e in this.eventHandlers?(i=e,s=this.eventHandlers):(i=l(e),s=this.addressHandlers),i in s&&s[i].some(function(t,e){return t.id===o&&(s[i].splice(e,1),!0)})}}]),e}(),V="undefined"!=typeof __dirname?require("dgram"):void 0,B={IS_NOT_INITIALIZED:-1,IS_CONNECTING:0,IS_OPEN:1,IS_CLOSING:2,IS_CLOSED:3},M={host:"localhost",port:41234,exclusive:!1},G={host:"localhost",port:41235},U={type:"udp4",open:M,send:G},Z=function(){function t(){var e=this,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(w(this,t),!V)throw new Error("DatagramPlugin can not be used in browser context");this.options=Object.assign({},U,n),this.socket=V.createSocket(this.options.type),this.socketStatus=B.IS_NOT_INITIALIZED,this.socket.on("message",function(t){e.notify(t)}),this.socket.on("error",function(t){e.notify("error",t)}),this.notify=function(){}}return y(t,[{key:"registerNotify",value:function(t){this.notify=t}},{key:"status",value:function(){return this.socketStatus}},{key:"open",value:function(){var t=this,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=Object.assign({},this.options.openOptions,e),r=n.port,o=n.exclusive;this.socketStatus=B.IS_CONNECTING,this.socket.bind({address:n.host,port:r,exclusive:o},function(){t.socketStatus=B.IS_OPEN,t.notify("open")})}},{key:"close",value:function(){var t=this;this.socketStatus=B.IS_CLOSING,this.socket.close(function(){t.socketStatus=B.IS_CLOSED,t.notify("close")})}},{key:"send",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=Object.assign({},this.options.sendOptions,e),r=n.port,o=n.host;this.socket.send(new Buffer(t),0,t.byteLength,r,o)}}]),t}(),W="undefined"!=typeof __dirname?require("dgram"):void 0,q="undefined"!=typeof __dirname?require("ws").Server:void 0,F={IS_NOT_INITIALIZED:-1,IS_CONNECTING:0,IS_OPEN:1,IS_CLOSING:2,IS_CLOSED:3},R={udpServer:{host:"localhost",port:41234,exclusive:!1},udpClient:{host:"localhost",port:41235},wsServer:{host:"localhost",port:8080},receiver:"ws"},z=function(){function t(){var e=this,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(w(this,t),!W||!q)throw new Error("BridgePlugin can not be used in browser context");this.options=d({},n),this.websocket=null,this.socket=W.createSocket("udp4"),this.socketStatus=F.IS_NOT_INITIALIZED,this.socket.on("message",function(t){e.send(t,{receiver:"ws"}),e.notify(t.buffer)}),this.socket.on("error",function(t){e.notify("error",t)}),this.notify=function(){}}return y(t,[{key:"registerNotify",value:function(t){this.notify=t}},{key:"status",value:function(){return this.socketStatus}},{key:"open",value:function(){var t=this,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=d(this.options,e);this.socketStatus=F.IS_CONNECTING,this.socket.bind({address:n.udpServer.host,port:n.udpServer.port,exclusive:n.udpServer.exclusive},function(){t.websocket=new q({host:n.wsServer.host,port:n.wsServer.port}),t.websocket.binaryType="arraybuffer",t.websocket.on("error",function(e){t.notify("error",e)}),t.websocket.on("connection",function(e){e.on("message",function(e){t.send(e,{receiver:"udp"}),t.notify(new Uint8Array(e))})}),t.notify("open")})}},{key:"close",value:function(){var t=this;this.socketStatus=F.IS_CLOSING,this.socket.close(function(){t.socketStatus=F.IS_CLOSED,t.notify("close"),t.websocket.close()})}},{key:"send",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=d(this.options,e),r=n.receiver;if("udp"===r){var o=t instanceof Buffer?t:new Buffer(t);this.socket.send(o,0,o.byteLength,n.udpClient.port,n.udpClient.host)}else{if("ws"!==r)throw new Error("BridgePlugin can not send message to unknown receiver");this.websocket.clients.forEach(function(e){e.send(t,{binary:!0})})}}}]),t}(),J="undefined"==typeof __dirname?WebSocket:require("ws"),K={IS_NOT_INITIALIZED:-1,IS_CONNECTING:0,IS_OPEN:1,IS_CLOSING:2,IS_CLOSED:3},Q={host:"localhost",port:8080},X=function(){function t(e){if(w(this,t),!J)throw new Error("WebsocketClientPlugin can't find a WebSocket class");this.options=Object.assign({},Q,e),this.socket=null,this.socketStatus=K.IS_NOT_INITIALIZED,this.notify=function(){}}return y(t,[{key:"registerNotify",value:function(t){this.notify=t}},{key:"status",value:function(){return this.socketStatus}},{key:"open",value:function(){var t=this,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=Object.assign({},this.options,e),r=n.port,o=n.host;this.socket&&this.close(),this.socket=new J("ws://"+o+":"+r),this.socket.binaryType="arraybuffer",this.socketStatus=K.IS_CONNECTING,this.socket.onopen=function(){t.socketStatus=K.IS_OPEN,t.notify("open")},this.socket.onclose=function(){t.socketStatus=K.IS_CLOSED,t.notify("close")},this.socket.onerror=function(e){t.notify("error",e)},this.socket.onmessage=function(e){t.notify(e.data)}}},{key:"close",value:function(){this.socketStatus=K.IS_CLOSING,this.socket.close()}},{key:"send",value:function(t){this.socket.send(t)}}]),t}(),Y="undefined"!=typeof __dirname?require("ws").Server:void 0,$={IS_NOT_INITIALIZED:-1,IS_CONNECTING:0,IS_OPEN:1,IS_CLOSING:2,IS_CLOSED:3},tt={host:"localhost",port:8080},et=function(){function t(e){if(w(this,t),!Y)throw new Error("WebsocketServerPlugin can not be used in browser context");this.options=Object.assign({},tt,e),this.socket=null,this.socketStatus=$.IS_NOT_INITIALIZED,this.notify=function(){}}return y(t,[{key:"registerNotify",value:function(t){this.notify=t}},{key:"status",value:function(){return this.socketStatus}},{key:"open",value:function(){var t=this,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=Object.assign({},this.options,e),r=n.port,o=n.host;this.socket&&this.close(),this.socket=new Y({host:o,port:r}),this.socket.binaryType="arraybuffer",this.socketStatus=$.IS_CONNECTING,this.socket.on("open",function(){t.socketStatus=$.IS_OPEN,t.notify("open")}),this.socket.on("close",function(){t.socketStatus=$.IS_CLOSED,t.notify("close")}),this.socket.on("error",function(e){t.notify("error",e)}),this.socket.on("connection",function(e){e.on("message",function(e){t.notify(new Uint8Array(e))})})}},{key:"close",value:function(){this.socketStatus=$.IS_CLOSING,this.socket.close()}},{key:"send",value:function(t){this.socket.clients.forEach(function(e){e.send(t,{binary:!0})})}}]),t}(),nt={plugin:new X,discardLateMessages:!1},rt={IS_NOT_INITIALIZED:-1,IS_CONNECTING:0,IS_OPEN:1,IS_CLOSING:2,IS_CLOSED:3},ot=function(){function e(t){if(w(this,e),t&&!o(t))throw new Error("OSC options argument has to be an object.");this.options=Object.assign({},nt,t),this.eventHandler=new x({discardLateMessages:this.options.discardLateMessages});var n=this.eventHandler;this.options.plugin&&this.options.plugin.registerNotify&&this.options.plugin.registerNotify(function(){return n.notify.apply(n,arguments)})}return y(e,[{key:"on",value:function(t,e){if(!n(t)||!i(e))throw new Error("OSC on() needs event- or address string and callback function");return this.eventHandler.on(t,e)}},{key:"off",value:function(e,r){if(!n(e)||!t(r))throw new Error("OSC off() needs string and number (subscriptionId) to unsubscribe");return this.eventHandler.off(e,r)}},{key:"open",value:function(t){if(t&&!o(t))throw new Error("OSC open() options argument needs to be an object");if(!this.options.plugin||!i(this.options.plugin.open))throw new Error("OSC Plugin API #open is not implemented!");return this.options.plugin.open(t)}},{key:"status",value:function(){if(!this.options.plugin||!i(this.options.plugin.status))throw new Error("OSC Plugin API #status is not implemented!");return this.options.plugin.status()}},{key:"close",value:function(){if(!this.options.plugin||!i(this.options.plugin.close))throw new Error("OSC Plugin API #close is not implemented!");return this.options.plugin.close()}},{key:"send",value:function(t,e){if(!this.options.plugin||!i(this.options.plugin.send))throw new Error("OSC Plugin API #send is not implemented!");if(!(t instanceof _||t instanceof j||t instanceof T))throw new Error("OSC send() needs Messages, Bundles or Packets");if(e&&!o(e))throw new Error("OSC send() options argument has to be an object");return this.options.plugin.send(t.pack(),e)}}]),e}();return ot.STATUS=rt,ot.Packet=T,ot.Bundle=j,ot.Message=_,ot.DatagramPlugin=Z,ot.WebsocketClientPlugin=X,ot.WebsocketServerPlugin=et,ot.BridgePlugin=z,ot}); +!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e():"function"==typeof define&&define.amd?define(e):t.OSC=e()}(this,function(){"use strict";function t(t){return Number(t)===t&&t%1==0}function e(t){return Number(t)===t&&t%1!=0}function n(t){return"string"==typeof t}function r(t){return"[object Array]"===Object.prototype.toString.call(t)}function o(t){return"[object Object]"===Object.prototype.toString.call(t)}function i(t){return"function"==typeof t}function s(t){return t instanceof Uint8Array}function a(t){return t instanceof Date}function u(t){return void 0===t}function c(t){return t+3&-4}function f(t){return t.buffer?new DataView(t.buffer):t instanceof ArrayBuffer?new DataView(t):new DataView(new Uint8Array(t))}function h(r){if(t(r))return"i";if(e(r))return"f";if(n(r))return"s";if(s(r))return"b";throw new Error("OSC typeTag() found unknown value type")}function l(t){var e="";if(r(t))return"/"+t.join("/");if(n(t))return e=t,e.length>1&&"/"===e[e.length-1]&&(e=e.slice(0,e.length-1)),e.length>1&&"/"!==e[0]&&(e="/"+e),e;throw new Error("OSC prepareAddress() needs addresses of type array or string")}function d(t){var e=void 0;if(!n(t))throw new Error("OSC prepareRegExPattern() needs strings");return e=t.replace(/\./g,"\\."),e=e.replace(/\(/g,"\\("),e=e.replace(/\)/g,"\\)"),e=e.replace(/\{/g,"("),e=e.replace(/\}/g,")"),e=e.replace(/,/g,"|"),e=e.replace(/\[!/g,"[^"),e=e.replace(/\?/g,"."),e=e.replace(/\*/g,".*")}function p(t,e){return Object.assign({},Z,t,e,{udpServer:Object.assign({},Z.udpServer,t.udpServer,e.udpServer),udpClient:Object.assign({},Z.udpClient,t.udpClient,e.udpClient),wsServer:Object.assign({},Z.wsServer,t.wsServer,e.wsServer)})}var v=function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")},w=function(){function t(t,e){for(var n=0;n3&&void 0!==arguments[3]?arguments[3]:0;if(!(t&&e&&n))throw new Error("OSC Atomic cant't be unpacked without given dataView, method or byteLength");if(!(t instanceof DataView))throw new Error("OSC Atomic expects an instance of type DataView");return this.value=t[e](r,!1),this.offset=r+n,this.offset}}]),t}(),O=function(e){function n(e){if(v(this,n),e&&!t(e))throw new Error("OSC AtomicInt32 constructor expects value of type number");return k(this,(n.__proto__||Object.getPrototypeOf(n)).call(this,e))}return y(n,e),w(n,[{key:"pack",value:function(){return g(n.prototype.__proto__||Object.getPrototypeOf(n.prototype),"pack",this).call(this,"setInt32",4)}},{key:"unpack",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return g(n.prototype.__proto__||Object.getPrototypeOf(n.prototype),"unpack",this).call(this,t,"getInt32",4,e)}}]),n}(b),m=function(t){function n(t){if(v(this,n),t&&!e(t))throw new Error("OSC AtomicFloat32 constructor expects value of type float");return k(this,(n.__proto__||Object.getPrototypeOf(n)).call(this,t))}return y(n,t),w(n,[{key:"pack",value:function(){return g(n.prototype.__proto__||Object.getPrototypeOf(n.prototype),"pack",this).call(this,"setFloat32",4)}},{key:"unpack",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return g(n.prototype.__proto__||Object.getPrototypeOf(n.prototype),"unpack",this).call(this,t,"getFloat32",4,e)}}]),n}(b),E=function(t){function e(t){if(v(this,e),t&&!n(t))throw new Error("OSC AtomicString constructor expects value of type string");return k(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,t))}return y(e,t),w(e,[{key:"pack",value:function(){if(u(this.value))throw new Error("OSC AtomicString can not be encoded with empty value");for(var t=this.value+"\0",e=c(t.length),n=new Uint8Array(e),r=0;r1&&void 0!==arguments[1]?arguments[1]:0;if(!(t instanceof DataView))throw new Error("OSC AtomicString expects an instance of type DataView");for(var n=e,r=void 0,o=[];n1&&void 0!==arguments[1]?arguments[1]:0;if(!(t instanceof DataView))throw new Error("OSC AtomicBlob expects an instance of type DataView");var n=t.getInt32(e,!1);return this.value=new Uint8Array(t.buffer,e+4,n),this.offset=c(e+4+n),this.offset}}]),e}(b),C=function(){function o(){v(this,o),this.offset=0,this.address="",this.types="",this.args=[];for(var t=arguments.length,e=Array(t),i=0;i0){if(!n(e[0])&&!r(e[0]))throw new Error("OSC Message constructor first argument (address) must be a string or array");this.address=l(e.shift()),this.types=e.map(function(t){return h(t)}).join(""),this.args=e}}return w(o,[{key:"add",value:function(t){if(!t)throw new Error("OSC Message needs a valid OSC Atomic Data Type");this.args.push(t),this.types+=h(t)}},{key:"pack",value:function(){if(0===this.address.length||"/"!==this.address[0])throw new Error("OSC Message has an invalid address");var r=new S;if(r.add(new E(this.address)),r.add(new E(","+this.types)),this.args.length>0){var o=void 0;this.args.forEach(function(i){if(t(i))o=new O(i);else if(e(i))o=new m(i);else if(n(i))o=new E(i);else{if(!s(i))throw new Error("OSC Message found unknown argument type");o=new I(i)}r.add(o)})}return r.merge()}},{key:"unpack",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;if(!(t instanceof DataView))throw new Error("OSC Message expects an instance of type DataView.");var n=new E;n.unpack(t,e);var r=new E;if(r.unpack(t,n.offset),0===n.value.length||"/"!==n.value[0])throw new Error("OSC Message found malformed or missing address string");if(0===r.value.length&&","!==r.value[0])throw new Error("OSC Message found malformed or missing type string");for(var o=r.offset,i=void 0,s=void 0,a=[],u=1;u0&&void 0!==arguments[0]?arguments[0]:0,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;if(v(this,e),!t(n)||!t(r))throw new Error("OSC Timetag constructor expects values of type integer number");this.seconds=n,this.fractions=r}return w(e,[{key:"timestamp",value:function(t){var e=void 0;if("number"==typeof t){e=t/1e3;var n=Math.floor(e);return this.seconds=n+2208988800,this.fractions=Math.round(4294967296*(e-n)),t}return 1e3*((e=this.seconds-2208988800)+this.fractions/4294967296)}}]),e}(),N=function(e){function n(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:Date.now();v(this,n);var r=new _;return e instanceof _?r=e:t(e)?r.timestamp(e):a(e)&&r.timestamp(e.getTime()),k(this,(n.__proto__||Object.getPrototypeOf(n)).call(this,r))}return y(n,e),w(n,[{key:"pack",value:function(){if(u(this.value))throw new Error("OSC AtomicTimetag can not be encoded with empty value");var t=this.value,e=t.seconds,n=t.fractions,r=new Uint8Array(8),o=new DataView(r.buffer);return o.setInt32(0,e,!1),o.setInt32(4,n,!1),r}},{key:"unpack",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;if(!(t instanceof DataView))throw new Error("OSC AtomicTimetag expects an instance of type DataView");var n=t.getUint32(e,!1),r=t.getUint32(e+4,!1);return this.value=new _(n,r),this.offset=e+8,this.offset}}]),n}(b),P=function(){function e(){var n=this;v(this,e),this.offset=0,this.timetag=new N,this.bundleElements=[];for(var o=arguments.length,i=Array(o),s=0;s0&&(i[0]instanceof Date||t(i[0])?this.timetag=new N(i[0]):r(i[0])?(i[0].forEach(function(t){n.add(t)}),i.length>1&&(i[1]instanceof Date||t(i[0]))&&(this.timetag=new N(i[1]))):i.forEach(function(t){n.add(t)}))}return w(e,[{key:"timestamp",value:function(e){if(!t(e))throw new Error("OSC Bundle needs an integer for setting the timestamp");this.timetag=new N(e)}},{key:"add",value:function(t){if(!(t instanceof C||t instanceof e))throw new Error("OSC Bundle contains only Messages and Bundles");this.bundleElements.push(t)}},{key:"pack",value:function(){var t=new S;return t.add(new E("#bundle")),this.timetag||(this.timetag=new N),t.add(this.timetag),this.bundleElements.forEach(function(e){t.add(new O(e.pack().byteLength)),t.add(e)}),t.merge()}},{key:"unpack",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;if(!(t instanceof DataView))throw new Error("OSC Bundle expects an instance of type DataView");var n=new E;if(n.unpack(t,e),"#bundle"!==n.value)throw new Error("OSC Bundle does not contain a valid #bundle head");var r=new N,o=r.unpack(t,n.offset);for(this.bundleElements=[];o1&&void 0!==arguments[1]?arguments[1]:0;if(!(t instanceof DataView))throw new Error("OSC Packet expects an instance of type DataView");if(t.byteLength%4!=0)throw new Error("OSC Packet byteLength has to be a multiple of four");var n=new E;n.unpack(t,e);var r=void 0;return r="#bundle"===n.value?new P:new C,r.unpack(t,e),this.offset=r.offset,this.value=r,this.offset}}]),t}(),A={discardLateMessages:!1},L=function(){function e(t){v(this,e),this.options=Object.assign({},A,t),this.addressHandlers=[],this.eventHandlers={open:[],error:[],close:[]},this.uuid=0}return w(e,[{key:"dispatch",value:function(t){var e=this;if(!(t instanceof D))throw new Error("OSC EventHander dispatch() accepts only arguments of type Packet");if(!t.value)throw new Error("OSC EventHander dispatch() can't read empty Packets");if(t.value instanceof P){var n=t.value;return n.bundleElements.forEach(function(r){if(t.value instanceof P){if(n.timetag.value.timestamp()1&&(a=r[1]);var u=null;if(r.length>2)if(t(r[2]))u=r[2];else{if(!(r[2]instanceof Date))throw new Error("OSC EventHandler timestamp has to be a number or Date");u=r[2].getTime()}if(u){var c=Date.now();if(c>u&&!this.options.discardLateMessages)return this.call(s,a);var h=this;return setTimeout(function(){h.call(s,a)},u-c),!0}return this.call(s,a)}},{key:"on",value:function(t,e){if(!n(t)&&!r(t))throw new Error("OSC EventHandler accepts only strings or arrays for address patterns");if(!i(e))throw new Error("OSC EventHandler callback has to be a function");this.uuid+=1;var o={id:this.uuid,callback:e};if(n(t)&&t in this.eventHandlers)return this.eventHandlers[t].push(o),this.uuid;var s=l(t);if(new RegExp(/[#*\s[\],\/{}|?]/g).test(s.split("/").join("")))throw new Error("OSC EventHandler address string contains invalid characters");return s in this.addressHandlers||(this.addressHandlers[s]=[]),this.addressHandlers[s].push(o),this.uuid}},{key:"off",value:function(e,o){if(!n(e)&&!r(e))throw new Error("OSC EventHandler accepts only strings or arrays for address patterns");if(!t(o))throw new Error("OSC EventHandler subscription id has to be a number");var i=void 0,s=void 0;return n(e)&&e in this.eventHandlers?(i=e,s=this.eventHandlers):(i=l(e),s=this.addressHandlers),i in s&&s[i].some(function(t,e){return t.id===o&&(s[i].splice(e,1),!0)})}}]),e}(),j="undefined"!=typeof __dirname?require("dgram"):void 0,T={IS_NOT_INITIALIZED:-1,IS_CONNECTING:0,IS_OPEN:1,IS_CLOSING:2,IS_CLOSED:3},H={host:"localhost",port:41234,exclusive:!1},x={host:"localhost",port:41235},V={type:"udp4",open:H,send:x},B=function(){function t(){var e=this,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(v(this,t),!j)throw new Error("DatagramPlugin can not be used in browser context");this.options=Object.assign({},V,n),this.socket=j.createSocket(this.options.type),this.socketStatus=T.IS_NOT_INITIALIZED,this.socket.on("message",function(t){e.notify(t)}),this.socket.on("error",function(t){e.notify("error",t)}),this.notify=function(){}}return w(t,[{key:"registerNotify",value:function(t){this.notify=t}},{key:"status",value:function(){return this.socketStatus}},{key:"open",value:function(){var t=this,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=Object.assign({},this.options.openOptions,e),r=n.port,o=n.exclusive;this.socketStatus=T.IS_CONNECTING,this.socket.bind({address:n.host,port:r,exclusive:o},function(){t.socketStatus=T.IS_OPEN,t.notify("open")})}},{key:"close",value:function(){var t=this;this.socketStatus=T.IS_CLOSING,this.socket.close(function(){t.socketStatus=T.IS_CLOSED,t.notify("close")})}},{key:"send",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=Object.assign({},this.options.sendOptions,e),r=n.port,o=n.host;this.socket.send(new Buffer(t),0,t.byteLength,r,o)}}]),t}(),M="undefined"!=typeof __dirname?require("dgram"):void 0,G="undefined"!=typeof __dirname?require("ws").Server:void 0,U={IS_NOT_INITIALIZED:-1,IS_CONNECTING:0,IS_OPEN:1,IS_CLOSING:2,IS_CLOSED:3},Z={udpServer:{host:"localhost",port:41234,exclusive:!1},udpClient:{host:"localhost",port:41235},wsServer:{host:"localhost",port:8080},receiver:"ws"},W=function(){function t(){var e=this,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(v(this,t),!M||!G)throw new Error("BridgePlugin can not be used in browser context");this.options=p({},n),this.websocket=null,this.socket=M.createSocket("udp4"),this.socketStatus=U.IS_NOT_INITIALIZED,this.socket.on("message",function(t){e.send(t,{receiver:"ws"}),e.notify(t.buffer)}),this.socket.on("error",function(t){e.notify("error",t)}),this.notify=function(){}}return w(t,[{key:"registerNotify",value:function(t){this.notify=t}},{key:"status",value:function(){return this.socketStatus}},{key:"open",value:function(){var t=this,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=p(this.options,e);this.socketStatus=U.IS_CONNECTING,this.socket.bind({address:n.udpServer.host,port:n.udpServer.port,exclusive:n.udpServer.exclusive},function(){t.websocket=new G({host:n.wsServer.host,port:n.wsServer.port}),t.websocket.binaryType="arraybuffer",t.websocket.on("error",function(e){t.notify("error",e)}),t.websocket.on("connection",function(e){e.on("message",function(e){t.send(e,{receiver:"udp"}),t.notify(new Uint8Array(e))})}),t.notify("open")})}},{key:"close",value:function(){var t=this;this.socketStatus=U.IS_CLOSING,this.socket.close(function(){t.socketStatus=U.IS_CLOSED,t.notify("close"),t.websocket.close()})}},{key:"send",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=p(this.options,e),r=n.receiver;if("udp"===r){var o=t instanceof Buffer?t:new Buffer(t);this.socket.send(o,0,o.byteLength,n.udpClient.port,n.udpClient.host)}else{if("ws"!==r)throw new Error("BridgePlugin can not send message to unknown receiver");this.websocket.clients.forEach(function(e){e.send(t,{binary:!0})})}}}]),t}(),q="undefined"==typeof __dirname?WebSocket:require("ws"),F={IS_NOT_INITIALIZED:-1,IS_CONNECTING:0,IS_OPEN:1,IS_CLOSING:2,IS_CLOSED:3},R={host:"localhost",port:8080},z=function(){function t(e){if(v(this,t),!q)throw new Error("WebsocketClientPlugin can't find a WebSocket class");this.options=Object.assign({},R,e),this.socket=null,this.socketStatus=F.IS_NOT_INITIALIZED,this.notify=function(){}}return w(t,[{key:"registerNotify",value:function(t){this.notify=t}},{key:"status",value:function(){return this.socketStatus}},{key:"open",value:function(){var t=this,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=Object.assign({},this.options,e),r=n.port,o=n.host;this.socket&&this.close(),this.socket=new q("ws://"+o+":"+r),this.socket.binaryType="arraybuffer",this.socketStatus=F.IS_CONNECTING,this.socket.onopen=function(){t.socketStatus=F.IS_OPEN,t.notify("open")},this.socket.onclose=function(){t.socketStatus=F.IS_CLOSED,t.notify("close")},this.socket.onerror=function(e){t.notify("error",e)},this.socket.onmessage=function(e){t.notify(e.data)}}},{key:"close",value:function(){this.socketStatus=F.IS_CLOSING,this.socket.close()}},{key:"send",value:function(t){this.socket.send(t)}}]),t}(),J="undefined"!=typeof __dirname?require("ws").Server:void 0,K={IS_NOT_INITIALIZED:-1,IS_CONNECTING:0,IS_OPEN:1,IS_CLOSING:2,IS_CLOSED:3},Q={host:"localhost",port:8080},X=function(){function t(e){if(v(this,t),!J)throw new Error("WebsocketServerPlugin can not be used in browser context");this.options=Object.assign({},Q,e),this.socket=null,this.socketStatus=K.IS_NOT_INITIALIZED,this.notify=function(){}}return w(t,[{key:"registerNotify",value:function(t){this.notify=t}},{key:"status",value:function(){return this.socketStatus}},{key:"open",value:function(){var t=this,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=Object.assign({},this.options,e),r=n.port,o=n.host;this.socket&&this.close(),this.socket=new J({host:o,port:r}),this.socket.binaryType="arraybuffer",this.socketStatus=K.IS_CONNECTING,this.socket.on("listening",function(){t.socketStatus=K.IS_OPEN,t.notify("open")}),this.socket.on("error",function(e){t.notify("error",e)}),this.socket.on("connection",function(e){e.on("message",function(e){t.notify(new Uint8Array(e))})})}},{key:"close",value:function(){var t=this;this.socketStatus=K.IS_CLOSING,this.socket.close(function(){t.socketStatus=K.IS_CLOSED,t.notify("close")})}},{key:"send",value:function(t){this.socket.clients.forEach(function(e){e.send(t,{binary:!0})})}}]),t}(),Y={plugin:new z,discardLateMessages:!1},$={IS_NOT_INITIALIZED:-1,IS_CONNECTING:0,IS_OPEN:1,IS_CLOSING:2,IS_CLOSED:3},tt=function(){function e(t){if(v(this,e),t&&!o(t))throw new Error("OSC options argument has to be an object.");this.options=Object.assign({},Y,t),this.eventHandler=new L({discardLateMessages:this.options.discardLateMessages});var n=this.eventHandler;this.options.plugin&&this.options.plugin.registerNotify&&this.options.plugin.registerNotify(function(){return n.notify.apply(n,arguments)})}return w(e,[{key:"on",value:function(t,e){if(!n(t)||!i(e))throw new Error("OSC on() needs event- or address string and callback function");return this.eventHandler.on(t,e)}},{key:"off",value:function(e,r){if(!n(e)||!t(r))throw new Error("OSC off() needs string and number (subscriptionId) to unsubscribe");return this.eventHandler.off(e,r)}},{key:"open",value:function(t){if(t&&!o(t))throw new Error("OSC open() options argument needs to be an object");if(!this.options.plugin||!i(this.options.plugin.open))throw new Error("OSC Plugin API #open is not implemented!");return this.options.plugin.open(t)}},{key:"status",value:function(){if(!this.options.plugin||!i(this.options.plugin.status))throw new Error("OSC Plugin API #status is not implemented!");return this.options.plugin.status()}},{key:"close",value:function(){if(!this.options.plugin||!i(this.options.plugin.close))throw new Error("OSC Plugin API #close is not implemented!");return this.options.plugin.close()}},{key:"send",value:function(t,e){if(!this.options.plugin||!i(this.options.plugin.send))throw new Error("OSC Plugin API #send is not implemented!");if(!(t instanceof C||t instanceof P||t instanceof D))throw new Error("OSC send() needs Messages, Bundles or Packets");if(e&&!o(e))throw new Error("OSC send() options argument has to be an object");return this.options.plugin.send(t.pack(),e)}}]),e}();return tt.STATUS=$,tt.Packet=D,tt.Bundle=P,tt.Message=C,tt.DatagramPlugin=B,tt.WebsocketClientPlugin=z,tt.WebsocketServerPlugin=X,tt.BridgePlugin=W,tt}); diff --git a/lib/osc.js b/lib/osc.js index 3bffe2e..970c49e 100644 --- a/lib/osc.js +++ b/lib/osc.js @@ -1,7 +1,7 @@ (function (global, factory) { - typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() : - typeof define === 'function' && define.amd ? define(factory) : - (global.OSC = factory()); + typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() : + typeof define === 'function' && define.amd ? define(factory) : + (global.OSC = factory()); }(this, (function () { 'use strict'; function isInt(n) { @@ -43,22 +43,6 @@ function dataView(obj) { return new DataView(new Uint8Array(obj)); } -var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { - return typeof obj; -} : function (obj) { - return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; -}; - - - - - - - - - - - var classCallCheck = function (instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); @@ -148,30 +132,6 @@ var possibleConstructorReturn = function (self, call) { return call && (typeof call === "object" || typeof call === "function") ? call : self; }; - - -var set = function set(object, property, value, receiver) { - var desc = Object.getOwnPropertyDescriptor(object, property); - - if (desc === undefined) { - var parent = Object.getPrototypeOf(object); - - if (parent !== null) { - set(parent, property, value, receiver); - } - } else if ("value" in desc && desc.writable) { - desc.value = value; - } else { - var setter = desc.set; - - if (setter !== undefined) { - setter.call(receiver, value); - } - } - - return value; -}; - function typeTag(item) { if (isInt(item)) { return 'i'; @@ -455,7 +415,6 @@ var Message = function () { }, { key: 'pack', value: function pack() { - var _this = this; if (this.address.length === 0 || this.address[0] !== '/') { throw new Error('OSC Message has an invalid address'); } @@ -463,23 +422,21 @@ var Message = function () { encoder.add(new AtomicString(this.address)); encoder.add(new AtomicString(',' + this.types)); if (this.args.length > 0) { - (function () { - var argument = void 0; - _this.args.forEach(function (value) { - if (isInt(value)) { - argument = new AtomicInt32(value); - } else if (isFloat(value)) { - argument = new AtomicFloat32(value); - } else if (isString(value)) { - argument = new AtomicString(value); - } else if (isBlob(value)) { - argument = new AtomicBlob(value); - } else { - throw new Error('OSC Message found unknown argument type'); - } - encoder.add(argument); - }); - })(); + var argument = void 0; + this.args.forEach(function (value) { + if (isInt(value)) { + argument = new AtomicInt32(value); + } else if (isFloat(value)) { + argument = new AtomicFloat32(value); + } else if (isString(value)) { + argument = new AtomicString(value); + } else if (isBlob(value)) { + argument = new AtomicBlob(value); + } else { + throw new Error('OSC Message found unknown argument type'); + } + encoder.add(argument); + }); } return encoder.merge(); } @@ -752,8 +709,7 @@ var EventHandler = function () { open: [], error: [], close: [] - }; - this.uuid = 0; + };this.uuid = 0; } createClass(EventHandler, [{ key: 'dispatch', @@ -766,24 +722,19 @@ var EventHandler = function () { throw new Error('OSC EventHander dispatch() can\'t read empty Packets'); } if (packet.value instanceof Bundle) { - var _ret = function () { - var bundle = packet.value; - return { - v: bundle.bundleElements.forEach(function (bundleItem) { - if (packet.value instanceof Bundle) { - if (bundle.timetag.value.timestamp() < bundleItem.timetag.value.timestamp()) { - throw new Error('OSC Bundle timestamp is older than the timestamp of enclosed Bundles'); - } - return _this.dispatch(bundleItem); - } else if (bundleItem instanceof Message) { - var message = bundleItem; - return _this.notify(message.address, message, bundle.timetag.value.timestamp()); - } - throw new Error('OSC EventHander dispatch() can\'t dispatch unknown Packet value'); - }) - }; - }(); - if ((typeof _ret === 'undefined' ? 'undefined' : _typeof(_ret)) === "object") return _ret.v; + var bundle = packet.value; + return bundle.bundleElements.forEach(function (bundleItem) { + if (packet.value instanceof Bundle) { + if (bundle.timetag.value.timestamp() < bundleItem.timetag.value.timestamp()) { + throw new Error('OSC Bundle timestamp is older than the timestamp of enclosed Bundles'); + } + return _this.dispatch(bundleItem); + } else if (bundleItem instanceof Message) { + var message = bundleItem; + return _this.notify(message.address, message, bundle.timetag.value.timestamp()); + } + throw new Error('OSC EventHander dispatch() can\'t dispatch unknown Packet value'); + }); } else if (packet.value instanceof Message) { var message = packet.value; return this.notify(message.address, message); @@ -818,7 +769,6 @@ var EventHandler = function () { }, { key: 'notify', value: function notify() { - var _this2 = this; for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) { args[_key] = arguments[_key]; } @@ -850,24 +800,17 @@ var EventHandler = function () { } } if (timestamp) { - var _ret2 = function () { - var now = Date.now(); - if (now > timestamp) { - if (!_this2.options.discardLateMessages) { - return { - v: _this2.call(name, data) - }; - } + var now = Date.now(); + if (now > timestamp) { + if (!this.options.discardLateMessages) { + return this.call(name, data); } - var that = _this2; - setTimeout(function () { - that.call(name, data); - }, timestamp - now); - return { - v: true - }; - }(); - if ((typeof _ret2 === 'undefined' ? 'undefined' : _typeof(_ret2)) === "object") return _ret2.v; + } + var that = this; + setTimeout(function () { + that.call(name, data); + }, timestamp - now); + return true; } return this.call(name, data); } @@ -884,8 +827,7 @@ var EventHandler = function () { var handler = { id: this.uuid, callback: callback - }; - if (isString(name) && name in this.eventHandlers) { + };if (isString(name) && name in this.eventHandlers) { this.eventHandlers[name].push(handler); return this.uuid; } @@ -940,17 +882,14 @@ var STATUS$1 = { IS_OPEN: 1, IS_CLOSING: 2, IS_CLOSED: 3 -}; -var defaultOpenOptions = { +};var defaultOpenOptions = { host: 'localhost', port: 41234, exclusive: false -}; -var defaultSendOptions = { +};var defaultSendOptions = { host: 'localhost', port: 41235 -}; -var defaultOptions$2 = { +};var defaultOptions$2 = { type: 'udp4', open: defaultOpenOptions, send: defaultSendOptions @@ -1033,8 +972,7 @@ var STATUS$2 = { IS_OPEN: 1, IS_CLOSING: 2, IS_CLOSED: 3 -}; -var defaultOptions$3 = { +};var defaultOptions$3 = { udpServer: { host: 'localhost', port: 41234, @@ -1049,8 +987,7 @@ var defaultOptions$3 = { port: 8080 }, receiver: 'ws' -}; -function mergeOptions(base, custom) { +};function mergeOptions(base, custom) { return Object.assign({}, defaultOptions$3, base, custom, { udpServer: Object.assign({}, defaultOptions$3.udpServer, base.udpServer, custom.udpServer), udpClient: Object.assign({}, defaultOptions$3.udpClient, base.udpClient, custom.udpClient), @@ -1153,8 +1090,7 @@ var STATUS$3 = { IS_OPEN: 1, IS_CLOSING: 2, IS_CLOSED: 3 -}; -var defaultOptions$4 = { +};var defaultOptions$4 = { host: 'localhost', port: 8080 }; @@ -1230,8 +1166,7 @@ var STATUS$4 = { IS_OPEN: 1, IS_CLOSING: 2, IS_CLOSED: 3 -}; -var defaultOptions$5 = { +};var defaultOptions$5 = { host: 'localhost', port: 8080 }; @@ -1270,14 +1205,10 @@ var WebsocketServerPlugin = function () { this.socket = new WebsocketServer({ host: host, port: port }); this.socket.binaryType = 'arraybuffer'; this.socketStatus = STATUS$4.IS_CONNECTING; - this.socket.on('open', function () { + this.socket.on('listening', function () { _this.socketStatus = STATUS$4.IS_OPEN; _this.notify('open'); }); - this.socket.on('close', function () { - _this.socketStatus = STATUS$4.IS_CLOSED; - _this.notify('close'); - }); this.socket.on('error', function (error) { _this.notify('error', error); }); @@ -1290,8 +1221,12 @@ var WebsocketServerPlugin = function () { }, { key: 'close', value: function close() { + var _this2 = this; this.socketStatus = STATUS$4.IS_CLOSING; - this.socket.close(); + this.socket.close(function () { + _this2.socketStatus = STATUS$4.IS_CLOSED; + _this2.notify('close'); + }); } }, { key: 'send', @@ -1307,8 +1242,7 @@ var WebsocketServerPlugin = function () { var defaultOptions = { plugin: new WebsocketClientPlugin(), discardLateMessages: false -}; -var STATUS = { +};var STATUS = { IS_NOT_INITIALIZED: -1, IS_CONNECTING: 0, IS_OPEN: 1, diff --git a/package-lock.json b/package-lock.json new file mode 100644 index 0000000..a827426 --- /dev/null +++ b/package-lock.json @@ -0,0 +1,2647 @@ +{ + "name": "osc-js", + "version": "1.0.2", + "lockfileVersion": 1, + "dependencies": { + "abab": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/abab/-/abab-1.0.3.tgz", + "integrity": "sha1-uB3l9ydOxOdW15fNg08wNkJyTl0=", + "dev": true, + "optional": true + }, + "acorn": { + "version": "2.7.0", + "resolved": "https://registry.npmjs.org/acorn/-/acorn-2.7.0.tgz", + "integrity": "sha1-q259nYhqrKiwhbwzEreaGYQz8Oc=", + "dev": true + }, + "acorn-globals": { + "version": "1.0.9", + "resolved": "https://registry.npmjs.org/acorn-globals/-/acorn-globals-1.0.9.tgz", + "integrity": "sha1-VbtemGkVB7dFedBRNBMhfDgMVM8=", + "dev": true, + "optional": true + }, + "acorn-jsx": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/acorn-jsx/-/acorn-jsx-3.0.1.tgz", + "integrity": "sha1-r9+UiPsezvyDSPb7IvRk4ypYs2s=", + "dev": true, + "dependencies": { + "acorn": { + "version": "3.3.0", + "resolved": "https://registry.npmjs.org/acorn/-/acorn-3.3.0.tgz", + "integrity": "sha1-ReN/s56No/JbruP/U2niu18iAXo=", + "dev": true + } + } + }, + "ajv": { + "version": "4.11.8", + "resolved": "https://registry.npmjs.org/ajv/-/ajv-4.11.8.tgz", + "integrity": "sha1-gv+wKynmYq5TvcIK8VlHcGc5xTY=", + "dev": true + }, + "ajv-keywords": { + "version": "1.5.1", + "resolved": "https://registry.npmjs.org/ajv-keywords/-/ajv-keywords-1.5.1.tgz", + "integrity": "sha1-MU3QpLM2j609/NxU7eYXG4htrzw=", + "dev": true + }, + "align-text": { + "version": "0.1.4", + "resolved": "https://registry.npmjs.org/align-text/-/align-text-0.1.4.tgz", + "integrity": "sha1-DNkKVhCT810KmSVsIrcGlDP60Rc=", + "dev": true + }, + "amdefine": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/amdefine/-/amdefine-1.0.1.tgz", + "integrity": "sha1-SlKCrBZHKek2Gbz9OtFR+BfOkfU=", + "dev": true, + "optional": true + }, + "ansi-escapes": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/ansi-escapes/-/ansi-escapes-1.4.0.tgz", + "integrity": "sha1-06ioOzGapneTZisT52HHkRQiMG4=", + "dev": true + }, + "ansi-regex": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-2.1.1.tgz", + "integrity": "sha1-w7M6te42DYbg5ijwRorn7yfWVN8=", + "dev": true + }, + "ansi-styles": { + "version": "2.2.1", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-2.2.1.tgz", + "integrity": "sha1-tDLdM1i2NM914eRmQ2gkBTPB3b4=", + "dev": true + }, + "argparse": { + "version": "1.0.9", + "resolved": "https://registry.npmjs.org/argparse/-/argparse-1.0.9.tgz", + "integrity": "sha1-c9g7wmP4bpf4zE9rrhsOkKfSLIY=", + "dev": true + }, + "array-union": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/array-union/-/array-union-1.0.2.tgz", + "integrity": "sha1-mjRBDk9OPaI96jdb5b5w8kd47Dk=", + "dev": true + }, + "array-uniq": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/array-uniq/-/array-uniq-1.0.3.tgz", + "integrity": "sha1-r2rId6Jcx/dOBYiUdThY39sk/bY=", + "dev": true + }, + "arrify": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/arrify/-/arrify-1.0.1.tgz", + "integrity": "sha1-iYUI2iIm84DfkEcoRWhJwVAaSw0=", + "dev": true + }, + "asn1": { + "version": "0.2.3", + "resolved": "https://registry.npmjs.org/asn1/-/asn1-0.2.3.tgz", + "integrity": "sha1-2sh4dxPJlmhJ/IGAd36+nB3fO4Y=", + "dev": true, + "optional": true + }, + "assert-plus": { + "version": "0.2.0", + "resolved": "https://registry.npmjs.org/assert-plus/-/assert-plus-0.2.0.tgz", + "integrity": "sha1-104bh+ev/A24qttwIfP+SBAasjQ=", + "dev": true, + "optional": true + }, + "assertion-error": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/assertion-error/-/assertion-error-1.0.2.tgz", + "integrity": "sha1-E8pRXYYgbaC6xm6DTdOX2HWBCUw=", + "dev": true + }, + "asynckit": { + "version": "0.4.0", + "resolved": "https://registry.npmjs.org/asynckit/-/asynckit-0.4.0.tgz", + "integrity": "sha1-x57Zf380y48robyXkLzDZkdLS3k=", + "dev": true, + "optional": true + }, + "aws-sign2": { + "version": "0.6.0", + "resolved": "https://registry.npmjs.org/aws-sign2/-/aws-sign2-0.6.0.tgz", + "integrity": "sha1-FDQt0428yU0OW4fXY81jYSwOeU8=", + "dev": true, + "optional": true + }, + "aws4": { + "version": "1.6.0", + "resolved": "https://registry.npmjs.org/aws4/-/aws4-1.6.0.tgz", + "integrity": "sha1-g+9cqGCysy5KDe7e6MdxudtXRx4=", + "dev": true, + "optional": true + }, + "babel-code-frame": { + "version": "6.22.0", + "resolved": "https://registry.npmjs.org/babel-code-frame/-/babel-code-frame-6.22.0.tgz", + "integrity": "sha1-AnYgvuVnqIwyVhV05/0IAdMxGOQ=", + "dev": true + }, + "babel-core": { + "version": "6.25.0", + "resolved": "https://registry.npmjs.org/babel-core/-/babel-core-6.25.0.tgz", + "integrity": "sha1-fdQrBGPHQunVKW3rPsZ6kyLa1yk=", + "dev": true, + "dependencies": { + "babel-generator": { + "version": "6.25.0", + "resolved": "https://registry.npmjs.org/babel-generator/-/babel-generator-6.25.0.tgz", + "integrity": "sha1-M6GvcNXyiQrrRlpKd5PB32qeqfw=", + "dev": true + }, + "detect-indent": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/detect-indent/-/detect-indent-4.0.0.tgz", + "integrity": "sha1-920GQ1LN9Docts5hnE7jqUdd4gg=", + "dev": true + }, + "jsesc": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/jsesc/-/jsesc-1.3.0.tgz", + "integrity": "sha1-RsP+yMGJKxKwgz25vHYiF226s0s=", + "dev": true + }, + "repeating": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/repeating/-/repeating-2.0.1.tgz", + "integrity": "sha1-UhTFOpJtNVJwdSf7q0FdvAjQbdo=", + "dev": true + } + } + }, + "babel-eslint": { + "version": "7.2.3", + "resolved": "https://registry.npmjs.org/babel-eslint/-/babel-eslint-7.2.3.tgz", + "integrity": "sha1-sv4tgBJkcPXBlELcdXJTqJdxCCc=", + "dev": true + }, + "babel-generator": { + "version": "6.11.4", + "resolved": "https://registry.npmjs.org/babel-generator/-/babel-generator-6.11.4.tgz", + "integrity": "sha1-FPaTOrsgxiZm0n47e59bncBxKpo=", + "dev": true + }, + "babel-helper-call-delegate": { + "version": "6.24.1", + "resolved": "https://registry.npmjs.org/babel-helper-call-delegate/-/babel-helper-call-delegate-6.24.1.tgz", + "integrity": "sha1-7Oaqzdx25Bw0YfiL/Fdb0Nqi340=", + "dev": true + }, + "babel-helper-define-map": { + "version": "6.24.1", + "resolved": "https://registry.npmjs.org/babel-helper-define-map/-/babel-helper-define-map-6.24.1.tgz", + "integrity": "sha1-epdH8ljYlH0y1RX2qhx70CIEoIA=", + "dev": true + }, + "babel-helper-function-name": { + "version": "6.24.1", + "resolved": "https://registry.npmjs.org/babel-helper-function-name/-/babel-helper-function-name-6.24.1.tgz", + "integrity": "sha1-00dbjAPtmCQqJbSDUasYOZ01gKk=", + "dev": true + }, + "babel-helper-get-function-arity": { + "version": "6.24.1", + "resolved": "https://registry.npmjs.org/babel-helper-get-function-arity/-/babel-helper-get-function-arity-6.24.1.tgz", + "integrity": "sha1-j3eCqpNAfEHTqlCQj4mwMbG2hT0=", + "dev": true + }, + "babel-helper-hoist-variables": { + "version": "6.24.1", + "resolved": "https://registry.npmjs.org/babel-helper-hoist-variables/-/babel-helper-hoist-variables-6.24.1.tgz", + "integrity": "sha1-HssnaJydJVE+rbyZFKc/VAi+enY=", + "dev": true + }, + "babel-helper-optimise-call-expression": { + "version": "6.24.1", + "resolved": "https://registry.npmjs.org/babel-helper-optimise-call-expression/-/babel-helper-optimise-call-expression-6.24.1.tgz", + "integrity": "sha1-96E0J7qfc/j0+pk8VKl4gtEkQlc=", + "dev": true + }, + "babel-helper-regex": { + "version": "6.24.1", + "resolved": "https://registry.npmjs.org/babel-helper-regex/-/babel-helper-regex-6.24.1.tgz", + "integrity": "sha1-024i+rEAjXnYhkjjIRaGgShFbOg=", + "dev": true + }, + "babel-helper-replace-supers": { + "version": "6.24.1", + "resolved": "https://registry.npmjs.org/babel-helper-replace-supers/-/babel-helper-replace-supers-6.24.1.tgz", + "integrity": "sha1-v22/5Dk40XNpohPKiov3S2qQqxo=", + "dev": true + }, + "babel-helpers": { + "version": "6.24.1", + "resolved": "https://registry.npmjs.org/babel-helpers/-/babel-helpers-6.24.1.tgz", + "integrity": "sha1-NHHenK7DiOXIUOWX5Yom3fN2ArI=", + "dev": true + }, + "babel-messages": { + "version": "6.23.0", + "resolved": "https://registry.npmjs.org/babel-messages/-/babel-messages-6.23.0.tgz", + "integrity": "sha1-8830cDhYA1sqKVHG7F7fbGLyYw4=", + "dev": true + }, + "babel-plugin-check-es2015-constants": { + "version": "6.22.0", + "resolved": "https://registry.npmjs.org/babel-plugin-check-es2015-constants/-/babel-plugin-check-es2015-constants-6.22.0.tgz", + "integrity": "sha1-NRV7EBQm/S/9PaP3XH0ekYNbv4o=", + "dev": true + }, + "babel-plugin-external-helpers": { + "version": "6.22.0", + "resolved": "https://registry.npmjs.org/babel-plugin-external-helpers/-/babel-plugin-external-helpers-6.22.0.tgz", + "integrity": "sha1-IoX0iwK9Xe3oUXXK+MYuhq3M76E=", + "dev": true + }, + "babel-plugin-transform-es2015-arrow-functions": { + "version": "6.22.0", + "resolved": "https://registry.npmjs.org/babel-plugin-transform-es2015-arrow-functions/-/babel-plugin-transform-es2015-arrow-functions-6.22.0.tgz", + "integrity": "sha1-RSaSy3EdX3ncf4XkQM5BufJE0iE=", + "dev": true + }, + "babel-plugin-transform-es2015-block-scoped-functions": { + "version": "6.22.0", + "resolved": "https://registry.npmjs.org/babel-plugin-transform-es2015-block-scoped-functions/-/babel-plugin-transform-es2015-block-scoped-functions-6.22.0.tgz", + "integrity": "sha1-u8UbSflk1wy42OC5ToICRs46YUE=", + "dev": true + }, + "babel-plugin-transform-es2015-block-scoping": { + "version": "6.24.1", + "resolved": "https://registry.npmjs.org/babel-plugin-transform-es2015-block-scoping/-/babel-plugin-transform-es2015-block-scoping-6.24.1.tgz", + "integrity": "sha1-dsKV3DpHQbFmWt/TFnIV3P8ypXY=", + "dev": true + }, + "babel-plugin-transform-es2015-classes": { + "version": "6.24.1", + "resolved": "https://registry.npmjs.org/babel-plugin-transform-es2015-classes/-/babel-plugin-transform-es2015-classes-6.24.1.tgz", + "integrity": "sha1-WkxYpQyclGHlZLSyo7+ryXolhNs=", + "dev": true + }, + "babel-plugin-transform-es2015-computed-properties": { + "version": "6.24.1", + "resolved": "https://registry.npmjs.org/babel-plugin-transform-es2015-computed-properties/-/babel-plugin-transform-es2015-computed-properties-6.24.1.tgz", + "integrity": "sha1-b+Ko0WiV1WNPTNmZttNICjCBWbM=", + "dev": true + }, + "babel-plugin-transform-es2015-destructuring": { + "version": "6.23.0", + "resolved": "https://registry.npmjs.org/babel-plugin-transform-es2015-destructuring/-/babel-plugin-transform-es2015-destructuring-6.23.0.tgz", + "integrity": "sha1-mXux8auWf2gtKwh2/jWNYOdlxW0=", + "dev": true + }, + "babel-plugin-transform-es2015-duplicate-keys": { + "version": "6.24.1", + "resolved": "https://registry.npmjs.org/babel-plugin-transform-es2015-duplicate-keys/-/babel-plugin-transform-es2015-duplicate-keys-6.24.1.tgz", + "integrity": "sha1-c+s9MQypaePvnskcU3QabxV2Qj4=", + "dev": true + }, + "babel-plugin-transform-es2015-for-of": { + "version": "6.23.0", + "resolved": "https://registry.npmjs.org/babel-plugin-transform-es2015-for-of/-/babel-plugin-transform-es2015-for-of-6.23.0.tgz", + "integrity": "sha1-9HyVsrYT3x0+zC/bdXNiPHUkhpE=", + "dev": true + }, + "babel-plugin-transform-es2015-function-name": { + "version": "6.24.1", + "resolved": "https://registry.npmjs.org/babel-plugin-transform-es2015-function-name/-/babel-plugin-transform-es2015-function-name-6.24.1.tgz", + "integrity": "sha1-g0yJhTvDaxrw86TF26qU/Y6sqos=", + "dev": true + }, + "babel-plugin-transform-es2015-literals": { + "version": "6.22.0", + "resolved": "https://registry.npmjs.org/babel-plugin-transform-es2015-literals/-/babel-plugin-transform-es2015-literals-6.22.0.tgz", + "integrity": "sha1-T1SgLWzWbPkVKAAZox0xklN3yi4=", + "dev": true + }, + "babel-plugin-transform-es2015-modules-amd": { + "version": "6.24.1", + "resolved": "https://registry.npmjs.org/babel-plugin-transform-es2015-modules-amd/-/babel-plugin-transform-es2015-modules-amd-6.24.1.tgz", + "integrity": "sha1-Oz5UAXI5hC1tGcMBHEvS8AoA0VQ=", + "dev": true + }, + "babel-plugin-transform-es2015-modules-commonjs": { + "version": "6.24.1", + "resolved": "https://registry.npmjs.org/babel-plugin-transform-es2015-modules-commonjs/-/babel-plugin-transform-es2015-modules-commonjs-6.24.1.tgz", + "integrity": "sha1-0+MQtA72ZKNmIiAAl8bUQCmPK/4=", + "dev": true + }, + "babel-plugin-transform-es2015-modules-systemjs": { + "version": "6.24.1", + "resolved": "https://registry.npmjs.org/babel-plugin-transform-es2015-modules-systemjs/-/babel-plugin-transform-es2015-modules-systemjs-6.24.1.tgz", + "integrity": "sha1-/4mhQrkRmpBhlfXxBuzzBdlAfSM=", + "dev": true + }, + "babel-plugin-transform-es2015-modules-umd": { + "version": "6.24.1", + "resolved": "https://registry.npmjs.org/babel-plugin-transform-es2015-modules-umd/-/babel-plugin-transform-es2015-modules-umd-6.24.1.tgz", + "integrity": "sha1-rJl+YoXNGO1hdq22B9YCNErThGg=", + "dev": true + }, + "babel-plugin-transform-es2015-object-super": { + "version": "6.24.1", + "resolved": "https://registry.npmjs.org/babel-plugin-transform-es2015-object-super/-/babel-plugin-transform-es2015-object-super-6.24.1.tgz", + "integrity": "sha1-JM72muIcuDp/hgPa0CH1cusnj40=", + "dev": true + }, + "babel-plugin-transform-es2015-parameters": { + "version": "6.24.1", + "resolved": "https://registry.npmjs.org/babel-plugin-transform-es2015-parameters/-/babel-plugin-transform-es2015-parameters-6.24.1.tgz", + "integrity": "sha1-V6w1GrScrxSpfNE7CfZv3wpiXys=", + "dev": true + }, + "babel-plugin-transform-es2015-shorthand-properties": { + "version": "6.24.1", + "resolved": "https://registry.npmjs.org/babel-plugin-transform-es2015-shorthand-properties/-/babel-plugin-transform-es2015-shorthand-properties-6.24.1.tgz", + "integrity": "sha1-JPh11nIch2YbvZmkYi5R8U3jiqA=", + "dev": true + }, + "babel-plugin-transform-es2015-spread": { + "version": "6.22.0", + "resolved": "https://registry.npmjs.org/babel-plugin-transform-es2015-spread/-/babel-plugin-transform-es2015-spread-6.22.0.tgz", + "integrity": "sha1-1taKmfia7cRTbIGlQujdnxdG+NE=", + "dev": true + }, + "babel-plugin-transform-es2015-sticky-regex": { + "version": "6.24.1", + "resolved": "https://registry.npmjs.org/babel-plugin-transform-es2015-sticky-regex/-/babel-plugin-transform-es2015-sticky-regex-6.24.1.tgz", + "integrity": "sha1-AMHNsaynERLN8M9hJsLta0V8zbw=", + "dev": true + }, + "babel-plugin-transform-es2015-template-literals": { + "version": "6.22.0", + "resolved": "https://registry.npmjs.org/babel-plugin-transform-es2015-template-literals/-/babel-plugin-transform-es2015-template-literals-6.22.0.tgz", + "integrity": "sha1-qEs0UPfp+PH2g51taH2oS7EjbY0=", + "dev": true + }, + "babel-plugin-transform-es2015-typeof-symbol": { + "version": "6.23.0", + "resolved": "https://registry.npmjs.org/babel-plugin-transform-es2015-typeof-symbol/-/babel-plugin-transform-es2015-typeof-symbol-6.23.0.tgz", + "integrity": "sha1-3sCfHN3/lLUqxz1QXITfWdzOs3I=", + "dev": true + }, + "babel-plugin-transform-es2015-unicode-regex": { + "version": "6.24.1", + "resolved": "https://registry.npmjs.org/babel-plugin-transform-es2015-unicode-regex/-/babel-plugin-transform-es2015-unicode-regex-6.24.1.tgz", + "integrity": "sha1-04sS9C6nMj9yk4fxinxa4frrNek=", + "dev": true + }, + "babel-plugin-transform-regenerator": { + "version": "6.24.1", + "resolved": "https://registry.npmjs.org/babel-plugin-transform-regenerator/-/babel-plugin-transform-regenerator-6.24.1.tgz", + "integrity": "sha1-uNowWtQ8PJm0hI5P5AN7dw0jxBg=", + "dev": true + }, + "babel-plugin-transform-strict-mode": { + "version": "6.24.1", + "resolved": "https://registry.npmjs.org/babel-plugin-transform-strict-mode/-/babel-plugin-transform-strict-mode-6.24.1.tgz", + "integrity": "sha1-1fr3qleKZbvlkc9e2uBKDGcCB1g=", + "dev": true + }, + "babel-preset-es2015": { + "version": "6.24.1", + "resolved": "https://registry.npmjs.org/babel-preset-es2015/-/babel-preset-es2015-6.24.1.tgz", + "integrity": "sha1-1EBQ1rwsn+6nAqrzjXJ6AhBTiTk=", + "dev": true + }, + "babel-preset-es2015-rollup": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/babel-preset-es2015-rollup/-/babel-preset-es2015-rollup-3.0.0.tgz", + "integrity": "sha1-hUtj7N4u6YysQOiC9nv88YWx8ko=", + "dev": true + }, + "babel-register": { + "version": "6.24.1", + "resolved": "https://registry.npmjs.org/babel-register/-/babel-register-6.24.1.tgz", + "integrity": "sha1-fhDhOi9xBlvfrVoXh7pFvKbe118=", + "dev": true + }, + "babel-runtime": { + "version": "6.23.0", + "resolved": "https://registry.npmjs.org/babel-runtime/-/babel-runtime-6.23.0.tgz", + "integrity": "sha1-CpSJ8UTecO+zzkMArM2zKeL8VDs=", + "dev": true + }, + "babel-template": { + "version": "6.25.0", + "resolved": "https://registry.npmjs.org/babel-template/-/babel-template-6.25.0.tgz", + "integrity": "sha1-ZlJBFmt8KqTGGdceGSlpVSsQwHE=", + "dev": true + }, + "babel-traverse": { + "version": "6.25.0", + "resolved": "https://registry.npmjs.org/babel-traverse/-/babel-traverse-6.25.0.tgz", + "integrity": "sha1-IldJfi/NGbie3BPEyROB+VEklvE=", + "dev": true + }, + "babel-types": { + "version": "6.25.0", + "resolved": "https://registry.npmjs.org/babel-types/-/babel-types-6.25.0.tgz", + "integrity": "sha1-cK+ySNVmDl0Y+BHZHIMDtUE0oY4=", + "dev": true + }, + "babylon": { + "version": "6.17.4", + "resolved": "https://registry.npmjs.org/babylon/-/babylon-6.17.4.tgz", + "integrity": "sha512-kChlV+0SXkjE0vUn9OZ7pBMWRFd8uq3mZe8x1K6jhuNcAFAtEnjchFAqB+dYEXKyd+JpT6eppRR78QAr5gTsUw==", + "dev": true + }, + "balanced-match": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.0.tgz", + "integrity": "sha1-ibTRmasr7kneFk6gK4nORi1xt2c=", + "dev": true + }, + "bcrypt-pbkdf": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/bcrypt-pbkdf/-/bcrypt-pbkdf-1.0.1.tgz", + "integrity": "sha1-Y7xdy2EzG5K8Bf1SiVPDNGKgb40=", + "dev": true, + "optional": true + }, + "boolbase": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/boolbase/-/boolbase-1.0.0.tgz", + "integrity": "sha1-aN/1++YMUes3cl6p4+0xDcwed24=", + "dev": true + }, + "boom": { + "version": "2.10.1", + "resolved": "https://registry.npmjs.org/boom/-/boom-2.10.1.tgz", + "integrity": "sha1-OciRjO/1eZ+D+UkqhI9iWt0Mdm8=", + "dev": true + }, + "brace-expansion": { + "version": "1.1.8", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.8.tgz", + "integrity": "sha1-wHshHHyVLsH479Uad+8NHTmQopI=", + "dev": true + }, + "browser-stdout": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/browser-stdout/-/browser-stdout-1.3.0.tgz", + "integrity": "sha1-81HTKWnTL6XXpVZxVCY9korjvR8=", + "dev": true + }, + "builtin-modules": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/builtin-modules/-/builtin-modules-1.1.1.tgz", + "integrity": "sha1-Jw8HbFpywC9bZaR9+Uxf46J4iS8=", + "dev": true + }, + "caller-path": { + "version": "0.1.0", + "resolved": "https://registry.npmjs.org/caller-path/-/caller-path-0.1.0.tgz", + "integrity": "sha1-lAhe9jWB7NPaqSREqP6U6CV3dR8=", + "dev": true + }, + "callsites": { + "version": "0.2.0", + "resolved": "https://registry.npmjs.org/callsites/-/callsites-0.2.0.tgz", + "integrity": "sha1-r6uWJikQp/M8GaV3WCXGnzTjUMo=", + "dev": true + }, + "camelcase": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-1.2.1.tgz", + "integrity": "sha1-m7UwTS4LVmmLLHWLCKPqqdqlijk=", + "dev": true + }, + "caseless": { + "version": "0.12.0", + "resolved": "https://registry.npmjs.org/caseless/-/caseless-0.12.0.tgz", + "integrity": "sha1-G2gcIf+EAzyCZUMJBolCDRhxUdw=", + "dev": true, + "optional": true + }, + "center-align": { + "version": "0.1.3", + "resolved": "https://registry.npmjs.org/center-align/-/center-align-0.1.3.tgz", + "integrity": "sha1-qg0yYptu6XIgBBHL1EYckHvCt60=", + "dev": true + }, + "chai": { + "version": "3.5.0", + "resolved": "https://registry.npmjs.org/chai/-/chai-3.5.0.tgz", + "integrity": "sha1-TQJjewZ/6Vi9v906QOxW/vc3Mkc=", + "dev": true + }, + "chai-spies": { + "version": "0.7.1", + "resolved": "https://registry.npmjs.org/chai-spies/-/chai-spies-0.7.1.tgz", + "integrity": "sha1-ND2Z9RJEIS6LF+ZLk5lv97LCqbE=", + "dev": true + }, + "chalk": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-1.1.3.tgz", + "integrity": "sha1-qBFcVeSnAv5NFQq9OHKCKn4J/Jg=", + "dev": true + }, + "cheerio": { + "version": "0.22.0", + "resolved": "https://registry.npmjs.org/cheerio/-/cheerio-0.22.0.tgz", + "integrity": "sha1-qbqoYKP5tZWmuBsahocxIe06Jp4=", + "dev": true + }, + "circular-json": { + "version": "0.3.1", + "resolved": "https://registry.npmjs.org/circular-json/-/circular-json-0.3.1.tgz", + "integrity": "sha1-vos2rvzN6LPKeqLWr8B6NyQsDS0=", + "dev": true + }, + "cli-cursor": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/cli-cursor/-/cli-cursor-1.0.2.tgz", + "integrity": "sha1-ZNo/fValRBLll5S9Ytw1KV6PKYc=", + "dev": true + }, + "cli-width": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/cli-width/-/cli-width-2.1.0.tgz", + "integrity": "sha1-sjTKIJsp72b8UY2bmNWEewDt8Ao=", + "dev": true + }, + "cliui": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/cliui/-/cliui-2.1.0.tgz", + "integrity": "sha1-S0dXYP+AJkx2LDoXGQMukcf+oNE=", + "dev": true, + "dependencies": { + "wordwrap": { + "version": "0.0.2", + "resolved": "https://registry.npmjs.org/wordwrap/-/wordwrap-0.0.2.tgz", + "integrity": "sha1-t5Zpu0LstAn4PVg8rVLKF+qhZD8=", + "dev": true + } + } + }, + "co": { + "version": "4.6.0", + "resolved": "https://registry.npmjs.org/co/-/co-4.6.0.tgz", + "integrity": "sha1-bqa989hTrlTMuOR7+gvz+QMfsYQ=", + "dev": true + }, + "code-point-at": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/code-point-at/-/code-point-at-1.1.0.tgz", + "integrity": "sha1-DQcLTQQ6W+ozovGkDi7bPZpMz3c=", + "dev": true + }, + "color-logger": { + "version": "0.0.3", + "resolved": "https://registry.npmjs.org/color-logger/-/color-logger-0.0.3.tgz", + "integrity": "sha1-2bIt0dlz4Waxi/MT+fSBu6TfIBg=", + "dev": true + }, + "combined-stream": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/combined-stream/-/combined-stream-1.0.5.tgz", + "integrity": "sha1-k4NwpXtKUd6ix3wV1cX9+JUWQAk=", + "dev": true + }, + "commander": { + "version": "2.9.0", + "resolved": "https://registry.npmjs.org/commander/-/commander-2.9.0.tgz", + "integrity": "sha1-nJkJQXbhIkDLItbFFGCYQA/g99Q=", + "dev": true + }, + "concat-map": { + "version": "0.0.1", + "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", + "integrity": "sha1-2Klr13/Wjfd5OnMDajug1UBdR3s=", + "dev": true + }, + "concat-stream": { + "version": "1.6.0", + "resolved": "https://registry.npmjs.org/concat-stream/-/concat-stream-1.6.0.tgz", + "integrity": "sha1-CqxmL9Ur54lk1VMvaUeE5wEQrPc=", + "dev": true + }, + "contains-path": { + "version": "0.1.0", + "resolved": "https://registry.npmjs.org/contains-path/-/contains-path-0.1.0.tgz", + "integrity": "sha1-/ozxhP9mcLa67wGp1IYaXL7EEgo=", + "dev": true + }, + "convert-source-map": { + "version": "1.5.0", + "resolved": "https://registry.npmjs.org/convert-source-map/-/convert-source-map-1.5.0.tgz", + "integrity": "sha1-ms1whRxtXf3ZPZKC5e35SgP/RrU=", + "dev": true + }, + "core-js": { + "version": "2.4.1", + "resolved": "https://registry.npmjs.org/core-js/-/core-js-2.4.1.tgz", + "integrity": "sha1-TekR5mew6ukSTjQlS1OupvxhjT4=", + "dev": true + }, + "core-util-is": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.2.tgz", + "integrity": "sha1-tf1UIgqivFq1eqtxQMlAdUUDwac=", + "dev": true + }, + "cryptiles": { + "version": "2.0.5", + "resolved": "https://registry.npmjs.org/cryptiles/-/cryptiles-2.0.5.tgz", + "integrity": "sha1-O9/s3GCBR8HGcgL6KR59ylnqo7g=", + "dev": true, + "optional": true + }, + "css-select": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/css-select/-/css-select-1.2.0.tgz", + "integrity": "sha1-KzoRBTnFNV8c2NMUYj6HCxIeyFg=", + "dev": true + }, + "css-what": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/css-what/-/css-what-2.1.0.tgz", + "integrity": "sha1-lGfQMsOM+u+58teVASUwYvh/ob0=", + "dev": true + }, + "cssom": { + "version": "0.3.2", + "resolved": "https://registry.npmjs.org/cssom/-/cssom-0.3.2.tgz", + "integrity": "sha1-uANhcMefB6kP8vFuIihAJ6JDhIs=", + "dev": true + }, + "cssstyle": { + "version": "0.2.37", + "resolved": "https://registry.npmjs.org/cssstyle/-/cssstyle-0.2.37.tgz", + "integrity": "sha1-VBCXI0yyUTyDzu06zdwn/yeYfVQ=", + "dev": true, + "optional": true + }, + "d": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/d/-/d-1.0.0.tgz", + "integrity": "sha1-dUu1v+VUUdpppYuU1F9MWwRi1Y8=", + "dev": true + }, + "dashdash": { + "version": "1.14.1", + "resolved": "https://registry.npmjs.org/dashdash/-/dashdash-1.14.1.tgz", + "integrity": "sha1-hTz6D3y+L+1d4gMmuN1YEDX24vA=", + "dev": true, + "optional": true, + "dependencies": { + "assert-plus": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/assert-plus/-/assert-plus-1.0.0.tgz", + "integrity": "sha1-8S4PPF13sLHN2RRpQuTpbB5N1SU=", + "dev": true, + "optional": true + } + } + }, + "debug": { + "version": "2.6.8", + "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.8.tgz", + "integrity": "sha1-5zFTHKLt4n0YgiJCfaF4IdaP9Pw=", + "dev": true + }, + "decamelize": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/decamelize/-/decamelize-1.2.0.tgz", + "integrity": "sha1-9lNNFRSCabIDUue+4m9QH5oZEpA=", + "dev": true + }, + "deep-eql": { + "version": "0.1.3", + "resolved": "https://registry.npmjs.org/deep-eql/-/deep-eql-0.1.3.tgz", + "integrity": "sha1-71WKyrjeJSBs1xOQbXTlaTDrafI=", + "dev": true, + "dependencies": { + "type-detect": { + "version": "0.1.1", + "resolved": "https://registry.npmjs.org/type-detect/-/type-detect-0.1.1.tgz", + "integrity": "sha1-C6XsKohWQORw6k6FBZcZANrFiCI=", + "dev": true + } + } + }, + "deep-is": { + "version": "0.1.3", + "resolved": "https://registry.npmjs.org/deep-is/-/deep-is-0.1.3.tgz", + "integrity": "sha1-s2nW+128E+7PUk+RsHD+7cNXzzQ=", + "dev": true + }, + "del": { + "version": "2.2.2", + "resolved": "https://registry.npmjs.org/del/-/del-2.2.2.tgz", + "integrity": "sha1-wSyYHQZ4RshLyvhiz/kw2Qf/0ag=", + "dev": true + }, + "delayed-stream": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/delayed-stream/-/delayed-stream-1.0.0.tgz", + "integrity": "sha1-3zrhmayt+31ECqrgsp4icrJOxhk=", + "dev": true + }, + "detect-indent": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/detect-indent/-/detect-indent-3.0.1.tgz", + "integrity": "sha1-ncXl3bzu+DJXZLlFGwK8bVQIT3U=", + "dev": true + }, + "diff": { + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/diff/-/diff-3.2.0.tgz", + "integrity": "sha1-yc45Okt8vQsFinJck98pkCeGj/k=", + "dev": true + }, + "doctrine": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/doctrine/-/doctrine-2.0.0.tgz", + "integrity": "sha1-xz2NKQnSIpHhoAejlYBNqLZl/mM=", + "dev": true + }, + "dom-serializer": { + "version": "0.1.0", + "resolved": "https://registry.npmjs.org/dom-serializer/-/dom-serializer-0.1.0.tgz", + "integrity": "sha1-BzxpdUbOB4DOI75KKOKT5AvDDII=", + "dev": true, + "dependencies": { + "domelementtype": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/domelementtype/-/domelementtype-1.1.3.tgz", + "integrity": "sha1-vSh3PiZCiBrsUVRJJCmcXNgiGFs=", + "dev": true + } + } + }, + "domelementtype": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/domelementtype/-/domelementtype-1.3.0.tgz", + "integrity": "sha1-sXrtguirWeUt2cGbF1bg/BhyBMI=", + "dev": true + }, + "domhandler": { + "version": "2.4.1", + "resolved": "https://registry.npmjs.org/domhandler/-/domhandler-2.4.1.tgz", + "integrity": "sha1-iS5HAAqZvlW783dP/qBWHYh5wlk=", + "dev": true + }, + "domutils": { + "version": "1.5.1", + "resolved": "https://registry.npmjs.org/domutils/-/domutils-1.5.1.tgz", + "integrity": "sha1-3NhIiib1Y9YQeeSMn3t+Mjc2gs8=", + "dev": true + }, + "ecc-jsbn": { + "version": "0.1.1", + "resolved": "https://registry.npmjs.org/ecc-jsbn/-/ecc-jsbn-0.1.1.tgz", + "integrity": "sha1-D8c6ntXw1Tw4GTOYUj735UN3dQU=", + "dev": true, + "optional": true + }, + "entities": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/entities/-/entities-1.1.1.tgz", + "integrity": "sha1-blwtClYhtdra7O+AuQ7ftc13cvA=", + "dev": true + }, + "error-ex": { + "version": "1.3.1", + "resolved": "https://registry.npmjs.org/error-ex/-/error-ex-1.3.1.tgz", + "integrity": "sha1-+FWobOYa3E6GIcPNoh56dhLDqNw=", + "dev": true + }, + "es5-ext": { + "version": "0.10.23", + "resolved": "https://registry.npmjs.org/es5-ext/-/es5-ext-0.10.23.tgz", + "integrity": "sha1-dXi1G+l0IHpUh4IbVlOMIk5Oezg=", + "dev": true + }, + "es6-iterator": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/es6-iterator/-/es6-iterator-2.0.1.tgz", + "integrity": "sha1-jjGcnwRTv1ddN0lAplWSDlnKVRI=", + "dev": true + }, + "es6-map": { + "version": "0.1.5", + "resolved": "https://registry.npmjs.org/es6-map/-/es6-map-0.1.5.tgz", + "integrity": "sha1-kTbgUD3MBqMBaQ8LsU/042TpSfA=", + "dev": true + }, + "es6-set": { + "version": "0.1.5", + "resolved": "https://registry.npmjs.org/es6-set/-/es6-set-0.1.5.tgz", + "integrity": "sha1-0rPsXU2ADO2BjbU40ol02wpzzLE=", + "dev": true + }, + "es6-symbol": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/es6-symbol/-/es6-symbol-3.1.1.tgz", + "integrity": "sha1-vwDvT9q2uhtG7Le2KbTH7VcVzHc=", + "dev": true + }, + "es6-weak-map": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/es6-weak-map/-/es6-weak-map-2.0.2.tgz", + "integrity": "sha1-XjqzIlH/0VOKH45f+hNXdy+S2W8=", + "dev": true + }, + "escape-html": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/escape-html/-/escape-html-1.0.3.tgz", + "integrity": "sha1-Aljq5NPQwJdN4cFpGI7wBR0dGYg=", + "dev": true + }, + "escape-string-regexp": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz", + "integrity": "sha1-G2HAViGQqN/2rjuyzwIAyhMLhtQ=", + "dev": true + }, + "escodegen": { + "version": "1.8.1", + "resolved": "https://registry.npmjs.org/escodegen/-/escodegen-1.8.1.tgz", + "integrity": "sha1-WltTr0aTEQvrsIZ6o0MN07cKEBg=", + "dev": true, + "optional": true, + "dependencies": { + "source-map": { + "version": "0.2.0", + "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.2.0.tgz", + "integrity": "sha1-2rc/vPwrqBm03gO9b26qSBZLP50=", + "dev": true, + "optional": true + } + } + }, + "escope": { + "version": "3.6.0", + "resolved": "https://registry.npmjs.org/escope/-/escope-3.6.0.tgz", + "integrity": "sha1-4Bl16BJ4GhY6ba392AOY3GTIicM=", + "dev": true, + "dependencies": { + "estraverse": { + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-4.2.0.tgz", + "integrity": "sha1-De4/7TH81GlhjOc0IJn8GvoL2xM=", + "dev": true + } + } + }, + "esdoc": { + "version": "0.5.2", + "resolved": "https://registry.npmjs.org/esdoc/-/esdoc-0.5.2.tgz", + "integrity": "sha1-y/0LIOPRyswjyTwyju2YfiG6AGc=", + "dev": true, + "dependencies": { + "babel-traverse": { + "version": "6.12.0", + "resolved": "https://registry.npmjs.org/babel-traverse/-/babel-traverse-6.12.0.tgz", + "integrity": "sha1-8i9U+g1u639jWFJGurbmN4WPXZQ=", + "dev": true + }, + "babylon": { + "version": "6.14.1", + "resolved": "https://registry.npmjs.org/babylon/-/babylon-6.14.1.tgz", + "integrity": "sha1-lWJ1+rcnU62bNDXXr+WPi/CimBU=", + "dev": true + }, + "globals": { + "version": "8.18.0", + "resolved": "https://registry.npmjs.org/globals/-/globals-8.18.0.tgz", + "integrity": "sha1-k9SmK9ysOM+vr8R9awNHaMsP/LQ=", + "dev": true + } + } + }, + "eslint": { + "version": "3.19.0", + "resolved": "https://registry.npmjs.org/eslint/-/eslint-3.19.0.tgz", + "integrity": "sha1-yPxiAcf0DdCJQbh8CFdnOGpnmsw=", + "dev": true, + "dependencies": { + "estraverse": { + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-4.2.0.tgz", + "integrity": "sha1-De4/7TH81GlhjOc0IJn8GvoL2xM=", + "dev": true + } + } + }, + "eslint-config-airbnb-base": { + "version": "11.2.0", + "resolved": "https://registry.npmjs.org/eslint-config-airbnb-base/-/eslint-config-airbnb-base-11.2.0.tgz", + "integrity": "sha1-GancRIGib3CQRUXsBAEWh2AY+FM=", + "dev": true + }, + "eslint-import-resolver-node": { + "version": "0.2.3", + "resolved": "https://registry.npmjs.org/eslint-import-resolver-node/-/eslint-import-resolver-node-0.2.3.tgz", + "integrity": "sha1-Wt2BBujJKNssuiMrzZ76hG49oWw=", + "dev": true + }, + "eslint-module-utils": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/eslint-module-utils/-/eslint-module-utils-2.1.1.tgz", + "integrity": "sha512-jDI/X5l/6D1rRD/3T43q8Qgbls2nq5km5KSqiwlyUbGo5+04fXhMKdCPhjwbqAa6HXWaMxj8Q4hQDIh7IadJQw==", + "dev": true + }, + "eslint-plugin-import": { + "version": "2.5.0", + "resolved": "https://registry.npmjs.org/eslint-plugin-import/-/eslint-plugin-import-2.5.0.tgz", + "integrity": "sha512-JoGslQQHFveBnS3oZGKtinynThbTAo2QEpY5PQaD2VUGxhjB6us1wGD9PbwYLnevBdaEbUUfjtEAWmsEu3CtrQ==", + "dev": true, + "dependencies": { + "doctrine": { + "version": "1.5.0", + "resolved": "https://registry.npmjs.org/doctrine/-/doctrine-1.5.0.tgz", + "integrity": "sha1-N53Ocw9hZvds76TmcHoVmwLFpvo=", + "dev": true + } + } + }, + "espree": { + "version": "3.4.3", + "resolved": "https://registry.npmjs.org/espree/-/espree-3.4.3.tgz", + "integrity": "sha1-KRC1zNSc6JPC//+qtP2LOjG4I3Q=", + "dev": true, + "dependencies": { + "acorn": { + "version": "5.0.3", + "resolved": "https://registry.npmjs.org/acorn/-/acorn-5.0.3.tgz", + "integrity": "sha1-xGDfCEkUY/AozLguqzcwvwEIez0=", + "dev": true + } + } + }, + "esprima": { + "version": "2.7.3", + "resolved": "https://registry.npmjs.org/esprima/-/esprima-2.7.3.tgz", + "integrity": "sha1-luO3DVd59q1JzQMmc9HDEnZ7pYE=", + "dev": true, + "optional": true + }, + "esquery": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/esquery/-/esquery-1.0.0.tgz", + "integrity": "sha1-z7qLV9f7qT8XKYqKAGoEzaE9gPo=", + "dev": true, + "dependencies": { + "estraverse": { + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-4.2.0.tgz", + "integrity": "sha1-De4/7TH81GlhjOc0IJn8GvoL2xM=", + "dev": true + } + } + }, + "esrecurse": { + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/esrecurse/-/esrecurse-4.2.0.tgz", + "integrity": "sha1-+pVo2Y04I/mkHZHpAtyrnqblsWM=", + "dev": true, + "dependencies": { + "estraverse": { + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-4.2.0.tgz", + "integrity": "sha1-De4/7TH81GlhjOc0IJn8GvoL2xM=", + "dev": true + } + } + }, + "estraverse": { + "version": "1.9.3", + "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-1.9.3.tgz", + "integrity": "sha1-r2fy3JIlgkFZUJJgkaQAXSnJu0Q=", + "dev": true, + "optional": true + }, + "estree-walker": { + "version": "0.2.1", + "resolved": "https://registry.npmjs.org/estree-walker/-/estree-walker-0.2.1.tgz", + "integrity": "sha1-va/oCVOD2EFNXcLs9MkXO225QS4=", + "dev": true + }, + "esutils": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/esutils/-/esutils-2.0.2.tgz", + "integrity": "sha1-Cr9PHKpbyx96nYrMbepPqqBLrJs=", + "dev": true + }, + "event-emitter": { + "version": "0.3.5", + "resolved": "https://registry.npmjs.org/event-emitter/-/event-emitter-0.3.5.tgz", + "integrity": "sha1-34xp7vFkeSPHFXuc6DhAYQsCzDk=", + "dev": true + }, + "exit-hook": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/exit-hook/-/exit-hook-1.1.1.tgz", + "integrity": "sha1-8FyiM7SMBdVP/wd2XfhQfpXAL/g=", + "dev": true + }, + "extend": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/extend/-/extend-3.0.1.tgz", + "integrity": "sha1-p1Xqe8Gt/MWjHOfnYtuq3F5jZEQ=", + "dev": true, + "optional": true + }, + "extsprintf": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/extsprintf/-/extsprintf-1.0.2.tgz", + "integrity": "sha1-4QgOBljjALBilJkMxw4VAiNf1VA=", + "dev": true + }, + "fast-levenshtein": { + "version": "2.0.6", + "resolved": "https://registry.npmjs.org/fast-levenshtein/-/fast-levenshtein-2.0.6.tgz", + "integrity": "sha1-PYpcZog6FqMMqGQ+hR8Zuqd5eRc=", + "dev": true + }, + "figures": { + "version": "1.7.0", + "resolved": "https://registry.npmjs.org/figures/-/figures-1.7.0.tgz", + "integrity": "sha1-y+Hjr/zxzUS4DK3+0o3Hk6lwHS4=", + "dev": true + }, + "file-entry-cache": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/file-entry-cache/-/file-entry-cache-2.0.0.tgz", + "integrity": "sha1-w5KZDD5oR4PYOLjISkXYoEhFg2E=", + "dev": true + }, + "find-up": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/find-up/-/find-up-1.1.2.tgz", + "integrity": "sha1-ay6YIrGizgpgq2TWEOzK1TyyTQ8=", + "dev": true + }, + "flat-cache": { + "version": "1.2.2", + "resolved": "https://registry.npmjs.org/flat-cache/-/flat-cache-1.2.2.tgz", + "integrity": "sha1-+oZxTnLCHbiGAXYezy9VXRq8a5Y=", + "dev": true + }, + "forever-agent": { + "version": "0.6.1", + "resolved": "https://registry.npmjs.org/forever-agent/-/forever-agent-0.6.1.tgz", + "integrity": "sha1-+8cfDEGt6zf5bFd60e1C2P2sypE=", + "dev": true, + "optional": true + }, + "form-data": { + "version": "2.1.4", + "resolved": "https://registry.npmjs.org/form-data/-/form-data-2.1.4.tgz", + "integrity": "sha1-M8GDrPGTJ27KqYFDpp6Uv+4XUNE=", + "dev": true, + "optional": true + }, + "fs-extra": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-1.0.0.tgz", + "integrity": "sha1-zTzl9+fLYUWIP8rjGR6Yd/hYeVA=", + "dev": true + }, + "fs.realpath": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz", + "integrity": "sha1-FQStJSMVjKpA20onh8sBQRmU6k8=", + "dev": true + }, + "function-bind": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.0.tgz", + "integrity": "sha1-FhdnFMgBeY5Ojyz391KUZ7tKV3E=", + "dev": true + }, + "gaze": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/gaze/-/gaze-1.1.2.tgz", + "integrity": "sha1-hHIkZ3rbiHDWeSV+0ziP22HkAQU=", + "dev": true + }, + "generate-function": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/generate-function/-/generate-function-2.0.0.tgz", + "integrity": "sha1-aFj+fAlpt9TpCTM3ZHrHn2DfvnQ=", + "dev": true + }, + "generate-object-property": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/generate-object-property/-/generate-object-property-1.2.0.tgz", + "integrity": "sha1-nA4cQDCM6AT0eDYYuTf6iPmdUNA=", + "dev": true + }, + "get-stdin": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/get-stdin/-/get-stdin-4.0.1.tgz", + "integrity": "sha1-uWjGsKBDhDJJAui/Gl3zJXmkUP4=", + "dev": true + }, + "getpass": { + "version": "0.1.7", + "resolved": "https://registry.npmjs.org/getpass/-/getpass-0.1.7.tgz", + "integrity": "sha1-Xv+OPmhNVprkyysSgmBOi6YhSfo=", + "dev": true, + "optional": true, + "dependencies": { + "assert-plus": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/assert-plus/-/assert-plus-1.0.0.tgz", + "integrity": "sha1-8S4PPF13sLHN2RRpQuTpbB5N1SU=", + "dev": true, + "optional": true + } + } + }, + "glob": { + "version": "7.1.2", + "resolved": "https://registry.npmjs.org/glob/-/glob-7.1.2.tgz", + "integrity": "sha512-MJTUg1kjuLeQCJ+ccE4Vpa6kKVXkPYJ2mOCQyUuKLcLQsdrMCpBPUi8qVE6+YuaJkozeA9NusTAw3hLr8Xe5EQ==", + "dev": true + }, + "globals": { + "version": "9.18.0", + "resolved": "https://registry.npmjs.org/globals/-/globals-9.18.0.tgz", + "integrity": "sha512-S0nG3CLEQiY/ILxqtztTWH/3iRRdyBLw6KMDxnKMchrtbj2OFmehVh0WUCfW3DUrIgx/qFrJPICrq4Z4sTR9UQ==", + "dev": true + }, + "globby": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/globby/-/globby-5.0.0.tgz", + "integrity": "sha1-69hGZ8oNuzMLmbz8aOrCvFQ3Dg0=", + "dev": true + }, + "globule": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/globule/-/globule-1.2.0.tgz", + "integrity": "sha1-HcScaCLdnoovoAuiopUAboZkvQk=", + "dev": true + }, + "graceful-fs": { + "version": "4.1.11", + "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.1.11.tgz", + "integrity": "sha1-Dovf5NHduIVNZOBOp8AOKgJuVlg=", + "dev": true + }, + "graceful-readlink": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/graceful-readlink/-/graceful-readlink-1.0.1.tgz", + "integrity": "sha1-TK+tdrxi8C+gObL5Tpo906ORpyU=", + "dev": true + }, + "growl": { + "version": "1.9.2", + "resolved": "https://registry.npmjs.org/growl/-/growl-1.9.2.tgz", + "integrity": "sha1-Dqd0NxXbjY3ixe3hd14bRayFwC8=", + "dev": true + }, + "har-schema": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/har-schema/-/har-schema-1.0.5.tgz", + "integrity": "sha1-0mMTX0MwfALGAq/I/pWXDAFRNp4=", + "dev": true, + "optional": true + }, + "har-validator": { + "version": "4.2.1", + "resolved": "https://registry.npmjs.org/har-validator/-/har-validator-4.2.1.tgz", + "integrity": "sha1-M0gdDxu/9gDdID11gSpqX7oALio=", + "dev": true, + "optional": true + }, + "has": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/has/-/has-1.0.1.tgz", + "integrity": "sha1-hGFzP1OLCDfJNh45qauelwTcLyg=", + "dev": true + }, + "has-ansi": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/has-ansi/-/has-ansi-2.0.0.tgz", + "integrity": "sha1-NPUEnOHs3ysGSa8+8k5F7TVBbZE=", + "dev": true + }, + "has-flag": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-1.0.0.tgz", + "integrity": "sha1-nZ55MWXOAXoA8AQYxD+UKnsdEfo=", + "dev": true + }, + "hawk": { + "version": "3.1.3", + "resolved": "https://registry.npmjs.org/hawk/-/hawk-3.1.3.tgz", + "integrity": "sha1-B4REvXwWQLD+VA0sm3PVlnjo4cQ=", + "dev": true, + "optional": true + }, + "hoek": { + "version": "2.16.3", + "resolved": "https://registry.npmjs.org/hoek/-/hoek-2.16.3.tgz", + "integrity": "sha1-ILt0A9POo5jpHcRxCo/xuCdKJe0=", + "dev": true + }, + "home-or-tmp": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/home-or-tmp/-/home-or-tmp-2.0.0.tgz", + "integrity": "sha1-42w/LSyufXRqhX440Y1fMqeILbg=", + "dev": true + }, + "hosted-git-info": { + "version": "2.4.2", + "resolved": "https://registry.npmjs.org/hosted-git-info/-/hosted-git-info-2.4.2.tgz", + "integrity": "sha1-AHa59GonBQbduq6lZJaJdGBhKmc=", + "dev": true + }, + "htmlparser2": { + "version": "3.9.2", + "resolved": "https://registry.npmjs.org/htmlparser2/-/htmlparser2-3.9.2.tgz", + "integrity": "sha1-G9+HrMoPP55T+k/M6w9LTLsAszg=", + "dev": true + }, + "http-signature": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/http-signature/-/http-signature-1.1.1.tgz", + "integrity": "sha1-33LiZwZs0Kxn+3at+OE0qPvPkb8=", + "dev": true, + "optional": true + }, + "ice-cap": { + "version": "0.0.4", + "resolved": "https://registry.npmjs.org/ice-cap/-/ice-cap-0.0.4.tgz", + "integrity": "sha1-im0xq0ysjUtW3k+pRt8zUlYbbhg=", + "dev": true, + "dependencies": { + "cheerio": { + "version": "0.20.0", + "resolved": "https://registry.npmjs.org/cheerio/-/cheerio-0.20.0.tgz", + "integrity": "sha1-XHEPK6uVZTJyhCugHG6mGzVF7DU=", + "dev": true + }, + "domhandler": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/domhandler/-/domhandler-2.3.0.tgz", + "integrity": "sha1-LeWaCCLVAn+r/28DLCsloqir5zg=", + "dev": true + }, + "htmlparser2": { + "version": "3.8.3", + "resolved": "https://registry.npmjs.org/htmlparser2/-/htmlparser2-3.8.3.tgz", + "integrity": "sha1-mWwosZFRaovoZQGn15dX5ccMEGg=", + "dev": true, + "dependencies": { + "entities": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/entities/-/entities-1.0.0.tgz", + "integrity": "sha1-sph6o4ITR/zeZCsk/fyeT7cSvyY=", + "dev": true + } + } + }, + "isarray": { + "version": "0.0.1", + "resolved": "https://registry.npmjs.org/isarray/-/isarray-0.0.1.tgz", + "integrity": "sha1-ihis/Kmo9Bd+Cav8YDiTmwXR7t8=", + "dev": true + }, + "readable-stream": { + "version": "1.1.14", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-1.1.14.tgz", + "integrity": "sha1-fPTFTvZI44EwhMY23SB54WbAgdk=", + "dev": true + }, + "string_decoder": { + "version": "0.10.31", + "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-0.10.31.tgz", + "integrity": "sha1-YuIDvEF2bGwoyfyEMB2rHFMQ+pQ=", + "dev": true + } + } + }, + "ignore": { + "version": "3.3.3", + "resolved": "https://registry.npmjs.org/ignore/-/ignore-3.3.3.tgz", + "integrity": "sha1-QyNS5XrM2HqzEQ6C0/6g5HgSFW0=", + "dev": true + }, + "imurmurhash": { + "version": "0.1.4", + "resolved": "https://registry.npmjs.org/imurmurhash/-/imurmurhash-0.1.4.tgz", + "integrity": "sha1-khi5srkoojixPcT7a21XbyMUU+o=", + "dev": true + }, + "inflight": { + "version": "1.0.6", + "resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz", + "integrity": "sha1-Sb1jMdfQLQwJvJEKEHW6gWW1bfk=", + "dev": true + }, + "inherits": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.3.tgz", + "integrity": "sha1-Yzwsg+PaQqUC9SRmAiSA9CCCYd4=", + "dev": true + }, + "inquirer": { + "version": "0.12.0", + "resolved": "https://registry.npmjs.org/inquirer/-/inquirer-0.12.0.tgz", + "integrity": "sha1-HvK/1jUE3wvHV4X/+MLEHfEvB34=", + "dev": true + }, + "interpret": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/interpret/-/interpret-1.0.3.tgz", + "integrity": "sha1-y8NcYu7uc/Gat7EKgBURQBr8D5A=", + "dev": true + }, + "invariant": { + "version": "2.2.2", + "resolved": "https://registry.npmjs.org/invariant/-/invariant-2.2.2.tgz", + "integrity": "sha1-nh9WrArNtr8wMwbzOL47IErmA2A=", + "dev": true + }, + "is-arrayish": { + "version": "0.2.1", + "resolved": "https://registry.npmjs.org/is-arrayish/-/is-arrayish-0.2.1.tgz", + "integrity": "sha1-d8mYQFJ6qOyxqLppe4BkWnqSap0=", + "dev": true + }, + "is-buffer": { + "version": "1.1.5", + "resolved": "https://registry.npmjs.org/is-buffer/-/is-buffer-1.1.5.tgz", + "integrity": "sha1-Hzsm72E7IUuIy8ojzGwB2Hlh7sw=", + "dev": true + }, + "is-builtin-module": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-builtin-module/-/is-builtin-module-1.0.0.tgz", + "integrity": "sha1-VAVy0096wxGfj3bDDLwbHgN6/74=", + "dev": true + }, + "is-finite": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/is-finite/-/is-finite-1.0.2.tgz", + "integrity": "sha1-zGZ3aVYCvlUO8R6LSqYwU0K20Ko=", + "dev": true + }, + "is-fullwidth-code-point": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-1.0.0.tgz", + "integrity": "sha1-754xOG8DGn8NZDr4L95QxFfvAMs=", + "dev": true + }, + "is-my-json-valid": { + "version": "2.16.0", + "resolved": "https://registry.npmjs.org/is-my-json-valid/-/is-my-json-valid-2.16.0.tgz", + "integrity": "sha1-8Hndm/2uZe4gOKrorLyGqxCeNpM=", + "dev": true + }, + "is-path-cwd": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-path-cwd/-/is-path-cwd-1.0.0.tgz", + "integrity": "sha1-0iXsIxMuie3Tj9p2dHLmLmXxEG0=", + "dev": true + }, + "is-path-in-cwd": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-path-in-cwd/-/is-path-in-cwd-1.0.0.tgz", + "integrity": "sha1-ZHdYK4IU1gI0YJRWcAO+ip6sBNw=", + "dev": true + }, + "is-path-inside": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-path-inside/-/is-path-inside-1.0.0.tgz", + "integrity": "sha1-/AbloWg/vaE95mev9xe7wQpI838=", + "dev": true + }, + "is-property": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/is-property/-/is-property-1.0.2.tgz", + "integrity": "sha1-V/4cTkhHTt1lsJkR8msc1Ald2oQ=", + "dev": true + }, + "is-resolvable": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-resolvable/-/is-resolvable-1.0.0.tgz", + "integrity": "sha1-jfV8YeouPFAUCNEA+wE8+NbgzGI=", + "dev": true + }, + "is-typedarray": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-typedarray/-/is-typedarray-1.0.0.tgz", + "integrity": "sha1-5HnICFjfDBsR3dppQPlgEfzaSpo=", + "dev": true, + "optional": true + }, + "isarray": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz", + "integrity": "sha1-u5NdSFgsuhaMBoNJV6VKPgcSTxE=", + "dev": true + }, + "isstream": { + "version": "0.1.2", + "resolved": "https://registry.npmjs.org/isstream/-/isstream-0.1.2.tgz", + "integrity": "sha1-R+Y/evVa+m+S4VAOaQ64uFKcCZo=", + "dev": true, + "optional": true + }, + "js-tokens": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/js-tokens/-/js-tokens-3.0.1.tgz", + "integrity": "sha1-COnxMkhKLEWjCQfp3E1VZ7fxFNc=", + "dev": true + }, + "js-yaml": { + "version": "3.8.4", + "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-3.8.4.tgz", + "integrity": "sha1-UgtFZPhlc7qWZir4Woyvp7S1pvY=", + "dev": true, + "dependencies": { + "esprima": { + "version": "3.1.3", + "resolved": "https://registry.npmjs.org/esprima/-/esprima-3.1.3.tgz", + "integrity": "sha1-/cpRzuYTOJXjyI1TXOSdv/YqRjM=", + "dev": true + } + } + }, + "jsbn": { + "version": "0.1.1", + "resolved": "https://registry.npmjs.org/jsbn/-/jsbn-0.1.1.tgz", + "integrity": "sha1-peZUwuWi3rXyAdls77yoDA7y9RM=", + "dev": true, + "optional": true + }, + "jsdom": { + "version": "7.2.2", + "resolved": "https://registry.npmjs.org/jsdom/-/jsdom-7.2.2.tgz", + "integrity": "sha1-QLQCdwwr2iNGkJa+6Rq2deOx/G4=", + "dev": true, + "optional": true + }, + "jsesc": { + "version": "0.5.0", + "resolved": "https://registry.npmjs.org/jsesc/-/jsesc-0.5.0.tgz", + "integrity": "sha1-597mbjXW/Bb3EP6R1c9p9w8IkR0=", + "dev": true + }, + "json-schema": { + "version": "0.2.3", + "resolved": "https://registry.npmjs.org/json-schema/-/json-schema-0.2.3.tgz", + "integrity": "sha1-tIDIkuWaLwWVTOcnvT8qTogvnhM=", + "dev": true, + "optional": true + }, + "json-stable-stringify": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/json-stable-stringify/-/json-stable-stringify-1.0.1.tgz", + "integrity": "sha1-mnWdOcXy/1A/1TAGRu1EX4jE+a8=", + "dev": true + }, + "json-stringify-safe": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/json-stringify-safe/-/json-stringify-safe-5.0.1.tgz", + "integrity": "sha1-Epai1Y/UXxmg9s4B1lcB4sc1tus=", + "dev": true, + "optional": true + }, + "json3": { + "version": "3.3.2", + "resolved": "https://registry.npmjs.org/json3/-/json3-3.3.2.tgz", + "integrity": "sha1-PAQ0dD35Pi9cQq7nsZvLSDV19OE=", + "dev": true + }, + "json5": { + "version": "0.5.1", + "resolved": "https://registry.npmjs.org/json5/-/json5-0.5.1.tgz", + "integrity": "sha1-Hq3nrMASA0rYTiOWdn6tn6VJWCE=", + "dev": true + }, + "jsonfile": { + "version": "2.4.0", + "resolved": "https://registry.npmjs.org/jsonfile/-/jsonfile-2.4.0.tgz", + "integrity": "sha1-NzaitCi4e72gzIO1P6PWM6NcKug=", + "dev": true + }, + "jsonify": { + "version": "0.0.0", + "resolved": "https://registry.npmjs.org/jsonify/-/jsonify-0.0.0.tgz", + "integrity": "sha1-LHS27kHZPKUbe1qu6PUDYx0lKnM=", + "dev": true + }, + "jsonpointer": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/jsonpointer/-/jsonpointer-4.0.1.tgz", + "integrity": "sha1-T9kss04OnbPInIYi7PUfm5eMbLk=", + "dev": true + }, + "jsprim": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/jsprim/-/jsprim-1.4.0.tgz", + "integrity": "sha1-o7h+QCmNjDgFUtjMdiigu5WiKRg=", + "dev": true, + "optional": true, + "dependencies": { + "assert-plus": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/assert-plus/-/assert-plus-1.0.0.tgz", + "integrity": "sha1-8S4PPF13sLHN2RRpQuTpbB5N1SU=", + "dev": true, + "optional": true + } + } + }, + "kind-of": { + "version": "3.2.2", + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", + "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=", + "dev": true + }, + "klaw": { + "version": "1.3.1", + "resolved": "https://registry.npmjs.org/klaw/-/klaw-1.3.1.tgz", + "integrity": "sha1-QIhDO0azsbolnXh4XY6W9zugJDk=", + "dev": true + }, + "lazy-cache": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/lazy-cache/-/lazy-cache-1.0.4.tgz", + "integrity": "sha1-odePw6UEdMuAhF07O24dpJpEbo4=", + "dev": true + }, + "levn": { + "version": "0.3.0", + "resolved": "https://registry.npmjs.org/levn/-/levn-0.3.0.tgz", + "integrity": "sha1-OwmSTt+fCDwEkP3UwLxEIeBHZO4=", + "dev": true + }, + "load-json-file": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/load-json-file/-/load-json-file-2.0.0.tgz", + "integrity": "sha1-eUfkIUmvgNaWy/eXvKq8/h/inKg=", + "dev": true + }, + "locate-path": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-2.0.0.tgz", + "integrity": "sha1-K1aLJl7slExtnA3pw9u7ygNUzY4=", + "dev": true, + "dependencies": { + "path-exists": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-3.0.0.tgz", + "integrity": "sha1-zg6+ql94yxiSXqfYENe1mwEP1RU=", + "dev": true + } + } + }, + "lodash": { + "version": "4.17.4", + "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.4.tgz", + "integrity": "sha1-eCA6TRwyiuHYbcpkYONptX9AVa4=", + "dev": true + }, + "lodash._baseassign": { + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/lodash._baseassign/-/lodash._baseassign-3.2.0.tgz", + "integrity": "sha1-jDigmVAPIVrQnlnxci/QxSv+Ck4=", + "dev": true + }, + "lodash._basecopy": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/lodash._basecopy/-/lodash._basecopy-3.0.1.tgz", + "integrity": "sha1-jaDmqHbPNEwK2KVIghEd08XHyjY=", + "dev": true + }, + "lodash._basecreate": { + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/lodash._basecreate/-/lodash._basecreate-3.0.3.tgz", + "integrity": "sha1-G8ZhYU2qf8MRt9A78WgGoCE8+CE=", + "dev": true + }, + "lodash._getnative": { + "version": "3.9.1", + "resolved": "https://registry.npmjs.org/lodash._getnative/-/lodash._getnative-3.9.1.tgz", + "integrity": "sha1-VwvH3t5G1hzc3mh9ZdPuy6o6r/U=", + "dev": true + }, + "lodash._isiterateecall": { + "version": "3.0.9", + "resolved": "https://registry.npmjs.org/lodash._isiterateecall/-/lodash._isiterateecall-3.0.9.tgz", + "integrity": "sha1-UgOte6Ql+uhCRg5pbbnPPmqsBXw=", + "dev": true + }, + "lodash.assignin": { + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/lodash.assignin/-/lodash.assignin-4.2.0.tgz", + "integrity": "sha1-uo31+4QesKPoBEIysOJjqNxqKKI=", + "dev": true + }, + "lodash.bind": { + "version": "4.2.1", + "resolved": "https://registry.npmjs.org/lodash.bind/-/lodash.bind-4.2.1.tgz", + "integrity": "sha1-euMBfpOWIqwxt9fX3LGzTbFpDTU=", + "dev": true + }, + "lodash.cond": { + "version": "4.5.2", + "resolved": "https://registry.npmjs.org/lodash.cond/-/lodash.cond-4.5.2.tgz", + "integrity": "sha1-9HGh2khr5g9quVXRcRVSPdHSVdU=", + "dev": true + }, + "lodash.create": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/lodash.create/-/lodash.create-3.1.1.tgz", + "integrity": "sha1-1/KEnw29p+BGgruM1yqwIkYd6+c=", + "dev": true + }, + "lodash.defaults": { + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/lodash.defaults/-/lodash.defaults-4.2.0.tgz", + "integrity": "sha1-0JF4cW/+pN3p5ft7N/bwgCJ0WAw=", + "dev": true + }, + "lodash.filter": { + "version": "4.6.0", + "resolved": "https://registry.npmjs.org/lodash.filter/-/lodash.filter-4.6.0.tgz", + "integrity": "sha1-ZosdSYFgOuHMWm+nYBQ+SAtMSs4=", + "dev": true + }, + "lodash.flatten": { + "version": "4.4.0", + "resolved": "https://registry.npmjs.org/lodash.flatten/-/lodash.flatten-4.4.0.tgz", + "integrity": "sha1-8xwiIlqWMtK7+OSt2+8kCqdlph8=", + "dev": true + }, + "lodash.foreach": { + "version": "4.5.0", + "resolved": "https://registry.npmjs.org/lodash.foreach/-/lodash.foreach-4.5.0.tgz", + "integrity": "sha1-Gmo16s5AEoDH8G3d7DUWWrJ+PlM=", + "dev": true + }, + "lodash.isarguments": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/lodash.isarguments/-/lodash.isarguments-3.1.0.tgz", + "integrity": "sha1-L1c9hcaiQon/AGY7SRwdM4/zRYo=", + "dev": true + }, + "lodash.isarray": { + "version": "3.0.4", + "resolved": "https://registry.npmjs.org/lodash.isarray/-/lodash.isarray-3.0.4.tgz", + "integrity": "sha1-eeTriMNqgSKvhvhEqpvNhRtfu1U=", + "dev": true + }, + "lodash.keys": { + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/lodash.keys/-/lodash.keys-3.1.2.tgz", + "integrity": "sha1-TbwEcrFWvlCgsoaFXRvQsMZWCYo=", + "dev": true + }, + "lodash.map": { + "version": "4.6.0", + "resolved": "https://registry.npmjs.org/lodash.map/-/lodash.map-4.6.0.tgz", + "integrity": "sha1-dx7Hg540c9nEzeKLGTlMNWL09tM=", + "dev": true + }, + "lodash.merge": { + "version": "4.6.0", + "resolved": "https://registry.npmjs.org/lodash.merge/-/lodash.merge-4.6.0.tgz", + "integrity": "sha1-aYhLoUSsM/5plzemCG3v+t0PicU=", + "dev": true + }, + "lodash.pick": { + "version": "4.4.0", + "resolved": "https://registry.npmjs.org/lodash.pick/-/lodash.pick-4.4.0.tgz", + "integrity": "sha1-UvBWEP/53tQiYRRB7R/BI6AwAbM=", + "dev": true + }, + "lodash.reduce": { + "version": "4.6.0", + "resolved": "https://registry.npmjs.org/lodash.reduce/-/lodash.reduce-4.6.0.tgz", + "integrity": "sha1-8atrg5KZrUj3hKu/R2WW8DuRTTs=", + "dev": true + }, + "lodash.reject": { + "version": "4.6.0", + "resolved": "https://registry.npmjs.org/lodash.reject/-/lodash.reject-4.6.0.tgz", + "integrity": "sha1-gNZJLcFHCGS79YNTO2UfQqn1JBU=", + "dev": true + }, + "lodash.some": { + "version": "4.6.0", + "resolved": "https://registry.npmjs.org/lodash.some/-/lodash.some-4.6.0.tgz", + "integrity": "sha1-G7nzFO9ri63tE7VJFpsqlF62jk0=", + "dev": true + }, + "longest": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/longest/-/longest-1.0.1.tgz", + "integrity": "sha1-MKCy2jj3N3DoKUoNIuZiXtd9AJc=", + "dev": true + }, + "loose-envify": { + "version": "1.3.1", + "resolved": "https://registry.npmjs.org/loose-envify/-/loose-envify-1.3.1.tgz", + "integrity": "sha1-0aitM/qc4OcT1l/dCsi3SNR4yEg=", + "dev": true + }, + "magic-string": { + "version": "0.16.0", + "resolved": "https://registry.npmjs.org/magic-string/-/magic-string-0.16.0.tgz", + "integrity": "sha1-lw67DacZMwEoX7GqZQ85vdgetFo=", + "dev": true + }, + "marked": { + "version": "0.3.6", + "resolved": "https://registry.npmjs.org/marked/-/marked-0.3.6.tgz", + "integrity": "sha1-ssbGGPzOzk74bE/Gy4p8v1rtqNc=", + "dev": true + }, + "mime-db": { + "version": "1.27.0", + "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.27.0.tgz", + "integrity": "sha1-gg9XIpa70g7CXtVeW13oaeVDbrE=", + "dev": true + }, + "mime-types": { + "version": "2.1.15", + "resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.15.tgz", + "integrity": "sha1-pOv1BkCUVpI3uM9wBGd20J/JKu0=", + "dev": true + }, + "minimatch": { + "version": "3.0.4", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.0.4.tgz", + "integrity": "sha512-yJHVQEhyqPLUTgt9B83PXu6W3rx4MvvHvSUvToogpwoGDOUQ+yDrR0HRot+yOCdCO7u4hX3pWft6kWBBcqh0UA==", + "dev": true + }, + "minimist": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.0.tgz", + "integrity": "sha1-o1AIsg9BOD7sH7kU9M1d95omQoQ=", + "dev": true + }, + "mkdirp": { + "version": "0.5.1", + "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-0.5.1.tgz", + "integrity": "sha1-MAV0OOrGz3+MR2fzhkjWaX11yQM=", + "dev": true, + "dependencies": { + "minimist": { + "version": "0.0.8", + "resolved": "https://registry.npmjs.org/minimist/-/minimist-0.0.8.tgz", + "integrity": "sha1-hX/Kv8M5fSYluCKCYuhqp6ARsF0=", + "dev": true + } + } + }, + "mocha": { + "version": "3.4.2", + "resolved": "https://registry.npmjs.org/mocha/-/mocha-3.4.2.tgz", + "integrity": "sha1-0O9NMyEm2/GNDWQMmzgt1IvpdZQ=", + "dev": true, + "dependencies": { + "debug": { + "version": "2.6.0", + "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.0.tgz", + "integrity": "sha1-vFlryr52F/Edn6FTYe3tVgi4SZs=", + "dev": true + }, + "glob": { + "version": "7.1.1", + "resolved": "https://registry.npmjs.org/glob/-/glob-7.1.1.tgz", + "integrity": "sha1-gFIR3wT6rxxjo2ADBs31reULLsg=", + "dev": true + }, + "ms": { + "version": "0.7.2", + "resolved": "https://registry.npmjs.org/ms/-/ms-0.7.2.tgz", + "integrity": "sha1-riXPJRKziFodldfwN4aNhDESR2U=", + "dev": true + }, + "supports-color": { + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-3.1.2.tgz", + "integrity": "sha1-cqJiiU2dQIuVbKBf83su2KbiotU=", + "dev": true + } + } + }, + "ms": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", + "integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=", + "dev": true + }, + "mute-stream": { + "version": "0.0.5", + "resolved": "https://registry.npmjs.org/mute-stream/-/mute-stream-0.0.5.tgz", + "integrity": "sha1-j7+rsKmKJT0xhDMfno3rc3L6xsA=", + "dev": true + }, + "natural-compare": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/natural-compare/-/natural-compare-1.4.0.tgz", + "integrity": "sha1-Sr6/7tdUHywnrPspvbvRXI1bpPc=", + "dev": true + }, + "normalize-package-data": { + "version": "2.3.8", + "resolved": "https://registry.npmjs.org/normalize-package-data/-/normalize-package-data-2.3.8.tgz", + "integrity": "sha1-2Bntoqne29H/pWPqQHHZNngilbs=", + "dev": true + }, + "nth-check": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/nth-check/-/nth-check-1.0.1.tgz", + "integrity": "sha1-mSms32KPwsQQmN6rgqxYDPFJquQ=", + "dev": true + }, + "number-is-nan": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/number-is-nan/-/number-is-nan-1.0.1.tgz", + "integrity": "sha1-CXtgK1NCKlIsGvuHkDGDNpQaAR0=", + "dev": true + }, + "nwmatcher": { + "version": "1.4.1", + "resolved": "https://registry.npmjs.org/nwmatcher/-/nwmatcher-1.4.1.tgz", + "integrity": "sha1-eumwew6oBNt+JfBctf5Al9TklJ8=", + "dev": true, + "optional": true + }, + "oauth-sign": { + "version": "0.8.2", + "resolved": "https://registry.npmjs.org/oauth-sign/-/oauth-sign-0.8.2.tgz", + "integrity": "sha1-Rqarfwrq2N6unsBWV4C31O/rnUM=", + "dev": true, + "optional": true + }, + "object-assign": { + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/object-assign/-/object-assign-4.1.1.tgz", + "integrity": "sha1-IQmtx5ZYh8/AXLvUQsrIv7s2CGM=", + "dev": true + }, + "once": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz", + "integrity": "sha1-WDsap3WWHUsROsF9nFC6753Xa9E=", + "dev": true + }, + "onetime": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/onetime/-/onetime-1.1.0.tgz", + "integrity": "sha1-ofeDj4MUxRbwXs78vEzP4EtO14k=", + "dev": true + }, + "optionator": { + "version": "0.8.2", + "resolved": "https://registry.npmjs.org/optionator/-/optionator-0.8.2.tgz", + "integrity": "sha1-NkxeQJ0/TWMB1sC0wFu6UBgK62Q=", + "dev": true + }, + "options": { + "version": "0.0.6", + "resolved": "https://registry.npmjs.org/options/-/options-0.0.6.tgz", + "integrity": "sha1-7CLTEoBrtT5zF3Pnza788cZDEo8=" + }, + "os-homedir": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/os-homedir/-/os-homedir-1.0.2.tgz", + "integrity": "sha1-/7xJiDNuDoM94MFox+8VISGqf7M=", + "dev": true + }, + "os-tmpdir": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/os-tmpdir/-/os-tmpdir-1.0.2.tgz", + "integrity": "sha1-u+Z0BseaqFxc/sdm/lc0VV36EnQ=", + "dev": true + }, + "p-limit": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-1.1.0.tgz", + "integrity": "sha1-sH/y2aXYi+yAYDWJWiurZqJ5iLw=", + "dev": true + }, + "p-locate": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-2.0.0.tgz", + "integrity": "sha1-IKAQOyIqcMj9OcwuWAaA893l7EM=", + "dev": true + }, + "parse-json": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/parse-json/-/parse-json-2.2.0.tgz", + "integrity": "sha1-9ID0BDTvgHQfhGkJn43qGPVaTck=", + "dev": true + }, + "parse5": { + "version": "1.5.1", + "resolved": "https://registry.npmjs.org/parse5/-/parse5-1.5.1.tgz", + "integrity": "sha1-m387DeMr543CQBsXVzzK8Pb1nZQ=", + "dev": true, + "optional": true + }, + "path-exists": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-2.1.0.tgz", + "integrity": "sha1-D+tsZPD8UY2adU3V77YscCJ2H0s=", + "dev": true + }, + "path-is-absolute": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz", + "integrity": "sha1-F0uSaHNVNP+8es5r9TpanhtcX18=", + "dev": true + }, + "path-is-inside": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/path-is-inside/-/path-is-inside-1.0.2.tgz", + "integrity": "sha1-NlQX3t5EQw0cEa9hAn+s8HS9/FM=", + "dev": true + }, + "path-parse": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/path-parse/-/path-parse-1.0.5.tgz", + "integrity": "sha1-PBrfhx6pzWyUMbbqK9dKD/BVxME=", + "dev": true + }, + "path-type": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/path-type/-/path-type-2.0.0.tgz", + "integrity": "sha1-8BLMuEFbcJb8LaoQVMPXI4lZTHM=", + "dev": true + }, + "performance-now": { + "version": "0.2.0", + "resolved": "https://registry.npmjs.org/performance-now/-/performance-now-0.2.0.tgz", + "integrity": "sha1-M+8wxcd9TqIcWlOGnZG1bY8lVeU=", + "dev": true, + "optional": true + }, + "pify": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/pify/-/pify-2.3.0.tgz", + "integrity": "sha1-7RQaasBDqEnqWISY59yosVMw6Qw=", + "dev": true + }, + "pinkie": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/pinkie/-/pinkie-2.0.4.tgz", + "integrity": "sha1-clVrgM+g1IqXToDnckjoDtT3+HA=", + "dev": true + }, + "pinkie-promise": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/pinkie-promise/-/pinkie-promise-2.0.1.tgz", + "integrity": "sha1-ITXW36ejWMBprJsXh3YogihFD/o=", + "dev": true + }, + "pkg-dir": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/pkg-dir/-/pkg-dir-1.0.0.tgz", + "integrity": "sha1-ektQio1bstYp1EcFb/TpyTFM89Q=", + "dev": true + }, + "pluralize": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/pluralize/-/pluralize-1.2.1.tgz", + "integrity": "sha1-0aIUg/0iu0HlihL6NCGCMUCJfEU=", + "dev": true + }, + "prelude-ls": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/prelude-ls/-/prelude-ls-1.1.2.tgz", + "integrity": "sha1-IZMqVJ9eUv/ZqCf1cOBL5iqX2lQ=", + "dev": true + }, + "private": { + "version": "0.1.7", + "resolved": "https://registry.npmjs.org/private/-/private-0.1.7.tgz", + "integrity": "sha1-aM5eih7woju1cMwoU3tTMqumPvE=", + "dev": true + }, + "process-nextick-args": { + "version": "1.0.7", + "resolved": "https://registry.npmjs.org/process-nextick-args/-/process-nextick-args-1.0.7.tgz", + "integrity": "sha1-FQ4gt1ZZCtP5EJPyWk8q2L/zC6M=", + "dev": true + }, + "progress": { + "version": "1.1.8", + "resolved": "https://registry.npmjs.org/progress/-/progress-1.1.8.tgz", + "integrity": "sha1-4mDHj2Fhzdmw5WzD4Khd4Xx6V74=", + "dev": true + }, + "punycode": { + "version": "1.4.1", + "resolved": "https://registry.npmjs.org/punycode/-/punycode-1.4.1.tgz", + "integrity": "sha1-wNWmOycYgArY4esPpSachN1BhF4=", + "dev": true + }, + "qs": { + "version": "6.4.0", + "resolved": "https://registry.npmjs.org/qs/-/qs-6.4.0.tgz", + "integrity": "sha1-E+JtKK1rD/qpExLNO/cI7TUecjM=", + "dev": true, + "optional": true + }, + "ramda": { + "version": "0.21.0", + "resolved": "https://registry.npmjs.org/ramda/-/ramda-0.21.0.tgz", + "integrity": "sha1-oAGr7bP/YQd9T/HVd9RN536NCjU=", + "dev": true + }, + "read-pkg": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/read-pkg/-/read-pkg-2.0.0.tgz", + "integrity": "sha1-jvHAYjxqbbDcZxPEv6xGMysjaPg=", + "dev": true + }, + "read-pkg-up": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/read-pkg-up/-/read-pkg-up-2.0.0.tgz", + "integrity": "sha1-a3KoBImE4MQeeVEP1en6mbO1Sb4=", + "dev": true, + "dependencies": { + "find-up": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/find-up/-/find-up-2.1.0.tgz", + "integrity": "sha1-RdG35QbHF93UgndaK3eSCjwMV6c=", + "dev": true + } + } + }, + "readable-stream": { + "version": "2.3.2", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.2.tgz", + "integrity": "sha1-WgTfBeT1f+Pw3Gj90R3FyXx+b00=", + "dev": true + }, + "readline2": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/readline2/-/readline2-1.0.1.tgz", + "integrity": "sha1-QQWWCP/BVHV7cV2ZidGZ/783LjU=", + "dev": true + }, + "rechoir": { + "version": "0.6.2", + "resolved": "https://registry.npmjs.org/rechoir/-/rechoir-0.6.2.tgz", + "integrity": "sha1-hSBLVNuoLVdC4oyWdW70OvUOM4Q=", + "dev": true + }, + "regenerate": { + "version": "1.3.2", + "resolved": "https://registry.npmjs.org/regenerate/-/regenerate-1.3.2.tgz", + "integrity": "sha1-0ZQcZ7rUN+G+dkM63Vs4X5WxkmA=", + "dev": true + }, + "regenerator-runtime": { + "version": "0.10.5", + "resolved": "https://registry.npmjs.org/regenerator-runtime/-/regenerator-runtime-0.10.5.tgz", + "integrity": "sha1-M2w+/BIgrc7dosn6tntaeVWjNlg=", + "dev": true + }, + "regenerator-transform": { + "version": "0.9.11", + "resolved": "https://registry.npmjs.org/regenerator-transform/-/regenerator-transform-0.9.11.tgz", + "integrity": "sha1-On0GdSDLe3F2dp61/4aGkb7+EoM=", + "dev": true + }, + "regexpu-core": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/regexpu-core/-/regexpu-core-2.0.0.tgz", + "integrity": "sha1-SdA4g3uNz4v6W5pCE5k45uoq4kA=", + "dev": true + }, + "regjsgen": { + "version": "0.2.0", + "resolved": "https://registry.npmjs.org/regjsgen/-/regjsgen-0.2.0.tgz", + "integrity": "sha1-bAFq3qxVT3WCP+N6wFuS1aTtsfc=", + "dev": true + }, + "regjsparser": { + "version": "0.1.5", + "resolved": "https://registry.npmjs.org/regjsparser/-/regjsparser-0.1.5.tgz", + "integrity": "sha1-fuj4Tcb6eS0/0K4ijSS9lJ6tIFw=", + "dev": true + }, + "repeat-string": { + "version": "1.6.1", + "resolved": "https://registry.npmjs.org/repeat-string/-/repeat-string-1.6.1.tgz", + "integrity": "sha1-jcrkcOHIirwtYA//Sndihtp15jc=", + "dev": true + }, + "repeating": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/repeating/-/repeating-1.1.3.tgz", + "integrity": "sha1-PUEUIYh3U3SU+X93+Xhfq4EPpKw=", + "dev": true + }, + "request": { + "version": "2.81.0", + "resolved": "https://registry.npmjs.org/request/-/request-2.81.0.tgz", + "integrity": "sha1-xpKJRqDgbF+Nb4qTM0af/aRimKA=", + "dev": true, + "optional": true + }, + "require-relative": { + "version": "0.8.7", + "resolved": "https://registry.npmjs.org/require-relative/-/require-relative-0.8.7.tgz", + "integrity": "sha1-eZlTn8ngR6N5KPoZb44VY9q9Nt4=", + "dev": true + }, + "require-uncached": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/require-uncached/-/require-uncached-1.0.3.tgz", + "integrity": "sha1-Tg1W1slmL9MeQwEcS5WqSZVUIdM=", + "dev": true + }, + "resolve": { + "version": "1.3.3", + "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.3.3.tgz", + "integrity": "sha1-ZVkHw0aahoDcLeOidaj91paR8OU=", + "dev": true + }, + "resolve-from": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/resolve-from/-/resolve-from-1.0.1.tgz", + "integrity": "sha1-Jsv+k10a7uq7Kbw/5a6wHpPUQiY=", + "dev": true + }, + "restore-cursor": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/restore-cursor/-/restore-cursor-1.0.1.tgz", + "integrity": "sha1-NGYfRohjJ/7SmRR5FSJS35LapUE=", + "dev": true + }, + "right-align": { + "version": "0.1.3", + "resolved": "https://registry.npmjs.org/right-align/-/right-align-0.1.3.tgz", + "integrity": "sha1-YTObci/mo1FWiSENJOFMlhSGE+8=", + "dev": true + }, + "rimraf": { + "version": "2.6.1", + "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-2.6.1.tgz", + "integrity": "sha1-wjOOxkPfeht/5cVPqG9XQopV8z0=", + "dev": true + }, + "rollem": { + "version": "1.12.0", + "resolved": "https://registry.npmjs.org/rollem/-/rollem-1.12.0.tgz", + "integrity": "sha1-H9y6JVcWqZ0hjpWjUbXsX9UZFE8=", + "dev": true, + "dependencies": { + "debug": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/debug/-/debug-2.2.0.tgz", + "integrity": "sha1-+HBX6ZWxofauaklgZkE3vFbwOdo=", + "dev": true + }, + "ms": { + "version": "0.7.1", + "resolved": "https://registry.npmjs.org/ms/-/ms-0.7.1.tgz", + "integrity": "sha1-nNE8A62/8ltl7/3nzoZO6VIBcJg=", + "dev": true + }, + "rollup": { + "version": "0.41.4", + "resolved": "https://registry.npmjs.org/rollup/-/rollup-0.41.4.tgz", + "integrity": "sha1-qXBYAXYyn56thoVNf9TEbedSrvg=", + "dev": true + } + } + }, + "rollup": { + "version": "0.40.2", + "resolved": "https://registry.npmjs.org/rollup/-/rollup-0.40.2.tgz", + "integrity": "sha1-tZyDdzMvgovjiYMZLzNp5QL55Es=", + "dev": true + }, + "rollup-plugin-babel": { + "version": "2.7.1", + "resolved": "https://registry.npmjs.org/rollup-plugin-babel/-/rollup-plugin-babel-2.7.1.tgz", + "integrity": "sha1-FlKBl7D5OKFTb0RoPHqT1XMYL1c=", + "dev": true + }, + "rollup-plugin-cleanup": { + "version": "0.1.4", + "resolved": "https://registry.npmjs.org/rollup-plugin-cleanup/-/rollup-plugin-cleanup-0.1.4.tgz", + "integrity": "sha1-n+06tDAJiKiC1j3jMh5BDNr8YzE=", + "dev": true, + "dependencies": { + "acorn": { + "version": "3.3.0", + "resolved": "https://registry.npmjs.org/acorn/-/acorn-3.3.0.tgz", + "integrity": "sha1-ReN/s56No/JbruP/U2niu18iAXo=", + "dev": true + } + } + }, + "rollup-plugin-uglify": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/rollup-plugin-uglify/-/rollup-plugin-uglify-1.0.2.tgz", + "integrity": "sha1-1KpvXfE1Iurhuhd4DHxMcJYDg1k=", + "dev": true + }, + "rollup-pluginutils": { + "version": "1.5.2", + "resolved": "https://registry.npmjs.org/rollup-pluginutils/-/rollup-pluginutils-1.5.2.tgz", + "integrity": "sha1-HhVud4+UtyVb+hs9AXi+j1xVJAg=", + "dev": true + }, + "run-async": { + "version": "0.1.0", + "resolved": "https://registry.npmjs.org/run-async/-/run-async-0.1.0.tgz", + "integrity": "sha1-yK1KXhEGYeQCp9IbUw4AnyX444k=", + "dev": true + }, + "rx-lite": { + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/rx-lite/-/rx-lite-3.1.2.tgz", + "integrity": "sha1-Gc5QLKVyZl87ZHsQk5+X/RYV8QI=", + "dev": true + }, + "safe-buffer": { + "version": "5.1.1", + "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.1.tgz", + "integrity": "sha512-kKvNJn6Mm93gAczWVJg7wH+wGYWNrDHdWvpUmHyEsgCtIwwo3bqPtV4tR5tuPaUhTOo/kvhVwd8XwwOllGYkbg==", + "dev": true + }, + "sax": { + "version": "1.2.4", + "resolved": "https://registry.npmjs.org/sax/-/sax-1.2.4.tgz", + "integrity": "sha512-NqVDv9TpANUjFm0N8uM5GxL36UgKi9/atZw+x7YFnQ8ckwFGKrl4xX4yWtrey3UJm5nP1kUbnYgLopqWNSRhWw==", + "dev": true, + "optional": true + }, + "semver": { + "version": "5.3.0", + "resolved": "https://registry.npmjs.org/semver/-/semver-5.3.0.tgz", + "integrity": "sha1-myzl094C0XxgEq0yaqa00M9U+U8=", + "dev": true + }, + "shelljs": { + "version": "0.7.8", + "resolved": "https://registry.npmjs.org/shelljs/-/shelljs-0.7.8.tgz", + "integrity": "sha1-3svPh0sNHl+3LhSxZKloMEjprLM=", + "dev": true + }, + "slash": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/slash/-/slash-1.0.0.tgz", + "integrity": "sha1-xB8vbDn8FtHNF61LXYlhFK5HDVU=", + "dev": true + }, + "slice-ansi": { + "version": "0.0.4", + "resolved": "https://registry.npmjs.org/slice-ansi/-/slice-ansi-0.0.4.tgz", + "integrity": "sha1-7b+JA/ZvfOL46v1s7tZeJkyDGzU=", + "dev": true + }, + "sntp": { + "version": "1.0.9", + "resolved": "https://registry.npmjs.org/sntp/-/sntp-1.0.9.tgz", + "integrity": "sha1-ZUEYTMkK7qbG57NeJlkIJEPGYZg=", + "dev": true, + "optional": true + }, + "source-map": { + "version": "0.5.6", + "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.5.6.tgz", + "integrity": "sha1-dc449SvwczxafwwRjYEzSiu19BI=", + "dev": true + }, + "source-map-support": { + "version": "0.4.15", + "resolved": "https://registry.npmjs.org/source-map-support/-/source-map-support-0.4.15.tgz", + "integrity": "sha1-AyAt9lwG0r2MfsI2KhkwVv7407E=", + "dev": true + }, + "spdx-correct": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/spdx-correct/-/spdx-correct-1.0.2.tgz", + "integrity": "sha1-SzBz2TP/UfORLwOsVRlJikFQ20A=", + "dev": true + }, + "spdx-expression-parse": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/spdx-expression-parse/-/spdx-expression-parse-1.0.4.tgz", + "integrity": "sha1-m98vIOH0DtRH++JzJmGR/O1RYmw=", + "dev": true + }, + "spdx-license-ids": { + "version": "1.2.2", + "resolved": "https://registry.npmjs.org/spdx-license-ids/-/spdx-license-ids-1.2.2.tgz", + "integrity": "sha1-yd96NCRZSt5r0RkA1ZZpbcBrrFc=", + "dev": true + }, + "sprintf-js": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/sprintf-js/-/sprintf-js-1.0.3.tgz", + "integrity": "sha1-BOaSb2YolTVPPdAVIDYzuFcpfiw=", + "dev": true + }, + "sshpk": { + "version": "1.13.1", + "resolved": "https://registry.npmjs.org/sshpk/-/sshpk-1.13.1.tgz", + "integrity": "sha1-US322mKHFEMW3EwY/hzx2UBzm+M=", + "dev": true, + "optional": true, + "dependencies": { + "assert-plus": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/assert-plus/-/assert-plus-1.0.0.tgz", + "integrity": "sha1-8S4PPF13sLHN2RRpQuTpbB5N1SU=", + "dev": true, + "optional": true + } + } + }, + "string-width": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-1.0.2.tgz", + "integrity": "sha1-EYvfW4zcUaKn5w0hHgfisLmxB9M=", + "dev": true + }, + "string_decoder": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.0.3.tgz", + "integrity": "sha512-4AH6Z5fzNNBcH+6XDMfA/BTt87skxqJlO0lAh3Dker5zThcAxG6mKz+iGu308UKoPPQ8Dcqx/4JhujzltRa+hQ==", + "dev": true + }, + "stringstream": { + "version": "0.0.5", + "resolved": "https://registry.npmjs.org/stringstream/-/stringstream-0.0.5.tgz", + "integrity": "sha1-TkhM1N5aC7vuGORjB3EKioFiGHg=", + "dev": true, + "optional": true + }, + "strip-ansi": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-3.0.1.tgz", + "integrity": "sha1-ajhfuIU9lS1f8F0Oiq+UJ43GPc8=", + "dev": true + }, + "strip-bom": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/strip-bom/-/strip-bom-3.0.0.tgz", + "integrity": "sha1-IzTBjpx1n3vdVv3vfprj1YjmjtM=", + "dev": true + }, + "strip-json-comments": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-2.0.1.tgz", + "integrity": "sha1-PFMZQukIwml8DsNEhYwobHygpgo=", + "dev": true + }, + "supports-color": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-2.0.0.tgz", + "integrity": "sha1-U10EXOa2Nj+kARcIRimZXp3zJMc=", + "dev": true + }, + "symbol-tree": { + "version": "3.2.2", + "resolved": "https://registry.npmjs.org/symbol-tree/-/symbol-tree-3.2.2.tgz", + "integrity": "sha1-rifbOPZgp64uHDt9G8KQgZuFGeY=", + "dev": true, + "optional": true + }, + "table": { + "version": "3.8.3", + "resolved": "https://registry.npmjs.org/table/-/table-3.8.3.tgz", + "integrity": "sha1-K7xULw/amGGnVdOUf+/Ys/UThV8=", + "dev": true, + "dependencies": { + "is-fullwidth-code-point": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-2.0.0.tgz", + "integrity": "sha1-o7MKXE8ZkYMWeqq5O+764937ZU8=", + "dev": true + }, + "string-width": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-2.0.0.tgz", + "integrity": "sha1-Y1xUNsxypuDDh87KJ41OLuxSaH4=", + "dev": true + } + } + }, + "taffydb": { + "version": "2.7.2", + "resolved": "https://registry.npmjs.org/taffydb/-/taffydb-2.7.2.tgz", + "integrity": "sha1-e/gQalwaSCUbPjvAoOFzJIn9Dcg=", + "dev": true + }, + "text-table": { + "version": "0.2.0", + "resolved": "https://registry.npmjs.org/text-table/-/text-table-0.2.0.tgz", + "integrity": "sha1-f17oI66AUgfACvLfSoTsP8+lcLQ=", + "dev": true + }, + "through": { + "version": "2.3.8", + "resolved": "https://registry.npmjs.org/through/-/through-2.3.8.tgz", + "integrity": "sha1-DdTJ/6q8NXlgsbckEV1+Doai4fU=", + "dev": true + }, + "to-fast-properties": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/to-fast-properties/-/to-fast-properties-1.0.3.tgz", + "integrity": "sha1-uDVx+k2MJbguIxsG46MFXeTKGkc=", + "dev": true + }, + "tough-cookie": { + "version": "2.3.2", + "resolved": "https://registry.npmjs.org/tough-cookie/-/tough-cookie-2.3.2.tgz", + "integrity": "sha1-8IH3bkyFcg5sN6X6ztc3FQ2EByo=", + "dev": true + }, + "tr46": { + "version": "0.0.3", + "resolved": "https://registry.npmjs.org/tr46/-/tr46-0.0.3.tgz", + "integrity": "sha1-gYT9NH2snNwYWZLzpmIuFLnZq2o=", + "dev": true, + "optional": true + }, + "trim-right": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/trim-right/-/trim-right-1.0.1.tgz", + "integrity": "sha1-yy4SAwZ+DI3h9hQJS5/kVwTqYAM=", + "dev": true + }, + "tryit": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/tryit/-/tryit-1.0.3.tgz", + "integrity": "sha1-OTvnMKlEb9Hq1tpZoBQwjzbCics=", + "dev": true + }, + "tunnel-agent": { + "version": "0.6.0", + "resolved": "https://registry.npmjs.org/tunnel-agent/-/tunnel-agent-0.6.0.tgz", + "integrity": "sha1-J6XeoGs2sEoKmWZ3SykIaPD8QP0=", + "dev": true, + "optional": true + }, + "tweetnacl": { + "version": "0.14.5", + "resolved": "https://registry.npmjs.org/tweetnacl/-/tweetnacl-0.14.5.tgz", + "integrity": "sha1-WuaBd/GS1EViadEIr6k/+HQ/T2Q=", + "dev": true, + "optional": true + }, + "type-check": { + "version": "0.3.2", + "resolved": "https://registry.npmjs.org/type-check/-/type-check-0.3.2.tgz", + "integrity": "sha1-WITKtRLPHTVeP7eE8wgEsrUg23I=", + "dev": true + }, + "type-detect": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/type-detect/-/type-detect-1.0.0.tgz", + "integrity": "sha1-diIXzAbbJY7EiQihKY6LlRIejqI=", + "dev": true + }, + "typedarray": { + "version": "0.0.6", + "resolved": "https://registry.npmjs.org/typedarray/-/typedarray-0.0.6.tgz", + "integrity": "sha1-hnrHTjhkGHsdPUfZlqeOxciDB3c=", + "dev": true + }, + "uglify-js": { + "version": "2.8.29", + "resolved": "https://registry.npmjs.org/uglify-js/-/uglify-js-2.8.29.tgz", + "integrity": "sha1-KcVzMUgFe7Th913zW3qcty5qWd0=", + "dev": true + }, + "uglify-to-browserify": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/uglify-to-browserify/-/uglify-to-browserify-1.0.2.tgz", + "integrity": "sha1-bgkk1r2mta/jSeOabWMoUKD4grc=", + "dev": true, + "optional": true + }, + "ultron": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/ultron/-/ultron-1.0.2.tgz", + "integrity": "sha1-rOEWq1V80Zc4ak6I9GhTeMiy5Po=" + }, + "user-home": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/user-home/-/user-home-2.0.0.tgz", + "integrity": "sha1-nHC/2Babwdy/SGBODwS4tJzenp8=", + "dev": true + }, + "util-deprecate": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz", + "integrity": "sha1-RQ1Nyfpw3nMnYvvS1KKJgUGaDM8=", + "dev": true + }, + "uuid": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/uuid/-/uuid-3.1.0.tgz", + "integrity": "sha512-DIWtzUkw04M4k3bf1IcpS2tngXEL26YUD2M0tMDUpnUrz2hgzUBlD55a4FjdLGPvfHxS6uluGWvaVEqgBcVa+g==", + "dev": true, + "optional": true + }, + "validate-npm-package-license": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/validate-npm-package-license/-/validate-npm-package-license-3.0.1.tgz", + "integrity": "sha1-KAS6vnEq0zeUWaz74kdGqywwP7w=", + "dev": true + }, + "verror": { + "version": "1.3.6", + "resolved": "https://registry.npmjs.org/verror/-/verror-1.3.6.tgz", + "integrity": "sha1-z/XfEpRtKX0rqu+qJoniW+AcAFw=", + "dev": true, + "optional": true + }, + "vlq": { + "version": "0.2.2", + "resolved": "https://registry.npmjs.org/vlq/-/vlq-0.2.2.tgz", + "integrity": "sha1-4xbVJXtAuGu0PLjV/qXX9U1rDKE=", + "dev": true + }, + "webidl-conversions": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/webidl-conversions/-/webidl-conversions-2.0.1.tgz", + "integrity": "sha1-O/glj30xjHRDw28uFpQCoaZwNQY=", + "dev": true, + "optional": true + }, + "whatwg-url-compat": { + "version": "0.6.5", + "resolved": "https://registry.npmjs.org/whatwg-url-compat/-/whatwg-url-compat-0.6.5.tgz", + "integrity": "sha1-AImBEa9om7CXVBzVpFymyHmERb8=", + "dev": true, + "optional": true + }, + "window-size": { + "version": "0.1.0", + "resolved": "https://registry.npmjs.org/window-size/-/window-size-0.1.0.tgz", + "integrity": "sha1-VDjNLqk7IC76Ohn+iIeu58lPnJ0=", + "dev": true + }, + "wordwrap": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/wordwrap/-/wordwrap-1.0.0.tgz", + "integrity": "sha1-J1hIEIkUVqQXHI0CJkQa3pDLyus=", + "dev": true + }, + "wrappy": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz", + "integrity": "sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8=", + "dev": true + }, + "write": { + "version": "0.2.1", + "resolved": "https://registry.npmjs.org/write/-/write-0.2.1.tgz", + "integrity": "sha1-X8A4KOJkzqP+kUVUdvejxWbLB1c=", + "dev": true + }, + "ws": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/ws/-/ws-1.1.4.tgz", + "integrity": "sha1-V/QNA2gy5fUFVmKjl8Tedu1mv2E=" + }, + "xml-name-validator": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/xml-name-validator/-/xml-name-validator-2.0.1.tgz", + "integrity": "sha1-TYuPHszTQZqjYgYb7O9RXh5VljU=", + "dev": true, + "optional": true + }, + "xtend": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/xtend/-/xtend-4.0.1.tgz", + "integrity": "sha1-pcbVMr5lbiPbgg77lDofBJmNY68=", + "dev": true + }, + "yargs": { + "version": "3.10.0", + "resolved": "https://registry.npmjs.org/yargs/-/yargs-3.10.0.tgz", + "integrity": "sha1-9+572FfdfB0tOMDnTvvWgdFDH9E=", + "dev": true + } + } +} diff --git a/package.json b/package.json index e42ce9b..4a5d18f 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "osc-js", - "version": "1.0.2", + "version": "1.0.3", "description": "OSC library for Node.js and the browser, with customizable Plugin API for WebSocket, UDP or bridge networking", "main": "lib/osc.js", "scripts": { diff --git a/src/plugin/wsserver.js b/src/plugin/wsserver.js index ba0a343..01c229c 100644 --- a/src/plugin/wsserver.js +++ b/src/plugin/wsserver.js @@ -106,16 +106,11 @@ export default class WebsocketServerPlugin { this.socketStatus = STATUS.IS_CONNECTING // register events - this.socket.on('open', () => { + this.socket.on('listening', () => { this.socketStatus = STATUS.IS_OPEN this.notify('open') }) - this.socket.on('close', () => { - this.socketStatus = STATUS.IS_CLOSED - this.notify('close') - }) - this.socket.on('error', (error) => { this.notify('error', error) }) @@ -132,7 +127,10 @@ export default class WebsocketServerPlugin { */ close() { this.socketStatus = STATUS.IS_CLOSING - this.socket.close() + this.socket.close(() => { + this.socketStatus = STATUS.IS_CLOSED + this.notify('close') + }) } /**