From d737fda1ccfc798fe316ef1b0120a7d63e7489d5 Mon Sep 17 00:00:00 2001 From: Juanjo Diaz Date: Sat, 27 Jan 2018 20:47:24 -0800 Subject: [PATCH] Add eslint and refactor to ES6 --- .eslintrc | 10 + app/error-handler.js | 10 +- app/localization.js | 84 +- app/ui.js | 451 +-- app/webutil.js | 103 +- core/base64.js | 72 +- core/des.js | 68 +- core/display.js | 569 ++- core/encodings.js | 2 +- core/inflator.js | 28 +- core/input/domkeytable.js | 2 +- core/input/keyboard.js | 148 +- core/input/keysymdef.js | 6 +- core/input/mouse.js | 133 +- core/input/util.js | 30 +- core/input/xtscancodes.js | 326 +- core/rfb.js | 1176 +++--- core/util/browsers.js | 34 +- core/util/events.js | 35 +- core/util/eventtarget.js | 24 +- core/util/logging.js | 22 +- core/util/polyfill.js | 19 +- core/util/strings.js | 3 +- core/websock.js | 261 +- docs/API.md | 2 +- karma.conf.js | 34 +- package-lock.json | 6634 +++++++++++++++++++++++++++++++ package.json | 4 +- tests/.eslintrc | 9 + tests/assertions.js | 44 +- tests/fake.websocket.js | 70 +- tests/karma-test-main.js | 8 +- tests/playback-ui.js | 21 +- tests/playback.js | 44 +- tests/test.base64.js | 15 +- tests/test.display.js | 76 +- tests/test.helper.js | 9 +- tests/test.keyboard.js | 154 +- tests/test.localization.js | 14 +- tests/test.mouse.js | 68 +- tests/test.rfb.js | 408 +- tests/test.util.js | 7 +- tests/test.websock.js | 70 +- utils/.eslintrc | 8 + utils/genkeysymdef.js | 44 +- utils/use_require.js | 47 +- utils/use_require_helpers.js | 9 +- vendor/pako/lib/zlib/deflate.js | 4 +- 48 files changed, 8970 insertions(+), 2449 deletions(-) create mode 100644 .eslintrc create mode 100644 package-lock.json create mode 100644 tests/.eslintrc create mode 100644 utils/.eslintrc diff --git a/.eslintrc b/.eslintrc new file mode 100644 index 00000000..9d02cf65 --- /dev/null +++ b/.eslintrc @@ -0,0 +1,10 @@ +{ + "env": { + "browser": true, + "es6": true + }, + "parserOptions": { + "sourceType": "module", + }, + "extends": "eslint:recommended" +} diff --git a/app/error-handler.js b/app/error-handler.js index e5a6adbe..1988bb0f 100644 --- a/app/error-handler.js +++ b/app/error-handler.js @@ -9,14 +9,14 @@ // Fallback for all uncought errors function handleError (event, err) { try { - var msg = document.getElementById('noVNC_fallback_errormsg'); + const msg = document.getElementById('noVNC_fallback_errormsg'); // Only show the initial error if (msg.hasChildNodes()) { return false; } - var div = document.createElement("div"); + let div = document.createElement("div"); div.classList.add('noVNC_message'); div.appendChild(document.createTextNode(event.message)); msg.appendChild(div); @@ -24,7 +24,7 @@ if (event.filename) { div = document.createElement("div"); div.className = 'noVNC_location'; - var text = event.filename; + let text = event.filename; if (event.lineno !== undefined) { text += ":" + event.lineno; if (event.colno !== undefined) { @@ -51,6 +51,6 @@ // from being printed to the browser console. return false; } - window.addEventListener('error', function (evt) { handleError(evt, evt.error); }); - window.addEventListener('unhandledrejection', function (evt) { handleError(evt.reason, evt.reason); }); + window.addEventListener('error', evt => handleError(evt, evt.error)); + window.addEventListener('unhandledrejection', evt => handleError(evt.reason, evt.reason)); })(); diff --git a/app/localization.js b/app/localization.js index c43d407a..cd4a2cf7 100644 --- a/app/localization.js +++ b/app/localization.js @@ -10,18 +10,17 @@ * Localization Utilities */ -export function Localizer() { - // Currently configured language - this.language = 'en'; +export class Localizer{ + constructor() { + // Currently configured language + this.language = 'en'; - // Current dictionary of translations - this.dictionary = undefined; -} + // Current dictionary of translations + this.dictionary = undefined; + } -Localizer.prototype = { // Configure suitable language based on user preferences - setup: function (supportedLanguages) { - var userLanguages; + setup(supportedLanguages) { this.language = 'en'; // Default: US English @@ -29,17 +28,16 @@ Localizer.prototype = { * Navigator.languages only available in Chrome (32+) and FireFox (32+) * Fall back to navigator.language for other browsers */ - if (typeof window.navigator.languages == 'object') { - userLanguages = window.navigator.languages; - } else { - userLanguages = [navigator.language || navigator.userLanguage]; - } - for (var i = 0;i < userLanguages.length;i++) { - var userLang = userLanguages[i]; - userLang = userLang.toLowerCase(); - userLang = userLang.replace("_", "-"); - userLang = userLang.split("-"); + const userLanguages = (typeof window.navigator.languages == 'object') + ? window.navigator.languages + : [navigator.language || navigator.userLanguage]; + + for (let i = 0;i < userLanguages.length;i++) { + const userLang = userLanguages[i] + .toLowerCase() + .replace("_", "-") + .split("-"); // Built-in default? if ((userLang[0] === 'en') && @@ -48,11 +46,11 @@ Localizer.prototype = { } // First pass: perfect match - for (var j = 0;j < supportedLanguages.length;j++) { - var supLang = supportedLanguages[j]; - supLang = supLang.toLowerCase(); - supLang = supLang.replace("_", "-"); - supLang = supLang.split("-"); + for (let j = 0;j < supportedLanguages.length;j++) { + const supLang = supportedLanguages[j] + .toLowerCase() + .replace("_", "-") + .split("-"); if (userLang[0] !== supLang[0]) continue; @@ -64,11 +62,11 @@ Localizer.prototype = { } // Second pass: fallback - for (var j = 0;j < supportedLanguages.length;j++) { - supLang = supportedLanguages[j]; - supLang = supLang.toLowerCase(); - supLang = supLang.replace("_", "-"); - supLang = supLang.split("-"); + for (let j = 0; j < supportedLanguages.length; j++) { + const supLang = supportedLanguages[j] + .toLowerCase() + .replace("_", "-") + .split("-"); if (userLang[0] !== supLang[0]) continue; @@ -79,36 +77,31 @@ Localizer.prototype = { return; } } - }, + } // Retrieve localised text - get: function (id) { + get(id) { if (typeof this.dictionary !== 'undefined' && this.dictionary[id]) { return this.dictionary[id]; } else { return id; } - }, + } // Traverses the DOM and translates relevant fields // See https://html.spec.whatwg.org/multipage/dom.html#attr-translate - translateDOM: function () { - var self = this; + translateDOM() { function process(elem, enabled) { function isAnyOf(searchElement, items) { return items.indexOf(searchElement) !== -1; } function translateAttribute(elem, attr) { - var str = elem.getAttribute(attr); - str = self.get(str); - elem.setAttribute(attr, str); + elem.setAttribute(attr, this.get(elem.getAttribute(attr))); } function translateTextNode(node) { - var str = node.data.trim(); - str = self.get(str); - node.data = str; + node.data = this.get(node.data.trim()); } if (elem.hasAttribute("translate")) { @@ -152,19 +145,18 @@ Localizer.prototype = { } } - for (var i = 0;i < elem.childNodes.length;i++) { - var node = elem.childNodes[i]; + elem.childNodes.forEach((node) => { if (node.nodeType === node.ELEMENT_NODE) { process(node, enabled); } else if (node.nodeType === node.TEXT_NODE && enabled) { translateTextNode(node); } - } + }); } process(document.body, true); - }, -}; + } +} -export var l10n = new Localizer(); +export let l10n = new Localizer(); export default l10n.get.bind(l10n); diff --git a/app/ui.js b/app/ui.js index 5fc1ce45..b296e303 100644 --- a/app/ui.js +++ b/app/ui.js @@ -8,9 +8,6 @@ * See README.md for usage and integration instructions. */ -/* jslint white: false, browser: true */ -/* global window, document.getElementById, Util, WebUtil, RFB, Display */ - import * as Log from '../core/util/logging.js'; import _, { l10n } from './localization.js'; import { isTouchDevice } from '../core/util/browsers.js'; @@ -19,10 +16,9 @@ import KeyTable from "../core/input/keysym.js"; import keysyms from "../core/input/keysymdef.js"; import Keyboard from "../core/input/keyboard.js"; import RFB from "../core/rfb.js"; -import Display from "../core/display.js"; import * as WebUtil from "./webutil.js"; -var UI = { +const UI = { connected: false, desktopName: "", @@ -45,7 +41,7 @@ var UI = { reconnect_callback: null, reconnect_password: null, - prime: function(callback) { + prime(callback) { if (document.readyState === "interactive" || document.readyState === "complete") { UI.load(callback); } else { @@ -55,12 +51,12 @@ var UI = { // Setup rfb object, load settings from browser storage, then call // UI.init to setup the UI/menus - load: function(callback) { + load(callback) { WebUtil.initSettings(UI.start, callback); }, // Render default UI and initialize settings menu - start: function(callback) { + start(callback) { // Setup global variables first UI.isSafari = (navigator.userAgent.indexOf('Safari') !== -1 && @@ -75,7 +71,7 @@ var UI = { if (isTouchDevice) { document.documentElement.classList.add("noVNC_touch"); // Remove the address bar - setTimeout(function() { window.scrollTo(0, 1); }, 100); + setTimeout(() => window.scrollTo(0, 1), 100); } // Restore control bar position @@ -105,7 +101,7 @@ var UI = { document.documentElement.classList.remove("noVNC_loading"); - var autoconnect = WebUtil.getConfigVar('autoconnect', false); + let autoconnect = WebUtil.getConfigVar('autoconnect', false); if (autoconnect === 'true' || autoconnect == '1') { autoconnect = true; UI.connect(); @@ -120,7 +116,7 @@ var UI = { } }, - initFullscreen: function() { + initFullscreen() { // Only show the button if fullscreen is properly supported // * Safari doesn't support alphanumerical input while in fullscreen if (!UI.isSafari && @@ -134,14 +130,12 @@ var UI = { } }, - initSettings: function() { - var i; - + initSettings() { // Logging selection dropdown - var llevels = ['error', 'warn', 'info', 'debug']; - for (i = 0; i < llevels.length; i += 1) { - UI.addOption(document.getElementById('noVNC_setting_logging'),llevels[i], llevels[i]); - } + const llevels = ['error', 'warn', 'info', 'debug']; + llevels.forEach(llevel => + UI.addOption(document.getElementById('noVNC_setting_logging'),llevel, llevel) + ); // Settings with immediate effects UI.initSetting('logging', 'warn'); @@ -149,7 +143,7 @@ var UI = { // if port == 80 (or 443) then it won't be present and should be // set manually - var port = window.location.port; + let port = window.location.port; if (!port) { if (window.location.protocol.substring(0,5) == 'https') { port = 443; @@ -175,24 +169,25 @@ var UI = { UI.setupSettingLabels(); }, // Adds a link to the label elements on the corresponding input elements - setupSettingLabels: function() { - var labels = document.getElementsByTagName('LABEL'); - for (var i = 0; i < labels.length; i++) { - var htmlFor = labels[i].htmlFor; + setupSettingLabels() { + const labels = document.getElementsByTagName('LABEL'); + labels.forEach((label) => { + const htmlFor = label.htmlFor; if (htmlFor != '') { - var elem = document.getElementById(htmlFor); - if (elem) elem.label = labels[i]; - } else { - // If 'for' isn't set, use the first input element child - var children = labels[i].children; - for (var j = 0; j < children.length; j++) { - if (children[j].form !== undefined) { - children[j].label = labels[i]; - break; - } + const elem = document.getElementById(htmlFor); + if (elem) elem.label = label; + return; + } + + // If 'for' isn't set, use the first input element child + const children = label.children; + for (let j = 0; j < children.length; j++) { + if (children[j].form !== undefined) { + children[j].label = label; + break; } } - } + }); }, /* ------^------- @@ -201,7 +196,7 @@ var UI = { * EVENT HANDLERS * ------v------*/ - addControlbarHandlers: function() { + addControlbarHandlers() { document.getElementById("noVNC_control_bar") .addEventListener('mousemove', UI.activateControlbar); document.getElementById("noVNC_control_bar") @@ -228,21 +223,21 @@ var UI = { // resize events aren't available for elements window.addEventListener('resize', UI.updateControlbarHandle); - var exps = document.getElementsByClassName("noVNC_expander"); - for (var i = 0;i < exps.length;i++) { - exps[i].addEventListener('click', UI.toggleExpander); - } + const exps = document.getElementsByClassName("noVNC_expander"); + exps.forEach(exp => + exp.addEventListener('click', UI.toggleExpander) + ); }, - addTouchSpecificHandlers: function() { + addTouchSpecificHandlers() { document.getElementById("noVNC_mouse_button0") - .addEventListener('click', function () { UI.setMouseButton(1); }); + .addEventListener('click', () => UI.setMouseButton(1)); document.getElementById("noVNC_mouse_button1") - .addEventListener('click', function () { UI.setMouseButton(2); }); + .addEventListener('click', () => UI.setMouseButton(2)); document.getElementById("noVNC_mouse_button2") - .addEventListener('click', function () { UI.setMouseButton(4); }); + .addEventListener('click', () => UI.setMouseButton(4)); document.getElementById("noVNC_mouse_button4") - .addEventListener('click', function () { UI.setMouseButton(0); }); + .addEventListener('click', () => UI.setMouseButton(0)); document.getElementById("noVNC_keyboard_button") .addEventListener('click', UI.toggleVirtualKeyboard); @@ -256,7 +251,7 @@ var UI = { document.getElementById("noVNC_keyboardinput") .addEventListener('blur', UI.onblurVirtualKeyboard); document.getElementById("noVNC_keyboardinput") - .addEventListener('submit', function () { return false; }); + .addEventListener('submit', () => false); document.documentElement .addEventListener('mousedown', UI.keepVirtualKeyboard, true); @@ -283,7 +278,7 @@ var UI = { .addEventListener('touchmove', UI.dragControlbarHandle); }, - addExtraKeysHandlers: function() { + addExtraKeysHandlers() { document.getElementById("noVNC_toggle_extra_keys_button") .addEventListener('click', UI.toggleExtraKeys); document.getElementById("noVNC_toggle_ctrl_button") @@ -298,18 +293,18 @@ var UI = { .addEventListener('click', UI.sendCtrlAltDel); }, - addMachineHandlers: function() { + addMachineHandlers() { document.getElementById("noVNC_shutdown_button") - .addEventListener('click', function() { UI.rfb.machineShutdown(); }); + .addEventListener('click', () => UI.rfb.machineShutdown()); document.getElementById("noVNC_reboot_button") - .addEventListener('click', function() { UI.rfb.machineReboot(); }); + .addEventListener('click', () => UI.rfb.machineReboot()); document.getElementById("noVNC_reset_button") - .addEventListener('click', function() { UI.rfb.machineReset(); }); + .addEventListener('click', () => UI.rfb.machineReset()); document.getElementById("noVNC_power_button") .addEventListener('click', UI.togglePowerPanel); }, - addConnectionControlHandlers: function() { + addConnectionControlHandlers() { document.getElementById("noVNC_disconnect_button") .addEventListener('click', UI.disconnect); document.getElementById("noVNC_connect_button") @@ -321,7 +316,7 @@ var UI = { .addEventListener('click', UI.setPassword); }, - addClipboardHandlers: function() { + addClipboardHandlers() { document.getElementById("noVNC_clipboard_button") .addEventListener('click', UI.toggleClipboardPanel); document.getElementById("noVNC_clipboard_text") @@ -332,15 +327,15 @@ var UI = { // Add a call to save settings when the element changes, // unless the optional parameter changeFunc is used instead. - addSettingChangeHandler: function(name, changeFunc) { - var settingElem = document.getElementById("noVNC_setting_" + name); + addSettingChangeHandler(name, changeFunc) { + const settingElem = document.getElementById("noVNC_setting_" + name); if (changeFunc === undefined) { - changeFunc = function () { UI.saveSetting(name); }; + changeFunc = () => UI.saveSetting(name); } settingElem.addEventListener('change', changeFunc); }, - addSettingsHandlers: function() { + addSettingsHandlers() { document.getElementById("noVNC_settings_button") .addEventListener('click', UI.toggleSettingsPanel); @@ -363,7 +358,7 @@ var UI = { UI.addSettingChangeHandler('reconnect_delay'); }, - addFullscreenHandlers: function() { + addFullscreenHandlers() { document.getElementById("noVNC_fullscreen_button") .addEventListener('click', UI.toggleFullscreen); @@ -380,7 +375,7 @@ var UI = { * ------v------*/ // Disable/enable controls depending on connection state - updateVisualState: function(state) { + updateVisualState(state) { document.documentElement.classList.remove("noVNC_connecting"); document.documentElement.classList.remove("noVNC_connected"); @@ -447,8 +442,8 @@ var UI = { .classList.remove('noVNC_open'); }, - showStatus: function(text, status_type, time) { - var statusElem = document.getElementById('noVNC_status'); + showStatus(text, status_type, time) { + const statusElem = document.getElementById('noVNC_status'); clearTimeout(UI.statusTimeout); @@ -508,12 +503,12 @@ var UI = { } }, - hideStatus: function() { + hideStatus() { clearTimeout(UI.statusTimeout); document.getElementById('noVNC_status').classList.remove("noVNC_open"); }, - activateControlbar: function(event) { + activateControlbar() { clearTimeout(UI.idleControlbarTimeout); // We manipulate the anchor instead of the actual control // bar in order to avoid creating new a stacking group @@ -522,27 +517,27 @@ var UI = { UI.idleControlbarTimeout = window.setTimeout(UI.idleControlbar, 2000); }, - idleControlbar: function() { + idleControlbar() { document.getElementById('noVNC_control_bar_anchor') .classList.add("noVNC_idle"); }, - keepControlbar: function() { + keepControlbar() { clearTimeout(UI.closeControlbarTimeout); }, - openControlbar: function() { + openControlbar() { document.getElementById('noVNC_control_bar') .classList.add("noVNC_open"); }, - closeControlbar: function() { + closeControlbar() { UI.closeAllPanels(); document.getElementById('noVNC_control_bar') .classList.remove("noVNC_open"); }, - toggleControlbar: function() { + toggleControlbar() { if (document.getElementById('noVNC_control_bar') .classList.contains("noVNC_open")) { UI.closeControlbar(); @@ -551,13 +546,13 @@ var UI = { } }, - toggleControlbarSide: function () { + toggleControlbarSide() { // Temporarily disable animation to avoid weird movement - var bar = document.getElementById('noVNC_control_bar'); + const bar = document.getElementById('noVNC_control_bar'); bar.style.transitionDuration = '0s'; bar.addEventListener('transitionend', function () { this.style.transitionDuration = ""; }); - var anchor = document.getElementById('noVNC_control_bar_anchor'); + const anchor = document.getElementById('noVNC_control_bar_anchor'); if (anchor.classList.contains("noVNC_right")) { WebUtil.writeSetting('controlbar_pos', 'left'); anchor.classList.remove("noVNC_right"); @@ -571,7 +566,7 @@ var UI = { }, showControlbarHint: function (show) { - var hint = document.getElementById('noVNC_control_bar_hint'); + const hint = document.getElementById('noVNC_control_bar_hint'); if (show) { hint.classList.add("noVNC_active"); } else { @@ -582,9 +577,9 @@ var UI = { dragControlbarHandle: function (e) { if (!UI.controlbarGrabbed) return; - var ptr = getPointerEvent(e); + const ptr = getPointerEvent(e); - var anchor = document.getElementById('noVNC_control_bar_anchor'); + const anchor = document.getElementById('noVNC_control_bar_anchor'); if (ptr.clientX < (window.innerWidth * 0.1)) { if (anchor.classList.contains("noVNC_right")) { UI.toggleControlbarSide(); @@ -598,15 +593,15 @@ var UI = { if (!UI.controlbarDrag) { // The goal is to trigger on a certain physical width, the // devicePixelRatio brings us a bit closer but is not optimal. - var dragThreshold = 10 * (window.devicePixelRatio || 1); - var dragDistance = Math.abs(ptr.clientY - UI.controlbarMouseDownClientY); + const dragThreshold = 10 * (window.devicePixelRatio || 1); + const dragDistance = Math.abs(ptr.clientY - UI.controlbarMouseDownClientY); if (dragDistance < dragThreshold) return; UI.controlbarDrag = true; } - var eventY = ptr.clientY - UI.controlbarMouseDownOffsetY; + const eventY = ptr.clientY - UI.controlbarMouseDownOffsetY; UI.moveControlbarHandle(eventY); @@ -617,19 +612,19 @@ var UI = { }, // Move the handle but don't allow any position outside the bounds - moveControlbarHandle: function (viewportRelativeY) { - var handle = document.getElementById("noVNC_control_bar_handle"); - var handleHeight = handle.getBoundingClientRect().height; - var controlbarBounds = document.getElementById("noVNC_control_bar") + moveControlbarHandle(viewportRelativeY) { + const handle = document.getElementById("noVNC_control_bar_handle"); + const handleHeight = handle.getBoundingClientRect().height; + const controlbarBounds = document.getElementById("noVNC_control_bar") .getBoundingClientRect(); - var margin = 10; + const margin = 10; // These heights need to be non-zero for the below logic to work if (handleHeight === 0 || controlbarBounds.height === 0) { return; } - var newY = viewportRelativeY; + let newY = viewportRelativeY; // Check if the coordinates are outside the control bar if (newY < controlbarBounds.top + margin) { @@ -650,19 +645,19 @@ var UI = { } // The transform needs coordinates that are relative to the parent - var parentRelativeY = newY - controlbarBounds.top; + const parentRelativeY = newY - controlbarBounds.top; handle.style.transform = "translateY(" + parentRelativeY + "px)"; }, - updateControlbarHandle: function () { + updateControlbarHandle() { // Since the control bar is fixed on the viewport and not the page, // the move function expects coordinates relative the the viewport. - var handle = document.getElementById("noVNC_control_bar_handle"); - var handleBounds = handle.getBoundingClientRect(); + const handle = document.getElementById("noVNC_control_bar_handle"); + const handleBounds = handle.getBoundingClientRect(); UI.moveControlbarHandle(handleBounds.top); }, - controlbarHandleMouseUp: function(e) { + controlbarHandleMouseUp(e) { if ((e.type == "mouseup") && (e.button != 0)) return; // mouseup and mousedown on the same place toggles the controlbar @@ -677,13 +672,13 @@ var UI = { UI.showControlbarHint(false); }, - controlbarHandleMouseDown: function(e) { + controlbarHandleMouseDown(e) { if ((e.type == "mousedown") && (e.button != 0)) return; - var ptr = getPointerEvent(e); + const ptr = getPointerEvent(e); - var handle = document.getElementById("noVNC_control_bar_handle"); - var bounds = handle.getBoundingClientRect(); + const handle = document.getElementById("noVNC_control_bar_handle"); + const bounds = handle.getBoundingClientRect(); // Touch events have implicit capture if (e.type === "mousedown") { @@ -703,7 +698,7 @@ var UI = { UI.activateControlbar(); }, - toggleExpander: function(e) { + toggleExpander() { if (this.classList.contains("noVNC_open")) { this.classList.remove("noVNC_open"); } else { @@ -718,9 +713,9 @@ var UI = { * ------v------*/ // Initial page load read/initialization of settings - initSetting: function(name, defVal) { + initSetting(name, defVal) { // Check Query string followed by cookie - var val = WebUtil.getConfigVar(name); + let val = WebUtil.getConfigVar(name); if (val === null) { val = WebUtil.readSetting(name, defVal); } @@ -730,7 +725,7 @@ var UI = { // Update cookie and form control setting. If value is not set, then // updates from control to current cookie setting. - updateSetting: function(name, value) { + updateSetting(name, value) { // Save the cookie for this session if (typeof value !== 'undefined') { @@ -740,12 +735,12 @@ var UI = { // Update the settings control value = UI.getSetting(name); - var ctrl = document.getElementById('noVNC_setting_' + name); + const ctrl = document.getElementById('noVNC_setting_' + name); if (ctrl.type === 'checkbox') { ctrl.checked = value; } else if (typeof ctrl.options !== 'undefined') { - for (var i = 0; i < ctrl.options.length; i += 1) { + for (let i = 0; i < ctrl.options.length; i += 1) { if (ctrl.options[i].value === value) { ctrl.selectedIndex = i; break; @@ -762,8 +757,9 @@ var UI = { }, // Save control setting to cookie - saveSetting: function(name) { - var val, ctrl = document.getElementById('noVNC_setting_' + name); + saveSetting(name) { + const ctrl = document.getElementById('noVNC_setting_' + name); + let val; if (ctrl.type === 'checkbox') { val = ctrl.checked; } else if (typeof ctrl.options !== 'undefined') { @@ -777,9 +773,9 @@ var UI = { }, // Read form control compatible setting from cookie - getSetting: function(name) { - var ctrl = document.getElementById('noVNC_setting_' + name); - var val = WebUtil.readSetting(name); + getSetting(name) { + const ctrl = document.getElementById('noVNC_setting_' + name); + let val = WebUtil.readSetting(name); if (typeof val !== 'undefined' && val !== null && ctrl.type === 'checkbox') { if (val.toString().toLowerCase() in {'0':1, 'no':1, 'false':1}) { val = false; @@ -793,14 +789,14 @@ var UI = { // These helpers compensate for the lack of parent-selectors and // previous-sibling-selectors in CSS which are needed when we want to // disable the labels that belong to disabled input elements. - disableSetting: function(name) { - var ctrl = document.getElementById('noVNC_setting_' + name); + disableSetting(name) { + const ctrl = document.getElementById('noVNC_setting_' + name); ctrl.disabled = true; ctrl.label.classList.add('noVNC_disabled'); }, - enableSetting: function(name) { - var ctrl = document.getElementById('noVNC_setting_' + name); + enableSetting(name) { + const ctrl = document.getElementById('noVNC_setting_' + name); ctrl.disabled = false; ctrl.label.classList.remove('noVNC_disabled'); }, @@ -811,7 +807,7 @@ var UI = { * PANELS * ------v------*/ - closeAllPanels: function() { + closeAllPanels() { UI.closeSettingsPanel(); UI.closePowerPanel(); UI.closeClipboardPanel(); @@ -824,7 +820,7 @@ var UI = { * SETTINGS (panel) * ------v------*/ - openSettingsPanel: function() { + openSettingsPanel() { UI.closeAllPanels(); UI.openControlbar(); @@ -846,14 +842,14 @@ var UI = { .classList.add("noVNC_selected"); }, - closeSettingsPanel: function() { + closeSettingsPanel() { document.getElementById('noVNC_settings') .classList.remove("noVNC_open"); document.getElementById('noVNC_settings_button') .classList.remove("noVNC_selected"); }, - toggleSettingsPanel: function() { + toggleSettingsPanel() { if (document.getElementById('noVNC_settings') .classList.contains("noVNC_open")) { UI.closeSettingsPanel(); @@ -868,7 +864,7 @@ var UI = { * POWER * ------v------*/ - openPowerPanel: function() { + openPowerPanel() { UI.closeAllPanels(); UI.openControlbar(); @@ -878,14 +874,14 @@ var UI = { .classList.add("noVNC_selected"); }, - closePowerPanel: function() { + closePowerPanel() { document.getElementById('noVNC_power') .classList.remove("noVNC_open"); document.getElementById('noVNC_power_button') .classList.remove("noVNC_selected"); }, - togglePowerPanel: function() { + togglePowerPanel() { if (document.getElementById('noVNC_power') .classList.contains("noVNC_open")) { UI.closePowerPanel(); @@ -895,7 +891,7 @@ var UI = { }, // Disable/enable power button - updatePowerButton: function() { + updatePowerButton() { if (UI.connected && UI.rfb.capabilities.power && !UI.rfb.viewOnly) { @@ -915,7 +911,7 @@ var UI = { * CLIPBOARD * ------v------*/ - openClipboardPanel: function() { + openClipboardPanel() { UI.closeAllPanels(); UI.openControlbar(); @@ -925,14 +921,14 @@ var UI = { .classList.add("noVNC_selected"); }, - closeClipboardPanel: function() { + closeClipboardPanel() { document.getElementById('noVNC_clipboard') .classList.remove("noVNC_open"); document.getElementById('noVNC_clipboard_button') .classList.remove("noVNC_selected"); }, - toggleClipboardPanel: function() { + toggleClipboardPanel() { if (document.getElementById('noVNC_clipboard') .classList.contains("noVNC_open")) { UI.closeClipboardPanel(); @@ -941,19 +937,19 @@ var UI = { } }, - clipboardReceive: function(e) { + clipboardReceive(e) { Log.Debug(">> UI.clipboardReceive: " + e.detail.text.substr(0,40) + "..."); document.getElementById('noVNC_clipboard_text').value = e.detail.text; Log.Debug("<< UI.clipboardReceive"); }, - clipboardClear: function() { + clipboardClear() { document.getElementById('noVNC_clipboard_text').value = ""; UI.rfb.clipboardPasteFrom(""); }, - clipboardSend: function() { - var text = document.getElementById('noVNC_clipboard_text').value; + clipboardSend() { + const text = document.getElementById('noVNC_clipboard_text').value; Log.Debug(">> UI.clipboardSend: " + text.substr(0,40) + "..."); UI.rfb.clipboardPasteFrom(text); Log.Debug("<< UI.clipboardSend"); @@ -965,26 +961,26 @@ var UI = { * CONNECTION * ------v------*/ - openConnectPanel: function() { + openConnectPanel() { document.getElementById('noVNC_connect_dlg') .classList.add("noVNC_open"); }, - closeConnectPanel: function() { + closeConnectPanel() { document.getElementById('noVNC_connect_dlg') .classList.remove("noVNC_open"); }, - connect: function(event, password) { + connect(event, password) { // Ignore when rfb already exists if (typeof UI.rfb !== 'undefined') { return; } - var host = UI.getSetting('host'); - var port = UI.getSetting('port'); - var path = UI.getSetting('path'); + const host = UI.getSetting('host'); + const port = UI.getSetting('port'); + const path = UI.getSetting('path'); if (typeof password === 'undefined') { password = WebUtil.getConfigVar('password'); @@ -1008,9 +1004,7 @@ var UI = { UI.updateVisualState('connecting'); - var url; - - url = UI.getSetting('encrypt') ? 'wss' : 'ws'; + let url = UI.getSetting('encrypt') ? 'wss' : 'ws'; url += '://' + host; if(port) { @@ -1026,7 +1020,7 @@ var UI = { UI.rfb.addEventListener("disconnect", UI.disconnectFinished); UI.rfb.addEventListener("credentialsrequired", UI.credentials); UI.rfb.addEventListener("securityfailure", UI.securityFailed); - UI.rfb.addEventListener("capabilities", function () { UI.updatePowerButton(); }); + UI.rfb.addEventListener("capabilities", () => UI.updatePowerButton()); UI.rfb.addEventListener("clipboard", UI.clipboardReceive); UI.rfb.addEventListener("bell", UI.bell); UI.rfb.addEventListener("desktopname", UI.updateDesktopName); @@ -1037,7 +1031,7 @@ var UI = { UI.updateViewOnly(); // requires UI.rfb }, - disconnect: function() { + disconnect() { UI.closeAllPanels(); UI.rfb.disconnect(); @@ -1051,7 +1045,7 @@ var UI = { // Don't display the connection settings until we're actually disconnected }, - reconnect: function() { + reconnect() { UI.reconnect_callback = null; // if reconnect has been disabled in the meantime, do nothing. @@ -1062,7 +1056,7 @@ var UI = { UI.connect(null, UI.reconnect_password); }, - cancelReconnect: function() { + cancelReconnect() { if (UI.reconnect_callback !== null) { clearTimeout(UI.reconnect_callback); UI.reconnect_callback = null; @@ -1074,16 +1068,14 @@ var UI = { UI.openConnectPanel(); }, - connectFinished: function (e) { + connectFinished() { UI.connected = true; UI.inhibit_reconnect = false; - let msg; - if (UI.getSetting('encrypt')) { - msg = _("Connected (encrypted) to ") + UI.desktopName; - } else { - msg = _("Connected (unencrypted) to ") + UI.desktopName; - } + let msg = UI.getSetting('encrypt') + ? _("Connected (encrypted) to ") + UI.desktopName + : _("Connected (unencrypted) to ") + UI.desktopName; + UI.showStatus(msg); UI.updateVisualState('connected'); @@ -1091,7 +1083,7 @@ var UI = { UI.rfb.focus(); }, - disconnectFinished: function (e) { + disconnectFinished(e) { let wasConnected = UI.connected; // This variable is ideally set when disconnection starts, but @@ -1113,7 +1105,7 @@ var UI = { } else if (UI.getSetting('reconnect', false) === true && !UI.inhibit_reconnect) { UI.updateVisualState('reconnecting'); - var delay = parseInt(UI.getSetting('reconnect_delay')); + const delay = parseInt(UI.getSetting('reconnect_delay')); UI.reconnect_callback = setTimeout(UI.reconnect, delay); return; } else { @@ -1125,17 +1117,12 @@ var UI = { UI.openConnectPanel(); }, - securityFailed: function (e) { - let msg = ""; - // On security failures we might get a string with a reason - // directly from the server. Note that we can't control if - // this string is translated or not. - if ('reason' in e.detail) { - msg = _("New connection has been rejected with reason: ") + - e.detail.reason; - } else { - msg = _("New connection has been rejected"); - } + securityFailed(e) { + const msg = ('reason' in e.detail) + ? _("New connection has been rejected with reason: ") + + e.detail.reason + : _("New connection has been rejected"); + UI.showStatus(msg, 'error'); }, @@ -1145,25 +1132,25 @@ var UI = { * PASSWORD * ------v------*/ - credentials: function(e) { + credentials() { // FIXME: handle more types document.getElementById('noVNC_password_dlg') .classList.add('noVNC_open'); - setTimeout(function () { - document.getElementById('noVNC_password_input').focus(); - }, 100); + setTimeout(() => + document.getElementById('noVNC_password_input').focus() + , 100); Log.Warn("Server asked for a password"); UI.showStatus(_("Password is required"), "warning"); }, - setPassword: function(e) { + setPassword(e) { // Prevent actually submitting the form e.preventDefault(); - var inputElem = document.getElementById('noVNC_password_input'); - var password = inputElem.value; + const inputElem = document.getElementById('noVNC_password_input'); + const password = inputElem.value; // Clear the input after reading the password inputElem.value = ""; UI.rfb.sendCredentials({ password: password }); @@ -1178,7 +1165,7 @@ var UI = { * FULLSCREEN * ------v------*/ - toggleFullscreen: function() { + toggleFullscreen() { if (document.fullscreenElement || // alternative standard method document.mozFullScreenElement || // currently working methods document.webkitFullscreenElement || @@ -1207,7 +1194,7 @@ var UI = { UI.updateFullscreenButton(); }, - updateFullscreenButton: function() { + updateFullscreenButton() { if (document.fullscreenElement || // alternative standard method document.mozFullScreenElement || // currently working methods document.webkitFullscreenElement || @@ -1227,7 +1214,7 @@ var UI = { * ------v------*/ // Apply remote resizing or local scaling - applyResizeMode: function() { + applyResizeMode() { if (!UI.rfb) return; UI.rfb.scaleViewport = UI.getSetting('resize') === 'scale'; @@ -1241,16 +1228,11 @@ var UI = { * ------v------*/ // Update parameters that depend on the viewport clip setting - updateViewClip: function() { + updateViewClip() { if (!UI.rfb) return; - var cur_clip = UI.rfb.clipViewport; - var new_clip = UI.getSetting('view_clip'); - - if (isTouchDevice) { - // Touch devices usually have shit scrollbars - new_clip = true; - } + const cur_clip = UI.rfb.clipViewport; + const new_clip = UI.getSetting('view_clip') || isTouchDevice; if (cur_clip !== new_clip) { UI.rfb.clipViewport = new_clip; @@ -1262,8 +1244,8 @@ var UI = { }, // Handle special cases where viewport clipping is forced on/off or locked - enableDisableViewClip: function() { - var resizeSetting = UI.getSetting('resize'); + enableDisableViewClip() { + const resizeSetting = UI.getSetting('resize'); // Disable clipping if we are scaling, connected or on touch if (resizeSetting === 'scale' || isTouchDevice) { @@ -1279,15 +1261,15 @@ var UI = { * VIEWDRAG * ------v------*/ - toggleViewDrag: function() { + toggleViewDrag() { if (!UI.rfb) return; - var drag = UI.rfb.dragViewport; + const drag = UI.rfb.dragViewport; UI.setViewDrag(!drag); }, // Set the view drag mode which moves the viewport on mouse drags - setViewDrag: function(drag) { + setViewDrag(drag) { if (!UI.rfb) return; UI.rfb.dragViewport = drag; @@ -1295,10 +1277,10 @@ var UI = { UI.updateViewDrag(); }, - updateViewDrag: function() { + updateViewDrag() { if (!UI.connected) return; - var viewDragButton = document.getElementById('noVNC_view_drag_button'); + const viewDragButton = document.getElementById('noVNC_view_drag_button'); if (!UI.rfb.clipViewport && UI.rfb.dragViewport) { // We are no longer clipping the viewport. Make sure @@ -1339,33 +1321,35 @@ var UI = { * KEYBOARD * ------v------*/ - showVirtualKeyboard: function() { + showVirtualKeyboard() { if (!isTouchDevice) return; - var input = document.getElementById('noVNC_keyboardinput'); + const input = document.getElementById('noVNC_keyboardinput'); if (document.activeElement == input) return; input.focus(); try { - var l = input.value.length; + const l = input.value.length; // Move the caret to the end input.setSelectionRange(l, l); - } catch (err) {} // setSelectionRange is undefined in Google Chrome + } catch (err) { + // setSelectionRange is undefined in Google Chrome + } }, - hideVirtualKeyboard: function() { + hideVirtualKeyboard() { if (!isTouchDevice) return; - var input = document.getElementById('noVNC_keyboardinput'); + const input = document.getElementById('noVNC_keyboardinput'); if (document.activeElement != input) return; input.blur(); }, - toggleVirtualKeyboard: function () { + toggleVirtualKeyboard() { if (document.getElementById('noVNC_keyboard_button') .classList.contains("noVNC_selected")) { UI.hideVirtualKeyboard(); @@ -1374,7 +1358,7 @@ var UI = { } }, - onfocusVirtualKeyboard: function(event) { + onfocusVirtualKeyboard() { document.getElementById('noVNC_keyboard_button') .classList.add("noVNC_selected"); if (UI.rfb) { @@ -1382,7 +1366,7 @@ var UI = { } }, - onblurVirtualKeyboard: function(event) { + onblurVirtualKeyboard() { document.getElementById('noVNC_keyboard_button') .classList.remove("noVNC_selected"); if (UI.rfb) { @@ -1390,8 +1374,8 @@ var UI = { } }, - keepVirtualKeyboard: function(event) { - var input = document.getElementById('noVNC_keyboardinput'); + keepVirtualKeyboard(event) { + const input = document.getElementById('noVNC_keyboardinput'); // Only prevent focus change if the virtual keyboard is active if (document.activeElement != input) { @@ -1418,8 +1402,8 @@ var UI = { event.preventDefault(); }, - keyboardinputReset: function() { - var kbi = document.getElementById('noVNC_keyboardinput'); + keyboardinputReset() { + const kbi = document.getElementById('noVNC_keyboardinput'); kbi.value = new Array(UI.defaultKeyboardinputLen).join("_"); UI.lastKeyboardinput = kbi.value; }, @@ -1434,18 +1418,18 @@ var UI = { // the keyboardinput element instead and generate the corresponding key events. // This code is required since some browsers on Android are inconsistent in // sending keyCodes in the normal keyboard events when using on screen keyboards. - keyInput: function(event) { - + keyInput(event) { if (!UI.rfb) return; - var newValue = event.target.value; + const newValue = event.target.value; if (!UI.lastKeyboardinput) { UI.keyboardinputReset(); } - var oldValue = UI.lastKeyboardinput; - var newLen; + const oldValue = UI.lastKeyboardinput; + + let newLen; try { // Try to check caret position since whitespace at the end // will not be considered by value.length in some browsers @@ -1454,20 +1438,15 @@ var UI = { // selectionStart is undefined in Google Chrome newLen = newValue.length; } - var oldLen = oldValue.length; + const oldLen = oldValue.length; - var backspaces; - var inputs = newLen - oldLen; - if (inputs < 0) { - backspaces = -inputs; - } else { - backspaces = 0; - } + let inputs = newLen - oldLen; + + let backspaces = (inputs < 0) ? -inputs : 0; // Compare the old string with the new to account for // text-corrections or other input that modify existing text - var i; - for (i = 0; i < Math.min(oldLen, newLen); i++) { + for (let i = 0; i < Math.min(oldLen, newLen); i++) { if (newValue.charAt(i) != oldValue.charAt(i)) { inputs = newLen - i; backspaces = oldLen - i; @@ -1476,10 +1455,10 @@ var UI = { } // Send the key events - for (i = 0; i < backspaces; i++) { + for (let i = 0; i < backspaces; i++) { UI.rfb.sendKey(KeyTable.XK_BackSpace, "Backspace"); } - for (i = newLen - inputs; i < newLen; i++) { + for (let i = newLen - inputs; i < newLen; i++) { UI.rfb.sendKey(keysyms.lookup(newValue.charCodeAt(i))); } @@ -1507,7 +1486,7 @@ var UI = { * EXTRA KEYS * ------v------*/ - openExtraKeys: function() { + openExtraKeys() { UI.closeAllPanels(); UI.openControlbar(); @@ -1517,14 +1496,14 @@ var UI = { .classList.add("noVNC_selected"); }, - closeExtraKeys: function() { + closeExtraKeys() { document.getElementById('noVNC_modifiers') .classList.remove("noVNC_open"); document.getElementById('noVNC_toggle_extra_keys_button') .classList.remove("noVNC_selected"); }, - toggleExtraKeys: function() { + toggleExtraKeys() { if(document.getElementById('noVNC_modifiers') .classList.contains("noVNC_open")) { UI.closeExtraKeys(); @@ -1533,16 +1512,16 @@ var UI = { } }, - sendEsc: function() { + sendEsc() { UI.rfb.sendKey(KeyTable.XK_Escape, "Escape"); }, - sendTab: function() { + sendTab() { UI.rfb.sendKey(KeyTable.XK_Tab); }, - toggleCtrl: function() { - var btn = document.getElementById('noVNC_toggle_ctrl_button'); + toggleCtrl() { + const btn = document.getElementById('noVNC_toggle_ctrl_button'); if (btn.classList.contains("noVNC_selected")) { UI.rfb.sendKey(KeyTable.XK_Control_L, "ControlLeft", false); btn.classList.remove("noVNC_selected"); @@ -1552,8 +1531,8 @@ var UI = { } }, - toggleAlt: function() { - var btn = document.getElementById('noVNC_toggle_alt_button'); + toggleAlt() { + const btn = document.getElementById('noVNC_toggle_alt_button'); if (btn.classList.contains("noVNC_selected")) { UI.rfb.sendKey(KeyTable.XK_Alt_L, "AltLeft", false); btn.classList.remove("noVNC_selected"); @@ -1563,7 +1542,7 @@ var UI = { } }, - sendCtrlAltDel: function() { + sendCtrlAltDel() { UI.rfb.sendCtrlAltDel(); }, @@ -1573,25 +1552,25 @@ var UI = { * MISC * ------v------*/ - setMouseButton: function(num) { - var view_only = UI.rfb.viewOnly; + setMouseButton(num) { + const view_only = UI.rfb.viewOnly; if (UI.rfb && !view_only) { UI.rfb.touchButton = num; } - var blist = [0, 1,2,4]; - for (var b = 0; b < blist.length; b++) { - var button = document.getElementById('noVNC_mouse_button' + - blist[b]); - if (blist[b] === num && !view_only) { + const blist = [0, 1,2,4]; + blist.forEach(blistItem => { + const button = document.getElementById('noVNC_mouse_button' + + blistItem); + if (blistItem === num && !view_only) { button.classList.remove("noVNC_hidden"); } else { button.classList.add("noVNC_hidden"); } - } + }); }, - updateViewOnly: function() { + updateViewOnly() { if (!UI.rfb) return; UI.rfb.viewOnly = UI.getSetting('view_only'); @@ -1610,22 +1589,22 @@ var UI = { UI.setMouseButton(1); //has it's own logic for hiding/showing }, - updateLogging: function() { + updateLogging() { WebUtil.init_logging(UI.getSetting('logging')); }, - updateDesktopName: function(e) { + updateDesktopName(e) { UI.desktopName = e.detail.name; // Display the desktop name in the document title document.title = e.detail.name + " - noVNC"; }, - bell: function(e) { + bell() { if (WebUtil.getConfigVar('bell', 'on') === 'on') { - var promise = document.getElementById('noVNC_bell').play(); + const promise = document.getElementById('noVNC_bell').play(); // The standards disagree on the return value here if (promise) { - promise.catch(function(e) { + promise.catch((e) => { if (e.name === "NotAllowedError") { // Ignore when the browser doesn't let us play audio. // It is common that the browsers require audio to be @@ -1639,8 +1618,8 @@ var UI = { }, //Helper to add options to dropdown. - addOption: function(selectbox, text, value) { - var optn = document.createElement("OPTION"); + addOption(selectbox, text, value) { + const optn = document.createElement("OPTION"); optn.text = text; optn.value = value; selectbox.options.add(optn); @@ -1653,7 +1632,7 @@ var UI = { }; // Set up translations -var LINGUAS = ["de", "el", "nl", "pl", "sv", "zh"]; +const LINGUAS = ["de", "el", "nl", "pl", "sv", "zh"]; l10n.setup(LINGUAS); if (l10n.language !== "en" && l10n.dictionary === undefined) { WebUtil.fetchJSON('app/locale/' + l10n.language + '.json', function (translations) { diff --git a/app/webutil.js b/app/webutil.js index dabc97c7..efcd7a06 100644 --- a/app/webutil.js +++ b/app/webutil.js @@ -7,26 +7,21 @@ * See README.md for usage and integration instructions. */ -/*jslint bitwise: false, white: false, browser: true, devel: true */ -/*global Util, window, document */ - import { init_logging as main_init_logging } from '../core/util/logging.js'; // init log level reading the logging HTTP param export function init_logging (level) { - "use strict"; if (typeof level !== "undefined") { main_init_logging(level); } else { - var param = document.location.href.match(/logging=([A-Za-z0-9\._\-]*)/); + const param = document.location.href.match(/logging=([A-Za-z0-9._-]*)/); main_init_logging(param || undefined); } -}; +} // Read a query string variable export function getQueryVar (name, defVal) { - "use strict"; - var re = new RegExp('.*[?&]' + name + '=([^&#]*)'), + const re = new RegExp('.*[?&]' + name + '=([^&#]*)'), match = document.location.href.match(re); if (typeof defVal === 'undefined') { defVal = null; } if (match) { @@ -34,12 +29,11 @@ export function getQueryVar (name, defVal) { } else { return defVal; } -}; +} // Read a hash fragment variable export function getHashVar (name, defVal) { - "use strict"; - var re = new RegExp('.*[&#]' + name + '=([^&]*)'), + const re = new RegExp('.*[&#]' + name + '=([^&]*)'), match = document.location.hash.match(re); if (typeof defVal === 'undefined') { defVal = null; } if (match) { @@ -47,18 +41,17 @@ export function getHashVar (name, defVal) { } else { return defVal; } -}; +} // Read a variable from the fragment or the query string // Fragment takes precedence export function getConfigVar (name, defVal) { - "use strict"; - var val = getHashVar(name); + let val = getHashVar(name); if (val === null) { val = getQueryVar(name, defVal); } return val; -}; +} /* * Cookie handling. Dervied from: http://www.quirksmode.org/js/cookies.html @@ -66,8 +59,7 @@ export function getConfigVar (name, defVal) { // No days means only for this browser session export function createCookie (name, value, days) { - "use strict"; - var date, expires; + let date, expires; if (days) { date = new Date(); date.setTime(date.getTime() + (days * 24 * 60 * 60 * 1000)); @@ -76,46 +68,41 @@ export function createCookie (name, value, days) { expires = ""; } - var secure; - if (document.location.protocol === "https:") { - secure = "; secure"; - } else { - secure = ""; - } + const secure = (document.location.protocol === "https:") + ? "; secure" + : ""; + document.cookie = name + "=" + value + expires + "; path=/" + secure; -}; +} export function readCookie (name, defaultValue) { - "use strict"; - var nameEQ = name + "=", + const nameEQ = name + "=", ca = document.cookie.split(';'); - for (var i = 0; i < ca.length; i += 1) { - var c = ca[i]; + for (let i = 0; i < ca.length; i += 1) { + let c = ca[i]; while (c.charAt(0) === ' ') { c = c.substring(1, c.length); } if (c.indexOf(nameEQ) === 0) { return c.substring(nameEQ.length, c.length); } } + return (typeof defaultValue !== 'undefined') ? defaultValue : null; -}; +} export function eraseCookie (name) { - "use strict"; createCookie(name, "", -1); -}; +} /* * Setting handling. */ -var settings = {}; +let settings = {}; export function initSettings (callback /*, ...callbackArgs */) { - "use strict"; - var callbackArgs = Array.prototype.slice.call(arguments, 1); + const callbackArgs = Array.prototype.slice.call(arguments, 1); if (window.chrome && window.chrome.storage) { - window.chrome.storage.sync.get(function (cfg) { + window.chrome.storage.sync.get((cfg) => { settings = cfg; - console.log(settings); if (callback) { callback.apply(this, callbackArgs); } @@ -126,11 +113,10 @@ export function initSettings (callback /*, ...callbackArgs */) { callback.apply(this, callbackArgs); } } -}; +} // No days means only for this browser session export function writeSetting (name, value) { - "use strict"; if (window.chrome && window.chrome.storage) { //console.log("writeSetting:", name, value); if (settings[name] !== value) { @@ -140,11 +126,10 @@ export function writeSetting (name, value) { } else { localStorage.setItem(name, value); } -}; +} export function readSetting (name, defaultValue) { - "use strict"; - var value; + let value; if (window.chrome && window.chrome.storage) { value = settings[name]; } else { @@ -158,33 +143,29 @@ export function readSetting (name, defaultValue) { } else { return value; } -}; +} export function eraseSetting (name) { - "use strict"; if (window.chrome && window.chrome.storage) { window.chrome.storage.sync.remove(name); delete settings[name]; } else { localStorage.removeItem(name); } -}; +} export function injectParamIfMissing (path, param, value) { // force pretend that we're dealing with a relative path // (assume that we wanted an extra if we pass one in) path = "/" + path; - var elem = document.createElement('a'); + const elem = document.createElement('a'); elem.href = path; - var param_eq = encodeURIComponent(param) + "="; - var query; - if (elem.search) { - query = elem.search.slice(1).split('&'); - } else { - query = []; - } + const param_eq = encodeURIComponent(param) + "="; + const query = elem.search + ? elem.search.slice(1).split('&') + : []; if (!query.some(function (v) { return v.startsWith(param_eq); })) { query.push(param_eq + encodeURIComponent(value)); @@ -195,10 +176,10 @@ export function injectParamIfMissing (path, param, value) { // in the elem.pathname string. Handle that case gracefully. if (elem.pathname.charAt(0) == "/") { return elem.pathname.slice(1) + elem.search + elem.hash; - } else { - return elem.pathname + elem.search + elem.hash; } -}; + + return elem.pathname + elem.search + elem.hash; +} // sadly, we can't use the Fetch API until we decide to drop // IE11 support or polyfill promises and fetch in IE11. @@ -206,28 +187,26 @@ export function injectParamIfMissing (path, param, value) { // will receive either an event or an error on failure. export function fetchJSON(path, resolve, reject) { // NB: IE11 doesn't support JSON as a responseType - var req = new XMLHttpRequest(); + const req = new XMLHttpRequest(); req.open('GET', path); - req.onload = function () { + req.onload = () => { if (req.status === 200) { try { - var resObj = JSON.parse(req.responseText); + resolve(JSON.parse(req.responseText)); } catch (err) { reject(err); - return; } - resolve(resObj); } else { reject(new Error("XHR got non-200 status while trying to load '" + path + "': " + req.status)); } }; - req.onerror = function (evt) { + req.onerror = (evt) => { reject(new Error("XHR encountered an error while trying to load '" + path + "': " + evt.message)); }; - req.ontimeout = function (evt) { + req.ontimeout = () => { reject(new Error("XHR timed out while trying to load '" + path + "'")); }; diff --git a/core/base64.js b/core/base64.js index 9d24a25f..b18bf581 100644 --- a/core/base64.js +++ b/core/base64.js @@ -4,50 +4,44 @@ // From: http://hg.mozilla.org/mozilla-central/raw-file/ec10630b1a54/js/src/devtools/jint/sunspider/string-base64.js -/*jslint white: false */ -/*global console */ +import * as Log from './util/logging.js'; export default { /* Convert data (an array of integers) to a Base64 string. */ toBase64Table : 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/='.split(''), base64Pad : '=', - encode: function (data) { - "use strict"; - var result = ''; - var toBase64Table = this.toBase64Table; - var length = data.length; - var lengthpad = (length % 3); + encode(data) { + let result = ''; + const length = data.length; + const lengthpad = (length % 3); // Convert every three bytes to 4 ascii characters. - for (var i = 0; i < (length - 2); i += 3) { - result += toBase64Table[data[i] >> 2]; - result += toBase64Table[((data[i] & 0x03) << 4) + (data[i + 1] >> 4)]; - result += toBase64Table[((data[i + 1] & 0x0f) << 2) + (data[i + 2] >> 6)]; - result += toBase64Table[data[i + 2] & 0x3f]; + for (let i = 0; i < (length - 2); i += 3) { + result += this.toBase64Table[data[i] >> 2]; + result += this.toBase64Table[((data[i] & 0x03) << 4) + (data[i + 1] >> 4)]; + result += this.toBase64Table[((data[i + 1] & 0x0f) << 2) + (data[i + 2] >> 6)]; + result += this.toBase64Table[data[i + 2] & 0x3f]; } // Convert the remaining 1 or 2 bytes, pad out to 4 characters. - var j = 0; + let j = length - lengthpad; if (lengthpad === 2) { - j = length - lengthpad; - result += toBase64Table[data[j] >> 2]; - result += toBase64Table[((data[j] & 0x03) << 4) + (data[j + 1] >> 4)]; - result += toBase64Table[(data[j + 1] & 0x0f) << 2]; - result += toBase64Table[64]; + result += this.toBase64Table[data[j] >> 2]; + result += this.toBase64Table[((data[j] & 0x03) << 4) + (data[j + 1] >> 4)]; + result += this.toBase64Table[(data[j + 1] & 0x0f) << 2]; + result += this.toBase64Table[64]; } else if (lengthpad === 1) { - j = length - lengthpad; - result += toBase64Table[data[j] >> 2]; - result += toBase64Table[(data[j] & 0x03) << 4]; - result += toBase64Table[64]; - result += toBase64Table[64]; + result += this.toBase64Table[data[j] >> 2]; + result += this.toBase64Table[(data[j] & 0x03) << 4]; + result += this.toBase64Table[64]; + result += this.toBase64Table[64]; } return result; }, /* Convert Base64 data to a string */ - /* jshint -W013 */ toBinaryTable : [ -1,-1,-1,-1, -1,-1,-1,-1, -1,-1,-1,-1, -1,-1,-1,-1, -1,-1,-1,-1, -1,-1,-1,-1, -1,-1,-1,-1, -1,-1,-1,-1, @@ -58,31 +52,25 @@ export default { -1,26,27,28, 29,30,31,32, 33,34,35,36, 37,38,39,40, 41,42,43,44, 45,46,47,48, 49,50,51,-1, -1,-1,-1,-1 ], - /* jshint +W013 */ - decode: function (data, offset) { - "use strict"; + decode(data, offset) { offset = typeof(offset) !== 'undefined' ? offset : 0; - var toBinaryTable = this.toBinaryTable; - var base64Pad = this.base64Pad; - var result, result_length; - var leftbits = 0; // number of bits decoded, but yet to be appended - var leftdata = 0; // bits decoded, but yet to be appended - var data_length = data.indexOf('=') - offset; + let leftbits = 0; // number of bits decoded, but yet to be appended + let leftdata = 0; // bits decoded, but yet to be appended + let data_length = data.indexOf('=') - offset; if (data_length < 0) { data_length = data.length - offset; } /* Every four characters is 3 resulting numbers */ - result_length = (data_length >> 2) * 3 + Math.floor((data_length % 4) / 1.5); - result = new Array(result_length); + const result_length = (data_length >> 2) * 3 + Math.floor((data_length % 4) / 1.5); + const result = new Array(result_length); // Convert one by one. - for (var idx = 0, i = offset; i < data.length; i++) { - var c = toBinaryTable[data.charCodeAt(i) & 0x7f]; - var padding = (data.charAt(i) === base64Pad); + for (let idx = 0, i = offset; i < data.length; i++) { + const c = this.toBinaryTable[data.charCodeAt(i) & 0x7f]; // Skip illegal characters and whitespace if (c === -1) { - console.error("Illegal character code " + data.charCodeAt(i) + " at position " + i); + Log.Error("Illegal character code " + data.charCodeAt(i) + " at position " + i); continue; } @@ -94,7 +82,7 @@ export default { if (leftbits >= 8) { leftbits -= 8; // Append if not padding. - if (!padding) { + if (data.charAt(i) !== this.base64Pad) { result[idx++] = (leftdata >> leftbits) & 0xff; } leftdata &= (1 << leftbits) - 1; @@ -103,7 +91,7 @@ export default { // If there are any bits left, the base64 string was corrupted if (leftbits) { - err = new Error('Corrupted base64 string'); + const err = new Error('Corrupted base64 string'); err.name = 'Base64-Error'; throw err; } diff --git a/core/des.js b/core/des.js index 62684936..94539bce 100644 --- a/core/des.js +++ b/core/des.js @@ -75,89 +75,79 @@ * fine Java utilities: http://www.acme.com/java/ */ -/* jslint white: false */ - export default function DES(passwd) { - "use strict"; - // Tables, permutations, S-boxes, etc. - // jshint -W013 - var PC2 = [13,16,10,23, 0, 4, 2,27,14, 5,20, 9,22,18,11, 3, + const PC2 = [13,16,10,23, 0, 4, 2,27,14, 5,20, 9,22,18,11, 3, 25, 7,15, 6,26,19,12, 1,40,51,30,36,46,54,29,39, - 50,44,32,47,43,48,38,55,33,52,45,41,49,35,28,31 ], - totrot = [ 1, 2, 4, 6, 8,10,12,14,15,17,19,21,23,25,27,28], - z = 0x0, a,b,c,d,e,f, SP1,SP2,SP3,SP4,SP5,SP6,SP7,SP8, - keys = []; + 50,44,32,47,43,48,38,55,33,52,45,41,49,35,28,31 ]; + const totrot = [ 1, 2, 4, 6, 8,10,12,14,15,17,19,21,23,25,27,28]; + const keys = []; + const z = 0x0; + let a,b,c,d,e,f; - // jshint -W015 a=1<<16; b=1<<24; c=a|b; d=1<<2; e=1<<10; f=d|e; - SP1 = [c|e,z|z,a|z,c|f,c|d,a|f,z|d,a|z,z|e,c|e,c|f,z|e,b|f,c|d,b|z,z|d, + const SP1 = [c|e,z|z,a|z,c|f,c|d,a|f,z|d,a|z,z|e,c|e,c|f,z|e,b|f,c|d,b|z,z|d, z|f,b|e,b|e,a|e,a|e,c|z,c|z,b|f,a|d,b|d,b|d,a|d,z|z,z|f,a|f,b|z, a|z,c|f,z|d,c|z,c|e,b|z,b|z,z|e,c|d,a|z,a|e,b|d,z|e,z|d,b|f,a|f, c|f,a|d,c|z,b|f,b|d,z|f,a|f,c|e,z|f,b|e,b|e,z|z,a|d,a|e,z|z,c|d]; a=1<<20; b=1<<31; c=a|b; d=1<<5; e=1<<15; f=d|e; - SP2 = [c|f,b|e,z|e,a|f,a|z,z|d,c|d,b|f,b|d,c|f,c|e,b|z,b|e,a|z,z|d,c|d, + const SP2 = [c|f,b|e,z|e,a|f,a|z,z|d,c|d,b|f,b|d,c|f,c|e,b|z,b|e,a|z,z|d,c|d, a|e,a|d,b|f,z|z,b|z,z|e,a|f,c|z,a|d,b|d,z|z,a|e,z|f,c|e,c|z,z|f, z|z,a|f,c|d,a|z,b|f,c|z,c|e,z|e,c|z,b|e,z|d,c|f,a|f,z|d,z|e,b|z, z|f,c|e,a|z,b|d,a|d,b|f,b|d,a|d,a|e,z|z,b|e,z|f,b|z,c|d,c|f,a|e]; a=1<<17; b=1<<27; c=a|b; d=1<<3; e=1<<9; f=d|e; - SP3 = [z|f,c|e,z|z,c|d,b|e,z|z,a|f,b|e,a|d,b|d,b|d,a|z,c|f,a|d,c|z,z|f, + const SP3 = [z|f,c|e,z|z,c|d,b|e,z|z,a|f,b|e,a|d,b|d,b|d,a|z,c|f,a|d,c|z,z|f, b|z,z|d,c|e,z|e,a|e,c|z,c|d,a|f,b|f,a|e,a|z,b|f,z|d,c|f,z|e,b|z, c|e,b|z,a|d,z|f,a|z,c|e,b|e,z|z,z|e,a|d,c|f,b|e,b|d,z|e,z|z,c|d, b|f,a|z,b|z,c|f,z|d,a|f,a|e,b|d,c|z,b|f,z|f,c|z,a|f,z|d,c|d,a|e]; a=1<<13; b=1<<23; c=a|b; d=1<<0; e=1<<7; f=d|e; - SP4 = [c|d,a|f,a|f,z|e,c|e,b|f,b|d,a|d,z|z,c|z,c|z,c|f,z|f,z|z,b|e,b|d, + const SP4 = [c|d,a|f,a|f,z|e,c|e,b|f,b|d,a|d,z|z,c|z,c|z,c|f,z|f,z|z,b|e,b|d, z|d,a|z,b|z,c|d,z|e,b|z,a|d,a|e,b|f,z|d,a|e,b|e,a|z,c|e,c|f,z|f, b|e,b|d,c|z,c|f,z|f,z|z,z|z,c|z,a|e,b|e,b|f,z|d,c|d,a|f,a|f,z|e, c|f,z|f,z|d,a|z,b|d,a|d,c|e,b|f,a|d,a|e,b|z,c|d,z|e,b|z,a|z,c|e]; a=1<<25; b=1<<30; c=a|b; d=1<<8; e=1<<19; f=d|e; - SP5 = [z|d,a|f,a|e,c|d,z|e,z|d,b|z,a|e,b|f,z|e,a|d,b|f,c|d,c|e,z|f,b|z, + const SP5 = [z|d,a|f,a|e,c|d,z|e,z|d,b|z,a|e,b|f,z|e,a|d,b|f,c|d,c|e,z|f,b|z, a|z,b|e,b|e,z|z,b|d,c|f,c|f,a|d,c|e,b|d,z|z,c|z,a|f,a|z,c|z,z|f, z|e,c|d,z|d,a|z,b|z,a|e,c|d,b|f,a|d,b|z,c|e,a|f,b|f,z|d,a|z,c|e, c|f,z|f,c|z,c|f,a|e,z|z,b|e,c|z,z|f,a|d,b|d,z|e,z|z,b|e,a|f,b|d]; a=1<<22; b=1<<29; c=a|b; d=1<<4; e=1<<14; f=d|e; - SP6 = [b|d,c|z,z|e,c|f,c|z,z|d,c|f,a|z,b|e,a|f,a|z,b|d,a|d,b|e,b|z,z|f, + const SP6 = [b|d,c|z,z|e,c|f,c|z,z|d,c|f,a|z,b|e,a|f,a|z,b|d,a|d,b|e,b|z,z|f, z|z,a|d,b|f,z|e,a|e,b|f,z|d,c|d,c|d,z|z,a|f,c|e,z|f,a|e,c|e,b|z, b|e,z|d,c|d,a|e,c|f,a|z,z|f,b|d,a|z,b|e,b|z,z|f,b|d,c|f,a|e,c|z, a|f,c|e,z|z,c|d,z|d,z|e,c|z,a|f,z|e,a|d,b|f,z|z,c|e,b|z,a|d,b|f]; a=1<<21; b=1<<26; c=a|b; d=1<<1; e=1<<11; f=d|e; - SP7 = [a|z,c|d,b|f,z|z,z|e,b|f,a|f,c|e,c|f,a|z,z|z,b|d,z|d,b|z,c|d,z|f, + const SP7 = [a|z,c|d,b|f,z|z,z|e,b|f,a|f,c|e,c|f,a|z,z|z,b|d,z|d,b|z,c|d,z|f, b|e,a|f,a|d,b|e,b|d,c|z,c|e,a|d,c|z,z|e,z|f,c|f,a|e,z|d,b|z,a|e, b|z,a|e,a|z,b|f,b|f,c|d,c|d,z|d,a|d,b|z,b|e,a|z,c|e,z|f,a|f,c|e, z|f,b|d,c|f,c|z,a|e,z|z,z|d,c|f,z|z,a|f,c|z,z|e,b|d,b|e,z|e,a|d]; a=1<<18; b=1<<28; c=a|b; d=1<<6; e=1<<12; f=d|e; - SP8 = [b|f,z|e,a|z,c|f,b|z,b|f,z|d,b|z,a|d,c|z,c|f,a|e,c|e,a|f,z|e,z|d, + const SP8 = [b|f,z|e,a|z,c|f,b|z,b|f,z|d,b|z,a|d,c|z,c|f,a|e,c|e,a|f,z|e,z|d, c|z,b|d,b|e,z|f,a|e,a|d,c|d,c|e,z|f,z|z,z|z,c|d,b|d,b|e,a|f,a|z, a|f,a|z,c|e,z|e,z|d,c|d,z|e,a|f,b|e,z|d,b|d,c|z,c|d,b|z,a|z,b|f, z|z,c|f,a|d,b|d,c|z,b|e,b|f,z|z,c|f,a|e,a|e,z|f,z|f,a|d,b|z,c|e]; - // jshint +W013,+W015 // Set the key. function setKeys(keyBlock) { - var i, j, l, m, n, o, pc1m = [], pcr = [], kn = [], - raw0, raw1, rawi, KnLi; + const pc1m = [], pcr = [], kn = []; + let l, m, n; - for (j = 0, l = 56; j < 56; ++j, l -= 8) { + for (let j = 0, l = 56; j < 56; ++j, l -= 8) { l += l < -5 ? 65 : l < -3 ? 31 : l < -1 ? 63 : l === 27 ? 35 : 0; // PC1 m = l & 0x7; pc1m[j] = ((keyBlock[l >>> 3] & (1<>> 10; @@ -186,7 +176,8 @@ export default function DES(passwd) { // Encrypt 8 bytes of text function enc8(text) { - var i = 0, b = text.slice(), fval, keysi = 0, + const b = text.slice(); + let i = 0, fval, keysi = 0, l, r, x; // left, right, accumulator // Squash 8 bytes to 2 ints @@ -271,6 +262,5 @@ export default function DES(passwd) { } setKeys(passwd); // Setup keys - return {'encrypt': encrypt}; // Public interface - -}; // function DES + return { encrypt }; // Public interface +} diff --git a/core/display.js b/core/display.js index 3b12f102..8143b831 100644 --- a/core/display.js +++ b/core/display.js @@ -7,73 +7,10 @@ * See README.md for usage and integration instructions. */ -/*jslint browser: true, white: false */ -/*global Util, Base64, changeCursor */ - import * as Log from './util/logging.js'; import Base64 from "./base64.js"; -export default function Display(target) { - this._drawCtx = null; - this._c_forceCanvas = false; - - this._renderQ = []; // queue drawing actions for in-oder rendering - this._flushing = false; - - // the full frame buffer (logical canvas) size - this._fb_width = 0; - this._fb_height = 0; - - this._prevDrawStyle = ""; - this._tile = null; - this._tile16x16 = null; - this._tile_x = 0; - this._tile_y = 0; - - Log.Debug(">> Display.constructor"); - - // The visible canvas - this._target = target; - - if (!this._target) { - throw new Error("Target must be set"); - } - - if (typeof this._target === 'string') { - throw new Error('target must be a DOM element'); - } - - if (!this._target.getContext) { - throw new Error("no getContext method"); - } - - this._targetCtx = this._target.getContext('2d'); - - // the visible canvas viewport (i.e. what actually gets seen) - this._viewportLoc = { 'x': 0, 'y': 0, 'w': this._target.width, 'h': this._target.height }; - - // The hidden canvas, where we do the actual rendering - this._backbuffer = document.createElement('canvas'); - this._drawCtx = this._backbuffer.getContext('2d'); - - this._damageBounds = { left:0, top:0, - right: this._backbuffer.width, - bottom: this._backbuffer.height }; - - Log.Debug("User Agent: " + navigator.userAgent); - - this.clear(); - - // Check canvas features - if (!('createImageData' in this._drawCtx)) { - throw new Error("Canvas does not support createImageData"); - } - - this._tile16x16 = this._drawCtx.createImageData(16, 16); - Log.Debug("<< Display.constructor"); -}; - -var SUPPORTS_IMAGEDATA_CONSTRUCTOR = false; +let SUPPORTS_IMAGEDATA_CONSTRUCTOR = false; try { new ImageData(new Uint8ClampedArray(4), 1, 1); SUPPORTS_IMAGEDATA_CONSTRUCTOR = true; @@ -81,42 +18,106 @@ try { // ignore failure } -Display.prototype = { +export default class Display { + constructor(target) { + this._drawCtx = null; + this._c_forceCanvas = false; + + this._renderQ = []; // queue drawing actions for in-oder rendering + this._flushing = false; + + // the full frame buffer (logical canvas) size + this._fb_width = 0; + this._fb_height = 0; + + this._prevDrawStyle = ""; + this._tile = null; + this._tile16x16 = null; + this._tile_x = 0; + this._tile_y = 0; + + Log.Debug(">> Display.constructor"); + + // The visible canvas + this._target = target; + + if (!this._target) { + throw new Error("Target must be set"); + } + + if (typeof this._target === 'string') { + throw new Error('target must be a DOM element'); + } + + if (!this._target.getContext) { + throw new Error("no getContext method"); + } + + this._targetCtx = this._target.getContext('2d'); + + // the visible canvas viewport (i.e. what actually gets seen) + this._viewportLoc = { 'x': 0, 'y': 0, 'w': this._target.width, 'h': this._target.height }; + + // The hidden canvas, where we do the actual rendering + this._backbuffer = document.createElement('canvas'); + this._drawCtx = this._backbuffer.getContext('2d'); + + this._damageBounds = { left:0, top:0, + right: this._backbuffer.width, + bottom: this._backbuffer.height }; + + Log.Debug("User Agent: " + navigator.userAgent); + + this.clear(); + + // Check canvas features + if (!('createImageData' in this._drawCtx)) { + throw new Error("Canvas does not support createImageData"); + } + + this._tile16x16 = this._drawCtx.createImageData(16, 16); + + + // ===== PROPERTIES ===== + + this._scale = 1.0; + this._clipViewport = false; + this.logo = null; + + Log.Debug("<< Display.constructor"); + } + // ===== PROPERTIES ===== - _scale: 1.0, - get scale() { return this._scale; }, + get scale() { return this._scale; } set scale(scale) { this._rescale(scale); - }, + } - _clipViewport: false, - get clipViewport() { return this._clipViewport; }, + get clipViewport() { return this._clipViewport; } set clipViewport(viewport) { this._clipViewport = viewport; // May need to readjust the viewport dimensions - var vp = this._viewportLoc; + const vp = this._viewportLoc; this.viewportChangeSize(vp.w, vp.h); this.viewportChangePos(0, 0); - }, + } get width() { return this._fb_width; - }, + } get height() { return this._fb_height; - }, - - logo: null, + } // ===== EVENT HANDLERS ===== - onflush: function () {}, // A flush request has finished + onflush() {} // A flush request has finished // ===== PUBLIC METHODS ===== - viewportChangePos: function (deltaX, deltaY) { - var vp = this._viewportLoc; + viewportChangePos(deltaX, deltaY) { + const vp = this._viewportLoc; deltaX = Math.floor(deltaX); deltaY = Math.floor(deltaY); @@ -125,8 +126,8 @@ Display.prototype = { deltaY = -vp.h; } - var vx2 = vp.x + vp.w - 1; - var vy2 = vp.y + vp.h - 1; + const vx2 = vp.x + vp.w - 1; + const vy2 = vp.y + vp.h - 1; // Position change @@ -155,10 +156,9 @@ Display.prototype = { this._damage(vp.x, vp.y, vp.w, vp.h); this.flip(); - }, - - viewportChangeSize: function(width, height) { + } + viewportChangeSize(width, height) { if (!this._clipViewport || typeof(width) === "undefined" || typeof(height) === "undefined") { @@ -175,12 +175,12 @@ Display.prototype = { height = this._fb_height; } - var vp = this._viewportLoc; + const vp = this._viewportLoc; if (vp.w !== width || vp.h !== height) { vp.w = width; vp.h = height; - var canvas = this._target; + const canvas = this._target; canvas.width = width; canvas.height = height; @@ -193,27 +193,27 @@ Display.prototype = { // Update the visible size of the target canvas this._rescale(this._scale); } - }, + } - absX: function (x) { + absX(x) { return x / this._scale + this._viewportLoc.x; - }, + } - absY: function (y) { + absY(y) { return y / this._scale + this._viewportLoc.y; - }, + } - resize: function (width, height) { + resize(width, height) { this._prevDrawStyle = ""; this._fb_width = width; this._fb_height = height; - var canvas = this._backbuffer; + const canvas = this._backbuffer; if (canvas.width !== width || canvas.height !== height) { // We have to save the canvas data since changing the size will clear it - var saveImg = null; + let saveImg = null; if (canvas.width > 0 && canvas.height > 0) { saveImg = this._drawCtx.getImageData(0, 0, canvas.width, canvas.height); } @@ -232,13 +232,13 @@ Display.prototype = { // Readjust the viewport as it may be incorrectly sized // and positioned - var vp = this._viewportLoc; + const vp = this._viewportLoc; this.viewportChangeSize(vp.w, vp.h); this.viewportChangePos(0, 0); - }, + } // Track what parts of the visible canvas that need updating - _damage: function(x, y, w, h) { + _damage(x, y, w, h) { if (x < this._damageBounds.left) { this._damageBounds.left = x; } @@ -251,59 +251,58 @@ Display.prototype = { if ((y + h) > this._damageBounds.bottom) { this._damageBounds.bottom = y + h; } - }, + } // Update the visible canvas with the contents of the // rendering canvas - flip: function(from_queue) { + flip(from_queue) { if (this._renderQ.length !== 0 && !from_queue) { this._renderQ_push({ 'type': 'flip' }); - } else { - var x, y, vx, vy, w, h; - - x = this._damageBounds.left; - y = this._damageBounds.top; - w = this._damageBounds.right - x; - h = this._damageBounds.bottom - y; - - vx = x - this._viewportLoc.x; - vy = y - this._viewportLoc.y; - - if (vx < 0) { - w += vx; - x -= vx; - vx = 0; - } - if (vy < 0) { - h += vy; - y -= vy; - vy = 0; - } - - if ((vx + w) > this._viewportLoc.w) { - w = this._viewportLoc.w - vx; - } - if ((vy + h) > this._viewportLoc.h) { - h = this._viewportLoc.h - vy; - } - - if ((w > 0) && (h > 0)) { - // FIXME: We may need to disable image smoothing here - // as well (see copyImage()), but we haven't - // noticed any problem yet. - this._targetCtx.drawImage(this._backbuffer, - x, y, w, h, - vx, vy, w, h); - } - - this._damageBounds.left = this._damageBounds.top = 65535; - this._damageBounds.right = this._damageBounds.bottom = 0; + return; } - }, - clear: function () { + let x = this._damageBounds.left; + let y = this._damageBounds.top; + let w = this._damageBounds.right - x; + let h = this._damageBounds.bottom - y; + + let vx = x - this._viewportLoc.x; + let vy = y - this._viewportLoc.y; + + if (vx < 0) { + w += vx; + x -= vx; + vx = 0; + } + if (vy < 0) { + h += vy; + y -= vy; + vy = 0; + } + + if ((vx + w) > this._viewportLoc.w) { + w = this._viewportLoc.w - vx; + } + if ((vy + h) > this._viewportLoc.h) { + h = this._viewportLoc.h - vy; + } + + if ((w > 0) && (h > 0)) { + // FIXME: We may need to disable image smoothing here + // as well (see copyImage()), but we haven't + // noticed any problem yet. + this._targetCtx.drawImage(this._backbuffer, + x, y, w, h, + vx, vy, w, h); + } + + this._damageBounds.left = this._damageBounds.top = 65535; + this._damageBounds.right = this._damageBounds.bottom = 0; + } + + clear() { if (this._logo) { this.resize(this._logo.width, this._logo.height); this.imageRect(0, 0, this._logo.type, this._logo.data); @@ -312,21 +311,21 @@ Display.prototype = { this._drawCtx.clearRect(0, 0, this._fb_width, this._fb_height); } this.flip(); - }, + } - pending: function() { + pending() { return this._renderQ.length > 0; - }, + } - flush: function() { + flush() { if (this._renderQ.length === 0) { this.onflush(); } else { this._flushing = true; } - }, + } - fillRect: function (x, y, width, height, color, from_queue) { + fillRect(x, y, width, height, color, from_queue) { if (this._renderQ.length !== 0 && !from_queue) { this._renderQ_push({ 'type': 'fill', @@ -341,9 +340,9 @@ Display.prototype = { this._drawCtx.fillRect(x, y, width, height); this._damage(x, y, width, height); } - }, + } - copyImage: function (old_x, old_y, new_x, new_y, w, h, from_queue) { + copyImage(old_x, old_y, new_x, new_y, w, h, from_queue) { if (this._renderQ.length !== 0 && !from_queue) { this._renderQ_push({ 'type': 'copy', @@ -372,10 +371,10 @@ Display.prototype = { new_x, new_y, w, h); this._damage(new_x, new_y, w, h); } - }, + } - imageRect: function(x, y, mime, arr) { - var img = new Image(); + imageRect(x, y, mime, arr) { + const img = new Image(); img.src = "data: " + mime + ";base64," + Base64.encode(arr); this._renderQ_push({ 'type': 'img', @@ -383,10 +382,10 @@ Display.prototype = { 'x': x, 'y': y }); - }, + } // start updating a tile - startTile: function (x, y, width, height, color) { + startTile(x, y, width, height, color) { this._tile_x = x; this._tile_y = y; if (width === 16 && height === 16) { @@ -395,171 +394,172 @@ Display.prototype = { this._tile = this._drawCtx.createImageData(width, height); } - var red = color[2]; - var green = color[1]; - var blue = color[0]; + const red = color[2]; + const green = color[1]; + const blue = color[0]; - var data = this._tile.data; - for (var i = 0; i < width * height * 4; i += 4) { + const data = this._tile.data; + for (let i = 0; i < width * height * 4; i += 4) { data[i] = red; data[i + 1] = green; data[i + 2] = blue; data[i + 3] = 255; } - }, + } // update sub-rectangle of the current tile - subTile: function (x, y, w, h, color) { - var red = color[2]; - var green = color[1]; - var blue = color[0]; - var xend = x + w; - var yend = y + h; + subTile(x, y, w, h, color) { + const red = color[2]; + const green = color[1]; + const blue = color[0]; + const xend = x + w; + const yend = y + h; - var data = this._tile.data; - var width = this._tile.width; - for (var j = y; j < yend; j++) { - for (var i = x; i < xend; i++) { - var p = (i + (j * width)) * 4; + const data = this._tile.data; + const width = this._tile.width; + for (let j = y; j < yend; j++) { + for (let i = x; i < xend; i++) { + const p = (i + (j * width)) * 4; data[p] = red; data[p + 1] = green; data[p + 2] = blue; data[p + 3] = 255; } } - }, + } // draw the current tile to the screen - finishTile: function () { + finishTile() { this._drawCtx.putImageData(this._tile, this._tile_x, this._tile_y); this._damage(this._tile_x, this._tile_y, this._tile.width, this._tile.height); - }, + } - blitImage: function (x, y, width, height, arr, offset, from_queue) { - if (this._renderQ.length !== 0 && !from_queue) { - // NB(directxman12): it's technically more performant here to use preallocated arrays, - // but it's a lot of extra work for not a lot of payoff -- if we're using the render queue, - // this probably isn't getting called *nearly* as much - var new_arr = new Uint8Array(width * height * 4); - new_arr.set(new Uint8Array(arr.buffer, 0, new_arr.length)); - this._renderQ_push({ - 'type': 'blit', - 'data': new_arr, - 'x': x, - 'y': y, - 'width': width, - 'height': height, - }); - } else { + blitImage(x, y, width, height, arr, offset, from_queue) { + if (this._renderQ.length === 0 || from_queue) { this._bgrxImageData(x, y, width, height, arr, offset); + return; } - }, - blitRgbImage: function (x, y , width, height, arr, offset, from_queue) { - if (this._renderQ.length !== 0 && !from_queue) { - // NB(directxman12): it's technically more performant here to use preallocated arrays, - // but it's a lot of extra work for not a lot of payoff -- if we're using the render queue, - // this probably isn't getting called *nearly* as much - var new_arr = new Uint8Array(width * height * 3); - new_arr.set(new Uint8Array(arr.buffer, 0, new_arr.length)); - this._renderQ_push({ - 'type': 'blitRgb', - 'data': new_arr, - 'x': x, - 'y': y, - 'width': width, - 'height': height, - }); - } else { + // NB(directxman12): it's technically more performant here to use preallocated arrays, + // but it's a lot of extra work for not a lot of payoff -- if we're using the render queue, + // this probably isn't getting called *nearly* as much + const new_arr = new Uint8Array(width * height * 4); + new_arr.set(new Uint8Array(arr.buffer, 0, new_arr.length)); + this._renderQ_push({ + 'type': 'blit', + 'data': new_arr, + 'x': x, + 'y': y, + 'width': width, + 'height': height, + }); + } + + blitRgbImage(x, y , width, height, arr, offset, from_queue) { + if (this._renderQ.length === 0 || from_queue) { this._rgbImageData(x, y, width, height, arr, offset); + return; } - }, - blitRgbxImage: function (x, y, width, height, arr, offset, from_queue) { - if (this._renderQ.length !== 0 && !from_queue) { - // NB(directxman12): it's technically more performant here to use preallocated arrays, - // but it's a lot of extra work for not a lot of payoff -- if we're using the render queue, - // this probably isn't getting called *nearly* as much - var new_arr = new Uint8Array(width * height * 4); - new_arr.set(new Uint8Array(arr.buffer, 0, new_arr.length)); - this._renderQ_push({ - 'type': 'blitRgbx', - 'data': new_arr, - 'x': x, - 'y': y, - 'width': width, - 'height': height, - }); - } else { + // NB(directxman12): it's technically more performant here to use preallocated arrays, + // but it's a lot of extra work for not a lot of payoff -- if we're using the render queue, + // this probably isn't getting called *nearly* as much + const new_arr = new Uint8Array(width * height * 3); + new_arr.set(new Uint8Array(arr.buffer, 0, new_arr.length)); + this._renderQ_push({ + 'type': 'blitRgb', + 'data': new_arr, + 'x': x, + 'y': y, + 'width': width, + 'height': height, + }); + } + + blitRgbxImage(x, y, width, height, arr, offset, from_queue) { + if (this._renderQ.length === 0 || from_queue) { this._rgbxImageData(x, y, width, height, arr, offset); + return; } - }, - drawImage: function (img, x, y) { + + // NB(directxman12): it's technically more performant here to use preallocated arrays, + // but it's a lot of extra work for not a lot of payoff -- if we're using the render queue, + // this probably isn't getting called *nearly* as much + const new_arr = new Uint8Array(width * height * 4); + new_arr.set(new Uint8Array(arr.buffer, 0, new_arr.length)); + this._renderQ_push({ + 'type': 'blitRgbx', + 'data': new_arr, + 'x': x, + 'y': y, + 'width': width, + 'height': height, + }); + } + + drawImage(img, x, y) { this._drawCtx.drawImage(img, x, y); this._damage(x, y, img.width, img.height); - }, + } - changeCursor: function (pixels, mask, hotx, hoty, w, h) { + changeCursor(pixels, mask, hotx, hoty, w, h) { Display.changeCursor(this._target, pixels, mask, hotx, hoty, w, h); - }, + } - defaultCursor: function () { + defaultCursor() { this._target.style.cursor = "default"; - }, + } - disableLocalCursor: function () { + disableLocalCursor() { this._target.style.cursor = "none"; - }, + } - autoscale: function (containerWidth, containerHeight) { - var vp = this._viewportLoc; - var targetAspectRatio = containerWidth / containerHeight; - var fbAspectRatio = vp.w / vp.h; + autoscale(containerWidth, containerHeight) { + const vp = this._viewportLoc; + const targetAspectRatio = containerWidth / containerHeight; + const fbAspectRatio = vp.w / vp.h; - var scaleRatio; - if (fbAspectRatio >= targetAspectRatio) { - scaleRatio = containerWidth / vp.w; - } else { - scaleRatio = containerHeight / vp.h; - } + const scaleRatio = (fbAspectRatio >= targetAspectRatio) + ? containerWidth / vp.w + : containerHeight / vp.h; this._rescale(scaleRatio); - }, + } // ===== PRIVATE METHODS ===== - _rescale: function (factor) { + _rescale(factor) { this._scale = factor; - var vp = this._viewportLoc; + const vp = this._viewportLoc; // NB(directxman12): If you set the width directly, or set the // style width to a number, the canvas is cleared. // However, if you set the style width to a string // ('NNNpx'), the canvas is scaled without clearing. - var width = Math.round(factor * vp.w) + 'px'; - var height = Math.round(factor * vp.h) + 'px'; + const width = Math.round(factor * vp.w) + 'px'; + const height = Math.round(factor * vp.h) + 'px'; if ((this._target.style.width !== width) || (this._target.style.height !== height)) { this._target.style.width = width; this._target.style.height = height; } - }, + } - _setFillColor: function (color) { - var newStyle = 'rgb(' + color[2] + ',' + color[1] + ',' + color[0] + ')'; + _setFillColor(color) { + const newStyle = 'rgb(' + color[2] + ',' + color[1] + ',' + color[0] + ')'; if (newStyle !== this._prevDrawStyle) { this._drawCtx.fillStyle = newStyle; this._prevDrawStyle = newStyle; } - }, + } - _rgbImageData: function (x, y, width, height, arr, offset) { - var img = this._drawCtx.createImageData(width, height); - var data = img.data; - for (var i = 0, j = offset; i < width * height * 4; i += 4, j += 3) { + _rgbImageData(x, y, width, height, arr, offset) { + const img = this._drawCtx.createImageData(width, height); + const data = img.data; + for (let i = 0, j = offset; i < width * height * 4; i += 4, j += 3) { data[i] = arr[j]; data[i + 1] = arr[j + 1]; data[i + 2] = arr[j + 2]; @@ -567,12 +567,12 @@ Display.prototype = { } this._drawCtx.putImageData(img, x, y); this._damage(x, y, img.width, img.height); - }, + } - _bgrxImageData: function (x, y, width, height, arr, offset) { - var img = this._drawCtx.createImageData(width, height); - var data = img.data; - for (var i = 0, j = offset; i < width * height * 4; i += 4, j += 4) { + _bgrxImageData(x, y, width, height, arr, offset) { + const img = this._drawCtx.createImageData(width, height); + const data = img.data; + for (let i = 0, j = offset; i < width * height * 4; i += 4, j += 4) { data[i] = arr[j + 2]; data[i + 1] = arr[j + 1]; data[i + 2] = arr[j]; @@ -580,11 +580,11 @@ Display.prototype = { } this._drawCtx.putImageData(img, x, y); this._damage(x, y, img.width, img.height); - }, + } - _rgbxImageData: function (x, y, width, height, arr, offset) { + _rgbxImageData(x, y, width, height, arr) { // NB(directxman12): arr must be an Type Array view - var img; + let img; if (SUPPORTS_IMAGEDATA_CONSTRUCTOR) { img = new ImageData(new Uint8ClampedArray(arr.buffer, arr.byteOffset, width * height * 4), width, height); } else { @@ -593,28 +593,28 @@ Display.prototype = { } this._drawCtx.putImageData(img, x, y); this._damage(x, y, img.width, img.height); - }, + } - _renderQ_push: function (action) { + _renderQ_push(action) { this._renderQ.push(action); if (this._renderQ.length === 1) { // If this can be rendered immediately it will be, otherwise // the scanner will wait for the relevant event this._scan_renderQ(); } - }, + } - _resume_renderQ: function() { + _resume_renderQ() { // "this" is the object that is ready, not the // display object this.removeEventListener('load', this._noVNC_display._resume_renderQ); this._noVNC_display._scan_renderQ(); - }, + } - _scan_renderQ: function () { - var ready = true; + _scan_renderQ() { + let ready = true; while (ready && this._renderQ.length > 0) { - var a = this._renderQ[0]; + const a = this._renderQ[0]; switch (a.type) { case 'flip': this.flip(true); @@ -656,22 +656,21 @@ Display.prototype = { this._flushing = false; this.onflush(); } - }, -}; + } +} // Class Methods -Display.changeCursor = function (target, pixels, mask, hotx, hoty, w, h) { +Display.changeCursor = (target, pixels, mask, hotx, hoty, w, h) => { if ((w === 0) || (h === 0)) { target.style.cursor = 'none'; return; } - var cur = [] - var y, x; - for (y = 0; y < h; y++) { - for (x = 0; x < w; x++) { - var idx = y * Math.ceil(w / 8) + Math.floor(x / 8); - var alpha = (mask[idx] << (x % 8)) & 0x80 ? 255 : 0; + const cur = []; + for (let y = 0; y < h; y++) { + for (let x = 0; x < w; x++) { + let idx = y * Math.ceil(w / 8) + Math.floor(x / 8); + const alpha = (mask[idx] << (x % 8)) & 0x80 ? 255 : 0; idx = ((w * y) + x) * 4; cur.push(pixels[idx + 2]); // red cur.push(pixels[idx + 1]); // green @@ -680,13 +679,13 @@ Display.changeCursor = function (target, pixels, mask, hotx, hoty, w, h) { } } - var canvas = document.createElement('canvas'); - var ctx = canvas.getContext('2d'); + const canvas = document.createElement('canvas'); + const ctx = canvas.getContext('2d'); canvas.width = w; canvas.height = h; - var img; + let img; if (SUPPORTS_IMAGEDATA_CONSTRUCTOR) { img = new ImageData(new Uint8ClampedArray(cur), w, h); } else { @@ -696,6 +695,6 @@ Display.changeCursor = function (target, pixels, mask, hotx, hoty, w, h) { ctx.clearRect(0, 0, w, h); ctx.putImageData(img, 0, 0); - var url = canvas.toDataURL(); + const url = canvas.toDataURL(); target.style.cursor = 'url(' + url + ')' + hotx + ' ' + hoty + ', default'; }; diff --git a/core/encodings.js b/core/encodings.js index a0551d63..70ee5dc2 100644 --- a/core/encodings.js +++ b/core/encodings.js @@ -6,7 +6,7 @@ * See README.md for usage and integration instructions. */ -export var encodings = { +export let encodings = { encodingRaw: 0, encodingCopyRect: 1, encodingRRE: 2, diff --git a/core/inflator.js b/core/inflator.js index a4d6ff6a..0eab8fe4 100644 --- a/core/inflator.js +++ b/core/inflator.js @@ -1,8 +1,17 @@ import { inflateInit, inflate, inflateReset } from "../vendor/pako/lib/zlib/inflate.js"; import ZStream from "../vendor/pako/lib/zlib/zstream.js"; -Inflate.prototype = { - inflate: function (data, flush, expected) { +export default class Inflate { + constructor() { + this.strm = new ZStream(); + this.chunkSize = 1024 * 10 * 10; + this.strm.output = new Uint8Array(this.chunkSize); + this.windowBits = 5; + + inflateInit(this.strm, this.windowBits); + } + + inflate(data, flush, expected) { this.strm.input = data; this.strm.avail_in = this.strm.input.length; this.strm.next_in = 0; @@ -21,18 +30,9 @@ Inflate.prototype = { inflate(this.strm, flush); return new Uint8Array(this.strm.output.buffer, 0, this.strm.next_out); - }, + } - reset: function () { + reset() { inflateReset(this.strm); } -}; - -export default function Inflate() { - this.strm = new ZStream(); - this.chunkSize = 1024 * 10 * 10; - this.strm.output = new Uint8Array(this.chunkSize); - this.windowBits = 5; - - inflateInit(this.strm, this.windowBits); -}; +} diff --git a/core/input/domkeytable.js b/core/input/domkeytable.js index 7103bba7..a0cc1f5a 100644 --- a/core/input/domkeytable.js +++ b/core/input/domkeytable.js @@ -13,7 +13,7 @@ import KeyTable from "./keysym.js"; * See https://www.w3.org/TR/uievents-key/ for possible values. */ -var DOMKeyTable = {}; +const DOMKeyTable = {}; function addStandard(key, standard) { diff --git a/core/input/keyboard.js b/core/input/keyboard.js index 464d1ce8..1c3fe14e 100644 --- a/core/input/keyboard.js +++ b/core/input/keyboard.js @@ -5,61 +5,40 @@ * Licensed under MPL 2.0 or any later version (see LICENSE.txt) */ -/*jslint browser: true, white: false */ -/*global window, Util */ - import * as Log from '../util/logging.js'; import { stopEvent } from '../util/events.js'; import * as KeyboardUtil from "./util.js"; import KeyTable from "./keysym.js"; +import * as browserUtils from "../util/browsers.js"; // // Keyboard event handler // -export default function Keyboard(target) { - this._target = target || null; +export default class Keyboard { + constructor(target) { + this._target = target || null; - this._keyDownList = {}; // List of depressed keys - // (even if they are happy) - this._pendingKey = null; // Key waiting for keypress + this._keyDownList = {}; // List of depressed keys + // (even if they are happy) + this._pendingKey = null; // Key waiting for keypress - // keep these here so we can refer to them later - this._eventHandlers = { - 'keyup': this._handleKeyUp.bind(this), - 'keydown': this._handleKeyDown.bind(this), - 'keypress': this._handleKeyPress.bind(this), - 'blur': this._allKeysUp.bind(this) - }; -}; + // keep these here so we can refer to them later + this._eventHandlers = { + 'keyup': this._handleKeyUp.bind(this), + 'keydown': this._handleKeyDown.bind(this), + 'keypress': this._handleKeyPress.bind(this), + 'blur': this._allKeysUp.bind(this) + }; + } -function isMac() { - return navigator && !!(/mac/i).exec(navigator.platform); -} -function isWindows() { - return navigator && !!(/win/i).exec(navigator.platform); -} -function isIOS() { - return navigator && - (!!(/ipad/i).exec(navigator.platform) || - !!(/iphone/i).exec(navigator.platform) || - !!(/ipod/i).exec(navigator.platform)); -} -function isIE() { - return navigator && !!(/trident/i).exec(navigator.userAgent); -} -function isEdge() { - return navigator && !!(/edge/i).exec(navigator.userAgent); -} - -Keyboard.prototype = { // ===== EVENT HANDLERS ===== - onkeyevent: function () {}, // Handler for key press/release + onkeyevent() {} // Handler for key press/release // ===== PRIVATE METHODS ===== - _sendKeyEvent: function (keysym, code, down) { + _sendKeyEvent(keysym, code, down) { Log.Debug("onkeyevent " + (down ? "down" : "up") + ", keysym: " + keysym, ", code: " + code); @@ -67,8 +46,8 @@ Keyboard.prototype = { // AltGraph, which tends to confuse the hell out of // remote systems. Fake a release of these keys until // there is a way to detect AltGraph properly. - var fakeAltGraph = false; - if (down && isWindows()) { + let fakeAltGraph = false; + if (down && browserUtils.isWindows()) { if ((code !== 'ControlLeft') && (code !== 'AltRight') && ('ControlLeft' in this._keyDownList) && @@ -89,10 +68,10 @@ Keyboard.prototype = { this.onkeyevent(this._keyDownList['AltRight'], 'AltRight', true); } - }, + } - _getKeyCode: function (e) { - var code = KeyboardUtil.getKeycode(e); + _getKeyCode(e) { + const code = KeyboardUtil.getKeycode(e); if (code !== 'Unidentified') { return code; } @@ -115,26 +94,26 @@ Keyboard.prototype = { return e.keyIdentifier; } - var codepoint = parseInt(e.keyIdentifier.substr(2), 16); - var char = String.fromCharCode(codepoint); + const codepoint = parseInt(e.keyIdentifier.substr(2), 16); + // Some implementations fail to uppercase the symbols - char = char.toUpperCase(); + const char = String.fromCharCode(codepoint).toUpperCase(); return 'Platform' + char.charCodeAt(); } return 'Unidentified'; - }, + } - _handleKeyDown: function (e) { - var code = this._getKeyCode(e); - var keysym = KeyboardUtil.getKeysym(e); + _handleKeyDown(e) { + let code = this._getKeyCode(e); + let keysym = KeyboardUtil.getKeysym(e); // We cannot handle keys we cannot track, but we also need // to deal with virtual keyboards which omit key info // (iOS omits tracking info on keyup events, which forces us to // special treat that platform here) - if ((code === 'Unidentified') || isIOS()) { + if ((code === 'Unidentified') || browserUtils.isIOS()) { if (keysym) { // If it's a virtual keyboard then it should be // sufficient to just send press and release right @@ -151,7 +130,7 @@ Keyboard.prototype = { // keys around a bit to make things more sane for the remote // server. This method is used by RealVNC and TigerVNC (and // possibly others). - if (isMac()) { + if (browserUtils.isMac()) { switch (keysym) { case KeyTable.XK_Super_L: keysym = KeyTable.XK_Alt_L; @@ -178,7 +157,7 @@ Keyboard.prototype = { // state change events. That gets extra confusing for CapsLock // which toggles on each press, but not on release. So pretend // it was a quick press and release of the button. - if (isMac() && (code === 'CapsLock')) { + if (browserUtils.isMac() && (code === 'CapsLock')) { this._sendKeyEvent(KeyTable.XK_Caps_Lock, 'CapsLock', true); this._sendKeyEvent(KeyTable.XK_Caps_Lock, 'CapsLock', false); stopEvent(e); @@ -189,7 +168,8 @@ Keyboard.prototype = { // a keypress event as well // (IE and Edge has a broken KeyboardEvent.key, so we can't // just check for the presence of that field) - if (!keysym && (!e.key || isIE() || isEdge())) { + if (!keysym + && (!e.key || browserUtils.isIE() || browserUtils.isEdge())) { this._pendingKey = code; // However we might not get a keypress event if the key // is non-printable, which needs some special fallback @@ -204,10 +184,10 @@ Keyboard.prototype = { this._keyDownList[code] = keysym; this._sendKeyEvent(keysym, code, true); - }, + } // Legacy event for browsers without code/key - _handleKeyPress: function (e) { + _handleKeyPress(e) { stopEvent(e); // Are we expecting a keypress? @@ -215,8 +195,8 @@ Keyboard.prototype = { return; } - var code = this._getKeyCode(e); - var keysym = KeyboardUtil.getKeysym(e); + let code = this._getKeyCode(e); + const keysym = KeyboardUtil.getKeysym(e); // The key we were waiting for? if ((code !== 'Unidentified') && (code != this._pendingKey)) { @@ -227,23 +207,24 @@ Keyboard.prototype = { this._pendingKey = null; if (!keysym) { - console.log('keypress with no keysym:', e); + Log.Debug('keypress with no keysym:', e); return; } this._keyDownList[code] = keysym; this._sendKeyEvent(keysym, code, true); - }, - _handleKeyPressTimeout: function (e) { + } + + _handleKeyPressTimeout(e) { // Did someone manage to sort out the key already? if (this._pendingKey === null) { return; } - var code, keysym; + let keysym; - code = this._pendingKey; + const code = this._pendingKey; this._pendingKey = null; // We have no way of knowing the proper keysym with the @@ -254,12 +235,11 @@ Keyboard.prototype = { keysym = e.keyCode; } else if ((e.keyCode >= 0x41) && (e.keyCode <= 0x5a)) { // Character (A-Z) - var char = String.fromCharCode(e.keyCode); + let char = String.fromCharCode(e.keyCode); // A feeble attempt at the correct case - if (e.shiftKey) - char = char.toUpperCase(); - else - char = char.toLowerCase(); + char = e.shiftKey + ? char.toUpperCase() + : char.toLowerCase(); keysym = char.charCodeAt(); } else { // Unknown, give up @@ -269,15 +249,15 @@ Keyboard.prototype = { this._keyDownList[code] = keysym; this._sendKeyEvent(keysym, code, true); - }, + } - _handleKeyUp: function (e) { + _handleKeyUp(e) { stopEvent(e); - var code = this._getKeyCode(e); + const code = this._getKeyCode(e); // See comment in _handleKeyDown() - if (isMac() && (code === 'CapsLock')) { + if (browserUtils.isMac() && (code === 'CapsLock')) { this._sendKeyEvent(KeyTable.XK_Caps_Lock, 'CapsLock', true); this._sendKeyEvent(KeyTable.XK_Caps_Lock, 'CapsLock', false); return; @@ -291,22 +271,22 @@ Keyboard.prototype = { this._sendKeyEvent(this._keyDownList[code], code, false); delete this._keyDownList[code]; - }, + } - _allKeysUp: function () { + _allKeysUp() { Log.Debug(">> Keyboard.allKeysUp"); - for (var code in this._keyDownList) { + for (let code in this._keyDownList) { this._sendKeyEvent(this._keyDownList[code], code, false); - }; + } this._keyDownList = {}; Log.Debug("<< Keyboard.allKeysUp"); - }, + } // ===== PUBLIC METHODS ===== - grab: function () { + grab() { //Log.Debug(">> Keyboard.grab"); - var c = this._target; + const c = this._target; c.addEventListener('keydown', this._eventHandlers.keydown); c.addEventListener('keyup', this._eventHandlers.keyup); @@ -316,11 +296,11 @@ Keyboard.prototype = { window.addEventListener('blur', this._eventHandlers.blur); //Log.Debug("<< Keyboard.grab"); - }, + } - ungrab: function () { + ungrab () { //Log.Debug(">> Keyboard.ungrab"); - var c = this._target; + const c = this._target; c.removeEventListener('keydown', this._eventHandlers.keydown); c.removeEventListener('keyup', this._eventHandlers.keyup); @@ -331,5 +311,5 @@ Keyboard.prototype = { this._allKeysUp(); //Log.Debug(">> Keyboard.ungrab"); - }, -}; + } +} diff --git a/core/input/keysymdef.js b/core/input/keysymdef.js index 95922b30..951cacab 100644 --- a/core/input/keysymdef.js +++ b/core/input/keysymdef.js @@ -7,7 +7,7 @@ /* Functions at the bottom */ -var codepoints = { +const codepoints = { 0x0100: 0x03c0, // XK_Amacron 0x0101: 0x03e0, // XK_amacron 0x0102: 0x01c3, // XK_Abreve @@ -670,14 +670,14 @@ var codepoints = { }; export default { - lookup : function(u) { + lookup(u) { // Latin-1 is one-to-one mapping if ((u >= 0x20) && (u <= 0xff)) { return u; } // Lookup table (fairly random) - var keysym = codepoints[u]; + const keysym = codepoints[u]; if (keysym !== undefined) { return keysym; } diff --git a/core/input/mouse.js b/core/input/mouse.js index eaf908ad..c9757b04 100644 --- a/core/input/mouse.js +++ b/core/input/mouse.js @@ -5,59 +5,57 @@ * Licensed under MPL 2.0 or any later version (see LICENSE.txt) */ -/*jslint browser: true, white: false */ -/*global window, Util */ - import * as Log from '../util/logging.js'; import { isTouchDevice } from '../util/browsers.js'; import { setCapture, stopEvent, getPointerEvent } from '../util/events.js'; -var WHEEL_STEP = 10; // Delta threshold for a mouse wheel step -var WHEEL_STEP_TIMEOUT = 50; // ms -var WHEEL_LINE_HEIGHT = 19; +const WHEEL_STEP = 10; // Delta threshold for a mouse wheel step +const WHEEL_STEP_TIMEOUT = 50; // ms +const WHEEL_LINE_HEIGHT = 19; -export default function Mouse(target) { - this._target = target || document; +export default class Mouse { + constructor(target) { + this._target = target || document; - this._doubleClickTimer = null; - this._lastTouchPos = null; + this._doubleClickTimer = null; + this._lastTouchPos = null; - this._pos = null; - this._wheelStepXTimer = null; - this._wheelStepYTimer = null; - this._accumulatedWheelDeltaX = 0; - this._accumulatedWheelDeltaY = 0; + this._pos = null; + this._wheelStepXTimer = null; + this._wheelStepYTimer = null; + this._accumulatedWheelDeltaX = 0; + this._accumulatedWheelDeltaY = 0; - this._eventHandlers = { - 'mousedown': this._handleMouseDown.bind(this), - 'mouseup': this._handleMouseUp.bind(this), - 'mousemove': this._handleMouseMove.bind(this), - 'mousewheel': this._handleMouseWheel.bind(this), - 'mousedisable': this._handleMouseDisable.bind(this) - }; -}; + this._eventHandlers = { + 'mousedown': this._handleMouseDown.bind(this), + 'mouseup': this._handleMouseUp.bind(this), + 'mousemove': this._handleMouseMove.bind(this), + 'mousewheel': this._handleMouseWheel.bind(this), + 'mousedisable': this._handleMouseDisable.bind(this) + }; -Mouse.prototype = { // ===== PROPERTIES ===== - touchButton: 1, // Button mask (1, 2, 4) for touch devices (0 means ignore clicks) + this.touchButton = 1; // Button mask (1, 2, 4) for touch devices (0 means ignore clicks) + + } // ===== EVENT HANDLERS ===== - onmousebutton: function () {}, // Handler for mouse button click/release - onmousemove: function () {}, // Handler for mouse movement + onmousebutton() {} // Handler for mouse button click/release + onmousemove() {} // Handler for mouse movement // ===== PRIVATE METHODS ===== - _resetDoubleClickTimer: function () { + _resetDoubleClickTimer() { this._doubleClickTimer = null; - }, + } - _handleMouseButton: function (e, down) { + _handleMouseButton(e, down) { this._updateMousePosition(e); - var pos = this._pos; + let pos = this._pos; - var bmask; + let bmask; if (e.touches || e.changedTouches) { // Touch device @@ -73,13 +71,13 @@ Mouse.prototype = { // force the position of the latter touch to the position of // the first. - var xs = this._lastTouchPos.x - pos.x; - var ys = this._lastTouchPos.y - pos.y; - var d = Math.sqrt((xs * xs) + (ys * ys)); + const xs = this._lastTouchPos.x - pos.x; + const ys = this._lastTouchPos.y - pos.y; + const d = Math.sqrt((xs * xs) + (ys * ys)); // The goal is to trigger on a certain physical width, the // devicePixelRatio brings us a bit closer but is not optimal. - var threshold = 20 * (window.devicePixelRatio || 1); + const threshold = 20 * (window.devicePixelRatio || 1); if (d < threshold) { pos = this._lastTouchPos; } @@ -103,25 +101,25 @@ Mouse.prototype = { this.onmousebutton(pos.x, pos.y, down, bmask); stopEvent(e); - }, + } - _handleMouseDown: function (e) { + _handleMouseDown(e) { // Touch events have implicit capture if (e.type === "mousedown") { setCapture(this._target); } this._handleMouseButton(e, 1); - }, + } - _handleMouseUp: function (e) { + _handleMouseUp(e) { this._handleMouseButton(e, 0); - }, + } // Mouse wheel events are sent in steps over VNC. This means that the VNC // protocol can't handle a wheel event with specific distance or speed. // Therefor, if we get a lot of small mouse wheel events we combine them. - _generateWheelStepX: function () { + _generateWheelStepX() { if (this._accumulatedWheelDeltaX < 0) { this.onmousebutton(this._pos.x, this._pos.y, 1, 1 << 5); @@ -132,9 +130,9 @@ Mouse.prototype = { } this._accumulatedWheelDeltaX = 0; - }, + } - _generateWheelStepY: function () { + _generateWheelStepY() { if (this._accumulatedWheelDeltaY < 0) { this.onmousebutton(this._pos.x, this._pos.y, 1, 1 << 3); @@ -145,22 +143,22 @@ Mouse.prototype = { } this._accumulatedWheelDeltaY = 0; - }, + } - _resetWheelStepTimers: function () { + _resetWheelStepTimers() { window.clearTimeout(this._wheelStepXTimer); window.clearTimeout(this._wheelStepYTimer); this._wheelStepXTimer = null; this._wheelStepYTimer = null; - }, + } - _handleMouseWheel: function (e) { + _handleMouseWheel(e) { this._resetWheelStepTimers(); this._updateMousePosition(e); - var dX = e.deltaX; - var dY = e.deltaY; + let dX = e.deltaX; + let dY = e.deltaY; // Pixel units unless it's non-zero. // Note that if deltamode is line or page won't matter since we aren't @@ -186,6 +184,7 @@ Mouse.prototype = { window.setTimeout(this._generateWheelStepX.bind(this), WHEEL_STEP_TIMEOUT); } + if (Math.abs(this._accumulatedWheelDeltaY) > WHEEL_STEP) { this._generateWheelStepY(); } else { @@ -195,15 +194,15 @@ Mouse.prototype = { } stopEvent(e); - }, + } - _handleMouseMove: function (e) { + _handleMouseMove(e) { this._updateMousePosition(e); this.onmousemove(this._pos.x, this._pos.y); stopEvent(e); - }, + } - _handleMouseDisable: function (e) { + _handleMouseDisable(e) { /* * Stop propagation if inside canvas area * Note: This is only needed for the 'click' event as it fails @@ -213,13 +212,13 @@ Mouse.prototype = { if (e.target == this._target) { stopEvent(e); } - }, + } // Update coordinates relative to target - _updateMousePosition: function(e) { + _updateMousePosition(e) { e = getPointerEvent(e); - var bounds = this._target.getBoundingClientRect(); - var x, y; + const bounds = this._target.getBoundingClientRect(); + let x, y; // Clip to target bounds if (e.clientX < bounds.left) { x = 0; @@ -235,19 +234,20 @@ Mouse.prototype = { } else { y = e.clientY - bounds.top; } - this._pos = {x:x, y:y}; - }, + this._pos = { x, y }; + } // ===== PUBLIC METHODS ===== - grab: function () { - var c = this._target; + grab() { + const c = this._target; if (isTouchDevice) { c.addEventListener('touchstart', this._eventHandlers.mousedown); c.addEventListener('touchend', this._eventHandlers.mouseup); c.addEventListener('touchmove', this._eventHandlers.mousemove); } + c.addEventListener('mousedown', this._eventHandlers.mousedown); c.addEventListener('mouseup', this._eventHandlers.mouseup); c.addEventListener('mousemove', this._eventHandlers.mousemove); @@ -259,10 +259,10 @@ Mouse.prototype = { /* preventDefault() on mousedown doesn't stop this event for some reason so we have to explicitly block it */ c.addEventListener('contextmenu', this._eventHandlers.mousedisable); - }, + } - ungrab: function () { - var c = this._target; + ungrab() { + const c = this._target; this._resetWheelStepTimers(); @@ -271,6 +271,7 @@ Mouse.prototype = { c.removeEventListener('touchend', this._eventHandlers.mouseup); c.removeEventListener('touchmove', this._eventHandlers.mousemove); } + c.removeEventListener('mousedown', this._eventHandlers.mousedown); c.removeEventListener('mouseup', this._eventHandlers.mouseup); c.removeEventListener('mousemove', this._eventHandlers.mousemove); @@ -280,4 +281,4 @@ Mouse.prototype = { c.removeEventListener('contextmenu', this._eventHandlers.mousedisable); } -}; +} diff --git a/core/input/util.js b/core/input/util.js index 78a829c8..caeeff12 100644 --- a/core/input/util.js +++ b/core/input/util.js @@ -1,18 +1,8 @@ -import KeyTable from "./keysym.js"; import keysyms from "./keysymdef.js"; import vkeys from "./vkeys.js"; import fixedkeys from "./fixedkeys.js"; import DOMKeyTable from "./domkeytable.js"; - -function isMac() { - return navigator && !!(/mac/i).exec(navigator.platform); -} -function isIE() { - return navigator && !!(/trident/i).exec(navigator.userAgent); -} -function isEdge() { - return navigator && !!(/edge/i).exec(navigator.userAgent); -} +import * as browserUtils from "../util/browsers.js"; // Get 'KeyboardEvent.code', handling legacy browsers export function getKeycode(evt){ @@ -34,10 +24,10 @@ export function getKeycode(evt){ // in the 'keyCode' field for non-printable characters. However // Webkit sets it to the same as charCode in 'keypress' events. if ((evt.type !== 'keypress') && (evt.keyCode in vkeys)) { - var code = vkeys[evt.keyCode]; + let code = vkeys[evt.keyCode]; // macOS has messed up this code for some reason - if (isMac() && (code === 'ContextMenu')) { + if (browserUtils.isMac() && (code === 'ContextMenu')) { code = 'MetaRight'; } @@ -114,13 +104,14 @@ export function getKey(evt) { // IE and Edge have broken handling of AltGraph so we cannot // trust them for printable characters - if ((evt.key.length !== 1) || (!isIE() && !isEdge())) { + if ((evt.key.length !== 1) + || (!browserUtils.isIE() && !browserUtils.isEdge())) { return evt.key; } } // Try to deduce it based on the physical key - var code = getKeycode(evt); + let code = getKeycode(evt); if (code in fixedkeys) { return fixedkeys[code]; } @@ -136,7 +127,7 @@ export function getKey(evt) { // Get the most reliable keysym value we can get from a key event export function getKeysym(evt){ - var key = getKey(evt); + const key = getKey(evt); if (key === 'Unidentified') { return null; @@ -144,7 +135,7 @@ export function getKeysym(evt){ // First look up special keys if (key in DOMKeyTable) { - var location = evt.location; + let location = evt.location; // Safari screws up location for the right cmd key if ((key === 'Meta') && (location === 0)) { @@ -159,15 +150,12 @@ export function getKeysym(evt){ } // Now we need to look at the Unicode symbol instead - - var codepoint; - // Special key? (FIXME: Should have been caught earlier) if (key.length !== 1) { return null; } - codepoint = key.charCodeAt(); + const codepoint = key.charCodeAt(); if (codepoint) { return keysyms.lookup(codepoint); } diff --git a/core/input/xtscancodes.js b/core/input/xtscancodes.js index 514809c6..e4a716ad 100644 --- a/core/input/xtscancodes.js +++ b/core/input/xtscancodes.js @@ -5,167 +5,167 @@ * keymap-gen --lang=js code-map keymaps.csv html atset1 */ export default { - "Again": 0xe005, /* html:Again (Again) -> linux:129 (KEY_AGAIN) -> atset1:57349 */ - "AltLeft": 0x38, /* html:AltLeft (AltLeft) -> linux:56 (KEY_LEFTALT) -> atset1:56 */ - "AltRight": 0xe038, /* html:AltRight (AltRight) -> linux:100 (KEY_RIGHTALT) -> atset1:57400 */ - "ArrowDown": 0xe050, /* html:ArrowDown (ArrowDown) -> linux:108 (KEY_DOWN) -> atset1:57424 */ - "ArrowLeft": 0xe04b, /* html:ArrowLeft (ArrowLeft) -> linux:105 (KEY_LEFT) -> atset1:57419 */ - "ArrowRight": 0xe04d, /* html:ArrowRight (ArrowRight) -> linux:106 (KEY_RIGHT) -> atset1:57421 */ - "ArrowUp": 0xe048, /* html:ArrowUp (ArrowUp) -> linux:103 (KEY_UP) -> atset1:57416 */ - "AudioVolumeDown": 0xe02e, /* html:AudioVolumeDown (AudioVolumeDown) -> linux:114 (KEY_VOLUMEDOWN) -> atset1:57390 */ - "AudioVolumeMute": 0xe020, /* html:AudioVolumeMute (AudioVolumeMute) -> linux:113 (KEY_MUTE) -> atset1:57376 */ - "AudioVolumeUp": 0xe030, /* html:AudioVolumeUp (AudioVolumeUp) -> linux:115 (KEY_VOLUMEUP) -> atset1:57392 */ - "Backquote": 0x29, /* html:Backquote (Backquote) -> linux:41 (KEY_GRAVE) -> atset1:41 */ - "Backslash": 0x2b, /* html:Backslash (Backslash) -> linux:43 (KEY_BACKSLASH) -> atset1:43 */ - "Backspace": 0xe, /* html:Backspace (Backspace) -> linux:14 (KEY_BACKSPACE) -> atset1:14 */ - "BracketLeft": 0x1a, /* html:BracketLeft (BracketLeft) -> linux:26 (KEY_LEFTBRACE) -> atset1:26 */ - "BracketRight": 0x1b, /* html:BracketRight (BracketRight) -> linux:27 (KEY_RIGHTBRACE) -> atset1:27 */ - "BrowserBack": 0xe06a, /* html:BrowserBack (BrowserBack) -> linux:158 (KEY_BACK) -> atset1:57450 */ - "BrowserFavorites": 0xe066, /* html:BrowserFavorites (BrowserFavorites) -> linux:156 (KEY_BOOKMARKS) -> atset1:57446 */ - "BrowserForward": 0xe069, /* html:BrowserForward (BrowserForward) -> linux:159 (KEY_FORWARD) -> atset1:57449 */ - "BrowserHome": 0xe032, /* html:BrowserHome (BrowserHome) -> linux:172 (KEY_HOMEPAGE) -> atset1:57394 */ - "BrowserRefresh": 0xe067, /* html:BrowserRefresh (BrowserRefresh) -> linux:173 (KEY_REFRESH) -> atset1:57447 */ - "BrowserSearch": 0xe065, /* html:BrowserSearch (BrowserSearch) -> linux:217 (KEY_SEARCH) -> atset1:57445 */ - "BrowserStop": 0xe068, /* html:BrowserStop (BrowserStop) -> linux:128 (KEY_STOP) -> atset1:57448 */ - "CapsLock": 0x3a, /* html:CapsLock (CapsLock) -> linux:58 (KEY_CAPSLOCK) -> atset1:58 */ - "Comma": 0x33, /* html:Comma (Comma) -> linux:51 (KEY_COMMA) -> atset1:51 */ - "ContextMenu": 0xe05d, /* html:ContextMenu (ContextMenu) -> linux:127 (KEY_COMPOSE) -> atset1:57437 */ - "ControlLeft": 0x1d, /* html:ControlLeft (ControlLeft) -> linux:29 (KEY_LEFTCTRL) -> atset1:29 */ - "ControlRight": 0xe01d, /* html:ControlRight (ControlRight) -> linux:97 (KEY_RIGHTCTRL) -> atset1:57373 */ - "Convert": 0x79, /* html:Convert (Convert) -> linux:92 (KEY_HENKAN) -> atset1:121 */ - "Copy": 0xe078, /* html:Copy (Copy) -> linux:133 (KEY_COPY) -> atset1:57464 */ - "Cut": 0xe03c, /* html:Cut (Cut) -> linux:137 (KEY_CUT) -> atset1:57404 */ - "Delete": 0xe053, /* html:Delete (Delete) -> linux:111 (KEY_DELETE) -> atset1:57427 */ - "Digit0": 0xb, /* html:Digit0 (Digit0) -> linux:11 (KEY_0) -> atset1:11 */ - "Digit1": 0x2, /* html:Digit1 (Digit1) -> linux:2 (KEY_1) -> atset1:2 */ - "Digit2": 0x3, /* html:Digit2 (Digit2) -> linux:3 (KEY_2) -> atset1:3 */ - "Digit3": 0x4, /* html:Digit3 (Digit3) -> linux:4 (KEY_3) -> atset1:4 */ - "Digit4": 0x5, /* html:Digit4 (Digit4) -> linux:5 (KEY_4) -> atset1:5 */ - "Digit5": 0x6, /* html:Digit5 (Digit5) -> linux:6 (KEY_5) -> atset1:6 */ - "Digit6": 0x7, /* html:Digit6 (Digit6) -> linux:7 (KEY_6) -> atset1:7 */ - "Digit7": 0x8, /* html:Digit7 (Digit7) -> linux:8 (KEY_7) -> atset1:8 */ - "Digit8": 0x9, /* html:Digit8 (Digit8) -> linux:9 (KEY_8) -> atset1:9 */ - "Digit9": 0xa, /* html:Digit9 (Digit9) -> linux:10 (KEY_9) -> atset1:10 */ - "Eject": 0xe07d, /* html:Eject (Eject) -> linux:162 (KEY_EJECTCLOSECD) -> atset1:57469 */ - "End": 0xe04f, /* html:End (End) -> linux:107 (KEY_END) -> atset1:57423 */ - "Enter": 0x1c, /* html:Enter (Enter) -> linux:28 (KEY_ENTER) -> atset1:28 */ - "Equal": 0xd, /* html:Equal (Equal) -> linux:13 (KEY_EQUAL) -> atset1:13 */ - "Escape": 0x1, /* html:Escape (Escape) -> linux:1 (KEY_ESC) -> atset1:1 */ - "F1": 0x3b, /* html:F1 (F1) -> linux:59 (KEY_F1) -> atset1:59 */ - "F10": 0x44, /* html:F10 (F10) -> linux:68 (KEY_F10) -> atset1:68 */ - "F11": 0x57, /* html:F11 (F11) -> linux:87 (KEY_F11) -> atset1:87 */ - "F12": 0x58, /* html:F12 (F12) -> linux:88 (KEY_F12) -> atset1:88 */ - "F13": 0x5d, /* html:F13 (F13) -> linux:183 (KEY_F13) -> atset1:93 */ - "F14": 0x5e, /* html:F14 (F14) -> linux:184 (KEY_F14) -> atset1:94 */ - "F15": 0x5f, /* html:F15 (F15) -> linux:185 (KEY_F15) -> atset1:95 */ - "F16": 0x55, /* html:F16 (F16) -> linux:186 (KEY_F16) -> atset1:85 */ - "F17": 0xe003, /* html:F17 (F17) -> linux:187 (KEY_F17) -> atset1:57347 */ - "F18": 0xe077, /* html:F18 (F18) -> linux:188 (KEY_F18) -> atset1:57463 */ - "F19": 0xe004, /* html:F19 (F19) -> linux:189 (KEY_F19) -> atset1:57348 */ - "F2": 0x3c, /* html:F2 (F2) -> linux:60 (KEY_F2) -> atset1:60 */ - "F20": 0x5a, /* html:F20 (F20) -> linux:190 (KEY_F20) -> atset1:90 */ - "F21": 0x74, /* html:F21 (F21) -> linux:191 (KEY_F21) -> atset1:116 */ - "F22": 0xe079, /* html:F22 (F22) -> linux:192 (KEY_F22) -> atset1:57465 */ - "F23": 0x6d, /* html:F23 (F23) -> linux:193 (KEY_F23) -> atset1:109 */ - "F24": 0x6f, /* html:F24 (F24) -> linux:194 (KEY_F24) -> atset1:111 */ - "F3": 0x3d, /* html:F3 (F3) -> linux:61 (KEY_F3) -> atset1:61 */ - "F4": 0x3e, /* html:F4 (F4) -> linux:62 (KEY_F4) -> atset1:62 */ - "F5": 0x3f, /* html:F5 (F5) -> linux:63 (KEY_F5) -> atset1:63 */ - "F6": 0x40, /* html:F6 (F6) -> linux:64 (KEY_F6) -> atset1:64 */ - "F7": 0x41, /* html:F7 (F7) -> linux:65 (KEY_F7) -> atset1:65 */ - "F8": 0x42, /* html:F8 (F8) -> linux:66 (KEY_F8) -> atset1:66 */ - "F9": 0x43, /* html:F9 (F9) -> linux:67 (KEY_F9) -> atset1:67 */ - "Find": 0xe041, /* html:Find (Find) -> linux:136 (KEY_FIND) -> atset1:57409 */ - "Help": 0xe075, /* html:Help (Help) -> linux:138 (KEY_HELP) -> atset1:57461 */ - "Hiragana": 0x77, /* html:Hiragana (Lang4) -> linux:91 (KEY_HIRAGANA) -> atset1:119 */ - "Home": 0xe047, /* html:Home (Home) -> linux:102 (KEY_HOME) -> atset1:57415 */ - "Insert": 0xe052, /* html:Insert (Insert) -> linux:110 (KEY_INSERT) -> atset1:57426 */ - "IntlBackslash": 0x56, /* html:IntlBackslash (IntlBackslash) -> linux:86 (KEY_102ND) -> atset1:86 */ - "IntlRo": 0x73, /* html:IntlRo (IntlRo) -> linux:89 (KEY_RO) -> atset1:115 */ - "IntlYen": 0x7d, /* html:IntlYen (IntlYen) -> linux:124 (KEY_YEN) -> atset1:125 */ - "KanaMode": 0x70, /* html:KanaMode (KanaMode) -> linux:93 (KEY_KATAKANAHIRAGANA) -> atset1:112 */ - "Katakana": 0x78, /* html:Katakana (Lang3) -> linux:90 (KEY_KATAKANA) -> atset1:120 */ - "KeyA": 0x1e, /* html:KeyA (KeyA) -> linux:30 (KEY_A) -> atset1:30 */ - "KeyB": 0x30, /* html:KeyB (KeyB) -> linux:48 (KEY_B) -> atset1:48 */ - "KeyC": 0x2e, /* html:KeyC (KeyC) -> linux:46 (KEY_C) -> atset1:46 */ - "KeyD": 0x20, /* html:KeyD (KeyD) -> linux:32 (KEY_D) -> atset1:32 */ - "KeyE": 0x12, /* html:KeyE (KeyE) -> linux:18 (KEY_E) -> atset1:18 */ - "KeyF": 0x21, /* html:KeyF (KeyF) -> linux:33 (KEY_F) -> atset1:33 */ - "KeyG": 0x22, /* html:KeyG (KeyG) -> linux:34 (KEY_G) -> atset1:34 */ - "KeyH": 0x23, /* html:KeyH (KeyH) -> linux:35 (KEY_H) -> atset1:35 */ - "KeyI": 0x17, /* html:KeyI (KeyI) -> linux:23 (KEY_I) -> atset1:23 */ - "KeyJ": 0x24, /* html:KeyJ (KeyJ) -> linux:36 (KEY_J) -> atset1:36 */ - "KeyK": 0x25, /* html:KeyK (KeyK) -> linux:37 (KEY_K) -> atset1:37 */ - "KeyL": 0x26, /* html:KeyL (KeyL) -> linux:38 (KEY_L) -> atset1:38 */ - "KeyM": 0x32, /* html:KeyM (KeyM) -> linux:50 (KEY_M) -> atset1:50 */ - "KeyN": 0x31, /* html:KeyN (KeyN) -> linux:49 (KEY_N) -> atset1:49 */ - "KeyO": 0x18, /* html:KeyO (KeyO) -> linux:24 (KEY_O) -> atset1:24 */ - "KeyP": 0x19, /* html:KeyP (KeyP) -> linux:25 (KEY_P) -> atset1:25 */ - "KeyQ": 0x10, /* html:KeyQ (KeyQ) -> linux:16 (KEY_Q) -> atset1:16 */ - "KeyR": 0x13, /* html:KeyR (KeyR) -> linux:19 (KEY_R) -> atset1:19 */ - "KeyS": 0x1f, /* html:KeyS (KeyS) -> linux:31 (KEY_S) -> atset1:31 */ - "KeyT": 0x14, /* html:KeyT (KeyT) -> linux:20 (KEY_T) -> atset1:20 */ - "KeyU": 0x16, /* html:KeyU (KeyU) -> linux:22 (KEY_U) -> atset1:22 */ - "KeyV": 0x2f, /* html:KeyV (KeyV) -> linux:47 (KEY_V) -> atset1:47 */ - "KeyW": 0x11, /* html:KeyW (KeyW) -> linux:17 (KEY_W) -> atset1:17 */ - "KeyX": 0x2d, /* html:KeyX (KeyX) -> linux:45 (KEY_X) -> atset1:45 */ - "KeyY": 0x15, /* html:KeyY (KeyY) -> linux:21 (KEY_Y) -> atset1:21 */ - "KeyZ": 0x2c, /* html:KeyZ (KeyZ) -> linux:44 (KEY_Z) -> atset1:44 */ - "Lang3": 0x78, /* html:Lang3 (Lang3) -> linux:90 (KEY_KATAKANA) -> atset1:120 */ - "Lang4": 0x77, /* html:Lang4 (Lang4) -> linux:91 (KEY_HIRAGANA) -> atset1:119 */ - "Lang5": 0x76, /* html:Lang5 (Lang5) -> linux:85 (KEY_ZENKAKUHANKAKU) -> atset1:118 */ - "LaunchApp1": 0xe06b, /* html:LaunchApp1 (LaunchApp1) -> linux:157 (KEY_COMPUTER) -> atset1:57451 */ - "LaunchApp2": 0xe021, /* html:LaunchApp2 (LaunchApp2) -> linux:140 (KEY_CALC) -> atset1:57377 */ - "LaunchMail": 0xe06c, /* html:LaunchMail (LaunchMail) -> linux:155 (KEY_MAIL) -> atset1:57452 */ - "MediaPlayPause": 0xe022, /* html:MediaPlayPause (MediaPlayPause) -> linux:164 (KEY_PLAYPAUSE) -> atset1:57378 */ - "MediaSelect": 0xe06d, /* html:MediaSelect (MediaSelect) -> linux:226 (KEY_MEDIA) -> atset1:57453 */ - "MediaStop": 0xe024, /* html:MediaStop (MediaStop) -> linux:166 (KEY_STOPCD) -> atset1:57380 */ - "MediaTrackNext": 0xe019, /* html:MediaTrackNext (MediaTrackNext) -> linux:163 (KEY_NEXTSONG) -> atset1:57369 */ - "MediaTrackPrevious": 0xe010, /* html:MediaTrackPrevious (MediaTrackPrevious) -> linux:165 (KEY_PREVIOUSSONG) -> atset1:57360 */ - "MetaLeft": 0xe05b, /* html:MetaLeft (MetaLeft) -> linux:125 (KEY_LEFTMETA) -> atset1:57435 */ - "MetaRight": 0xe05c, /* html:MetaRight (MetaRight) -> linux:126 (KEY_RIGHTMETA) -> atset1:57436 */ - "Minus": 0xc, /* html:Minus (Minus) -> linux:12 (KEY_MINUS) -> atset1:12 */ - "NonConvert": 0x7b, /* html:NonConvert (NonConvert) -> linux:94 (KEY_MUHENKAN) -> atset1:123 */ - "NumLock": 0x45, /* html:NumLock (NumLock) -> linux:69 (KEY_NUMLOCK) -> atset1:69 */ - "Numpad0": 0x52, /* html:Numpad0 (Numpad0) -> linux:82 (KEY_KP0) -> atset1:82 */ - "Numpad1": 0x4f, /* html:Numpad1 (Numpad1) -> linux:79 (KEY_KP1) -> atset1:79 */ - "Numpad2": 0x50, /* html:Numpad2 (Numpad2) -> linux:80 (KEY_KP2) -> atset1:80 */ - "Numpad3": 0x51, /* html:Numpad3 (Numpad3) -> linux:81 (KEY_KP3) -> atset1:81 */ - "Numpad4": 0x4b, /* html:Numpad4 (Numpad4) -> linux:75 (KEY_KP4) -> atset1:75 */ - "Numpad5": 0x4c, /* html:Numpad5 (Numpad5) -> linux:76 (KEY_KP5) -> atset1:76 */ - "Numpad6": 0x4d, /* html:Numpad6 (Numpad6) -> linux:77 (KEY_KP6) -> atset1:77 */ - "Numpad7": 0x47, /* html:Numpad7 (Numpad7) -> linux:71 (KEY_KP7) -> atset1:71 */ - "Numpad8": 0x48, /* html:Numpad8 (Numpad8) -> linux:72 (KEY_KP8) -> atset1:72 */ - "Numpad9": 0x49, /* html:Numpad9 (Numpad9) -> linux:73 (KEY_KP9) -> atset1:73 */ - "NumpadAdd": 0x4e, /* html:NumpadAdd (NumpadAdd) -> linux:78 (KEY_KPPLUS) -> atset1:78 */ - "NumpadComma": 0x7e, /* html:NumpadComma (NumpadComma) -> linux:121 (KEY_KPCOMMA) -> atset1:126 */ - "NumpadDecimal": 0x53, /* html:NumpadDecimal (NumpadDecimal) -> linux:83 (KEY_KPDOT) -> atset1:83 */ - "NumpadDivide": 0xe035, /* html:NumpadDivide (NumpadDivide) -> linux:98 (KEY_KPSLASH) -> atset1:57397 */ - "NumpadEnter": 0xe01c, /* html:NumpadEnter (NumpadEnter) -> linux:96 (KEY_KPENTER) -> atset1:57372 */ - "NumpadEqual": 0x59, /* html:NumpadEqual (NumpadEqual) -> linux:117 (KEY_KPEQUAL) -> atset1:89 */ - "NumpadMultiply": 0x37, /* html:NumpadMultiply (NumpadMultiply) -> linux:55 (KEY_KPASTERISK) -> atset1:55 */ - "NumpadParenLeft": 0xe076, /* html:NumpadParenLeft (NumpadParenLeft) -> linux:179 (KEY_KPLEFTPAREN) -> atset1:57462 */ - "NumpadParenRight": 0xe07b, /* html:NumpadParenRight (NumpadParenRight) -> linux:180 (KEY_KPRIGHTPAREN) -> atset1:57467 */ - "NumpadSubtract": 0x4a, /* html:NumpadSubtract (NumpadSubtract) -> linux:74 (KEY_KPMINUS) -> atset1:74 */ - "Open": 0x64, /* html:Open (Open) -> linux:134 (KEY_OPEN) -> atset1:100 */ - "PageDown": 0xe051, /* html:PageDown (PageDown) -> linux:109 (KEY_PAGEDOWN) -> atset1:57425 */ - "PageUp": 0xe049, /* html:PageUp (PageUp) -> linux:104 (KEY_PAGEUP) -> atset1:57417 */ - "Paste": 0x65, /* html:Paste (Paste) -> linux:135 (KEY_PASTE) -> atset1:101 */ - "Pause": 0xe046, /* html:Pause (Pause) -> linux:119 (KEY_PAUSE) -> atset1:57414 */ - "Period": 0x34, /* html:Period (Period) -> linux:52 (KEY_DOT) -> atset1:52 */ - "Power": 0xe05e, /* html:Power (Power) -> linux:116 (KEY_POWER) -> atset1:57438 */ - "PrintScreen": 0x54, /* html:PrintScreen (PrintScreen) -> linux:99 (KEY_SYSRQ) -> atset1:84 */ - "Props": 0xe006, /* html:Props (Props) -> linux:130 (KEY_PROPS) -> atset1:57350 */ - "Quote": 0x28, /* html:Quote (Quote) -> linux:40 (KEY_APOSTROPHE) -> atset1:40 */ - "ScrollLock": 0x46, /* html:ScrollLock (ScrollLock) -> linux:70 (KEY_SCROLLLOCK) -> atset1:70 */ - "Semicolon": 0x27, /* html:Semicolon (Semicolon) -> linux:39 (KEY_SEMICOLON) -> atset1:39 */ - "ShiftLeft": 0x2a, /* html:ShiftLeft (ShiftLeft) -> linux:42 (KEY_LEFTSHIFT) -> atset1:42 */ - "ShiftRight": 0x36, /* html:ShiftRight (ShiftRight) -> linux:54 (KEY_RIGHTSHIFT) -> atset1:54 */ - "Slash": 0x35, /* html:Slash (Slash) -> linux:53 (KEY_SLASH) -> atset1:53 */ - "Sleep": 0xe05f, /* html:Sleep (Sleep) -> linux:142 (KEY_SLEEP) -> atset1:57439 */ - "Space": 0x39, /* html:Space (Space) -> linux:57 (KEY_SPACE) -> atset1:57 */ - "Suspend": 0xe025, /* html:Suspend (Suspend) -> linux:205 (KEY_SUSPEND) -> atset1:57381 */ - "Tab": 0xf, /* html:Tab (Tab) -> linux:15 (KEY_TAB) -> atset1:15 */ - "Undo": 0xe007, /* html:Undo (Undo) -> linux:131 (KEY_UNDO) -> atset1:57351 */ - "WakeUp": 0xe063, /* html:WakeUp (WakeUp) -> linux:143 (KEY_WAKEUP) -> atset1:57443 */ + "Again": 0xe005, /* html:Again (Again) -> linux:129 (KEY_AGAIN) -> atset1:57349 */ + "AltLeft": 0x38, /* html:AltLeft (AltLeft) -> linux:56 (KEY_LEFTALT) -> atset1:56 */ + "AltRight": 0xe038, /* html:AltRight (AltRight) -> linux:100 (KEY_RIGHTALT) -> atset1:57400 */ + "ArrowDown": 0xe050, /* html:ArrowDown (ArrowDown) -> linux:108 (KEY_DOWN) -> atset1:57424 */ + "ArrowLeft": 0xe04b, /* html:ArrowLeft (ArrowLeft) -> linux:105 (KEY_LEFT) -> atset1:57419 */ + "ArrowRight": 0xe04d, /* html:ArrowRight (ArrowRight) -> linux:106 (KEY_RIGHT) -> atset1:57421 */ + "ArrowUp": 0xe048, /* html:ArrowUp (ArrowUp) -> linux:103 (KEY_UP) -> atset1:57416 */ + "AudioVolumeDown": 0xe02e, /* html:AudioVolumeDown (AudioVolumeDown) -> linux:114 (KEY_VOLUMEDOWN) -> atset1:57390 */ + "AudioVolumeMute": 0xe020, /* html:AudioVolumeMute (AudioVolumeMute) -> linux:113 (KEY_MUTE) -> atset1:57376 */ + "AudioVolumeUp": 0xe030, /* html:AudioVolumeUp (AudioVolumeUp) -> linux:115 (KEY_VOLUMEUP) -> atset1:57392 */ + "Backquote": 0x29, /* html:Backquote (Backquote) -> linux:41 (KEY_GRAVE) -> atset1:41 */ + "Backslash": 0x2b, /* html:Backslash (Backslash) -> linux:43 (KEY_BACKSLASH) -> atset1:43 */ + "Backspace": 0xe, /* html:Backspace (Backspace) -> linux:14 (KEY_BACKSPACE) -> atset1:14 */ + "BracketLeft": 0x1a, /* html:BracketLeft (BracketLeft) -> linux:26 (KEY_LEFTBRACE) -> atset1:26 */ + "BracketRight": 0x1b, /* html:BracketRight (BracketRight) -> linux:27 (KEY_RIGHTBRACE) -> atset1:27 */ + "BrowserBack": 0xe06a, /* html:BrowserBack (BrowserBack) -> linux:158 (KEY_BACK) -> atset1:57450 */ + "BrowserFavorites": 0xe066, /* html:BrowserFavorites (BrowserFavorites) -> linux:156 (KEY_BOOKMARKS) -> atset1:57446 */ + "BrowserForward": 0xe069, /* html:BrowserForward (BrowserForward) -> linux:159 (KEY_FORWARD) -> atset1:57449 */ + "BrowserHome": 0xe032, /* html:BrowserHome (BrowserHome) -> linux:172 (KEY_HOMEPAGE) -> atset1:57394 */ + "BrowserRefresh": 0xe067, /* html:BrowserRefresh (BrowserRefresh) -> linux:173 (KEY_REFRESH) -> atset1:57447 */ + "BrowserSearch": 0xe065, /* html:BrowserSearch (BrowserSearch) -> linux:217 (KEY_SEARCH) -> atset1:57445 */ + "BrowserStop": 0xe068, /* html:BrowserStop (BrowserStop) -> linux:128 (KEY_STOP) -> atset1:57448 */ + "CapsLock": 0x3a, /* html:CapsLock (CapsLock) -> linux:58 (KEY_CAPSLOCK) -> atset1:58 */ + "Comma": 0x33, /* html:Comma (Comma) -> linux:51 (KEY_COMMA) -> atset1:51 */ + "ContextMenu": 0xe05d, /* html:ContextMenu (ContextMenu) -> linux:127 (KEY_COMPOSE) -> atset1:57437 */ + "ControlLeft": 0x1d, /* html:ControlLeft (ControlLeft) -> linux:29 (KEY_LEFTCTRL) -> atset1:29 */ + "ControlRight": 0xe01d, /* html:ControlRight (ControlRight) -> linux:97 (KEY_RIGHTCTRL) -> atset1:57373 */ + "Convert": 0x79, /* html:Convert (Convert) -> linux:92 (KEY_HENKAN) -> atset1:121 */ + "Copy": 0xe078, /* html:Copy (Copy) -> linux:133 (KEY_COPY) -> atset1:57464 */ + "Cut": 0xe03c, /* html:Cut (Cut) -> linux:137 (KEY_CUT) -> atset1:57404 */ + "Delete": 0xe053, /* html:Delete (Delete) -> linux:111 (KEY_DELETE) -> atset1:57427 */ + "Digit0": 0xb, /* html:Digit0 (Digit0) -> linux:11 (KEY_0) -> atset1:11 */ + "Digit1": 0x2, /* html:Digit1 (Digit1) -> linux:2 (KEY_1) -> atset1:2 */ + "Digit2": 0x3, /* html:Digit2 (Digit2) -> linux:3 (KEY_2) -> atset1:3 */ + "Digit3": 0x4, /* html:Digit3 (Digit3) -> linux:4 (KEY_3) -> atset1:4 */ + "Digit4": 0x5, /* html:Digit4 (Digit4) -> linux:5 (KEY_4) -> atset1:5 */ + "Digit5": 0x6, /* html:Digit5 (Digit5) -> linux:6 (KEY_5) -> atset1:6 */ + "Digit6": 0x7, /* html:Digit6 (Digit6) -> linux:7 (KEY_6) -> atset1:7 */ + "Digit7": 0x8, /* html:Digit7 (Digit7) -> linux:8 (KEY_7) -> atset1:8 */ + "Digit8": 0x9, /* html:Digit8 (Digit8) -> linux:9 (KEY_8) -> atset1:9 */ + "Digit9": 0xa, /* html:Digit9 (Digit9) -> linux:10 (KEY_9) -> atset1:10 */ + "Eject": 0xe07d, /* html:Eject (Eject) -> linux:162 (KEY_EJECTCLOSECD) -> atset1:57469 */ + "End": 0xe04f, /* html:End (End) -> linux:107 (KEY_END) -> atset1:57423 */ + "Enter": 0x1c, /* html:Enter (Enter) -> linux:28 (KEY_ENTER) -> atset1:28 */ + "Equal": 0xd, /* html:Equal (Equal) -> linux:13 (KEY_EQUAL) -> atset1:13 */ + "Escape": 0x1, /* html:Escape (Escape) -> linux:1 (KEY_ESC) -> atset1:1 */ + "F1": 0x3b, /* html:F1 (F1) -> linux:59 (KEY_F1) -> atset1:59 */ + "F10": 0x44, /* html:F10 (F10) -> linux:68 (KEY_F10) -> atset1:68 */ + "F11": 0x57, /* html:F11 (F11) -> linux:87 (KEY_F11) -> atset1:87 */ + "F12": 0x58, /* html:F12 (F12) -> linux:88 (KEY_F12) -> atset1:88 */ + "F13": 0x5d, /* html:F13 (F13) -> linux:183 (KEY_F13) -> atset1:93 */ + "F14": 0x5e, /* html:F14 (F14) -> linux:184 (KEY_F14) -> atset1:94 */ + "F15": 0x5f, /* html:F15 (F15) -> linux:185 (KEY_F15) -> atset1:95 */ + "F16": 0x55, /* html:F16 (F16) -> linux:186 (KEY_F16) -> atset1:85 */ + "F17": 0xe003, /* html:F17 (F17) -> linux:187 (KEY_F17) -> atset1:57347 */ + "F18": 0xe077, /* html:F18 (F18) -> linux:188 (KEY_F18) -> atset1:57463 */ + "F19": 0xe004, /* html:F19 (F19) -> linux:189 (KEY_F19) -> atset1:57348 */ + "F2": 0x3c, /* html:F2 (F2) -> linux:60 (KEY_F2) -> atset1:60 */ + "F20": 0x5a, /* html:F20 (F20) -> linux:190 (KEY_F20) -> atset1:90 */ + "F21": 0x74, /* html:F21 (F21) -> linux:191 (KEY_F21) -> atset1:116 */ + "F22": 0xe079, /* html:F22 (F22) -> linux:192 (KEY_F22) -> atset1:57465 */ + "F23": 0x6d, /* html:F23 (F23) -> linux:193 (KEY_F23) -> atset1:109 */ + "F24": 0x6f, /* html:F24 (F24) -> linux:194 (KEY_F24) -> atset1:111 */ + "F3": 0x3d, /* html:F3 (F3) -> linux:61 (KEY_F3) -> atset1:61 */ + "F4": 0x3e, /* html:F4 (F4) -> linux:62 (KEY_F4) -> atset1:62 */ + "F5": 0x3f, /* html:F5 (F5) -> linux:63 (KEY_F5) -> atset1:63 */ + "F6": 0x40, /* html:F6 (F6) -> linux:64 (KEY_F6) -> atset1:64 */ + "F7": 0x41, /* html:F7 (F7) -> linux:65 (KEY_F7) -> atset1:65 */ + "F8": 0x42, /* html:F8 (F8) -> linux:66 (KEY_F8) -> atset1:66 */ + "F9": 0x43, /* html:F9 (F9) -> linux:67 (KEY_F9) -> atset1:67 */ + "Find": 0xe041, /* html:Find (Find) -> linux:136 (KEY_FIND) -> atset1:57409 */ + "Help": 0xe075, /* html:Help (Help) -> linux:138 (KEY_HELP) -> atset1:57461 */ + "Hiragana": 0x77, /* html:Hiragana (Lang4) -> linux:91 (KEY_HIRAGANA) -> atset1:119 */ + "Home": 0xe047, /* html:Home (Home) -> linux:102 (KEY_HOME) -> atset1:57415 */ + "Insert": 0xe052, /* html:Insert (Insert) -> linux:110 (KEY_INSERT) -> atset1:57426 */ + "IntlBackslash": 0x56, /* html:IntlBackslash (IntlBackslash) -> linux:86 (KEY_102ND) -> atset1:86 */ + "IntlRo": 0x73, /* html:IntlRo (IntlRo) -> linux:89 (KEY_RO) -> atset1:115 */ + "IntlYen": 0x7d, /* html:IntlYen (IntlYen) -> linux:124 (KEY_YEN) -> atset1:125 */ + "KanaMode": 0x70, /* html:KanaMode (KanaMode) -> linux:93 (KEY_KATAKANAHIRAGANA) -> atset1:112 */ + "Katakana": 0x78, /* html:Katakana (Lang3) -> linux:90 (KEY_KATAKANA) -> atset1:120 */ + "KeyA": 0x1e, /* html:KeyA (KeyA) -> linux:30 (KEY_A) -> atset1:30 */ + "KeyB": 0x30, /* html:KeyB (KeyB) -> linux:48 (KEY_B) -> atset1:48 */ + "KeyC": 0x2e, /* html:KeyC (KeyC) -> linux:46 (KEY_C) -> atset1:46 */ + "KeyD": 0x20, /* html:KeyD (KeyD) -> linux:32 (KEY_D) -> atset1:32 */ + "KeyE": 0x12, /* html:KeyE (KeyE) -> linux:18 (KEY_E) -> atset1:18 */ + "KeyF": 0x21, /* html:KeyF (KeyF) -> linux:33 (KEY_F) -> atset1:33 */ + "KeyG": 0x22, /* html:KeyG (KeyG) -> linux:34 (KEY_G) -> atset1:34 */ + "KeyH": 0x23, /* html:KeyH (KeyH) -> linux:35 (KEY_H) -> atset1:35 */ + "KeyI": 0x17, /* html:KeyI (KeyI) -> linux:23 (KEY_I) -> atset1:23 */ + "KeyJ": 0x24, /* html:KeyJ (KeyJ) -> linux:36 (KEY_J) -> atset1:36 */ + "KeyK": 0x25, /* html:KeyK (KeyK) -> linux:37 (KEY_K) -> atset1:37 */ + "KeyL": 0x26, /* html:KeyL (KeyL) -> linux:38 (KEY_L) -> atset1:38 */ + "KeyM": 0x32, /* html:KeyM (KeyM) -> linux:50 (KEY_M) -> atset1:50 */ + "KeyN": 0x31, /* html:KeyN (KeyN) -> linux:49 (KEY_N) -> atset1:49 */ + "KeyO": 0x18, /* html:KeyO (KeyO) -> linux:24 (KEY_O) -> atset1:24 */ + "KeyP": 0x19, /* html:KeyP (KeyP) -> linux:25 (KEY_P) -> atset1:25 */ + "KeyQ": 0x10, /* html:KeyQ (KeyQ) -> linux:16 (KEY_Q) -> atset1:16 */ + "KeyR": 0x13, /* html:KeyR (KeyR) -> linux:19 (KEY_R) -> atset1:19 */ + "KeyS": 0x1f, /* html:KeyS (KeyS) -> linux:31 (KEY_S) -> atset1:31 */ + "KeyT": 0x14, /* html:KeyT (KeyT) -> linux:20 (KEY_T) -> atset1:20 */ + "KeyU": 0x16, /* html:KeyU (KeyU) -> linux:22 (KEY_U) -> atset1:22 */ + "KeyV": 0x2f, /* html:KeyV (KeyV) -> linux:47 (KEY_V) -> atset1:47 */ + "KeyW": 0x11, /* html:KeyW (KeyW) -> linux:17 (KEY_W) -> atset1:17 */ + "KeyX": 0x2d, /* html:KeyX (KeyX) -> linux:45 (KEY_X) -> atset1:45 */ + "KeyY": 0x15, /* html:KeyY (KeyY) -> linux:21 (KEY_Y) -> atset1:21 */ + "KeyZ": 0x2c, /* html:KeyZ (KeyZ) -> linux:44 (KEY_Z) -> atset1:44 */ + "Lang3": 0x78, /* html:Lang3 (Lang3) -> linux:90 (KEY_KATAKANA) -> atset1:120 */ + "Lang4": 0x77, /* html:Lang4 (Lang4) -> linux:91 (KEY_HIRAGANA) -> atset1:119 */ + "Lang5": 0x76, /* html:Lang5 (Lang5) -> linux:85 (KEY_ZENKAKUHANKAKU) -> atset1:118 */ + "LaunchApp1": 0xe06b, /* html:LaunchApp1 (LaunchApp1) -> linux:157 (KEY_COMPUTER) -> atset1:57451 */ + "LaunchApp2": 0xe021, /* html:LaunchApp2 (LaunchApp2) -> linux:140 (KEY_CALC) -> atset1:57377 */ + "LaunchMail": 0xe06c, /* html:LaunchMail (LaunchMail) -> linux:155 (KEY_MAIL) -> atset1:57452 */ + "MediaPlayPause": 0xe022, /* html:MediaPlayPause (MediaPlayPause) -> linux:164 (KEY_PLAYPAUSE) -> atset1:57378 */ + "MediaSelect": 0xe06d, /* html:MediaSelect (MediaSelect) -> linux:226 (KEY_MEDIA) -> atset1:57453 */ + "MediaStop": 0xe024, /* html:MediaStop (MediaStop) -> linux:166 (KEY_STOPCD) -> atset1:57380 */ + "MediaTrackNext": 0xe019, /* html:MediaTrackNext (MediaTrackNext) -> linux:163 (KEY_NEXTSONG) -> atset1:57369 */ + "MediaTrackPrevious": 0xe010, /* html:MediaTrackPrevious (MediaTrackPrevious) -> linux:165 (KEY_PREVIOUSSONG) -> atset1:57360 */ + "MetaLeft": 0xe05b, /* html:MetaLeft (MetaLeft) -> linux:125 (KEY_LEFTMETA) -> atset1:57435 */ + "MetaRight": 0xe05c, /* html:MetaRight (MetaRight) -> linux:126 (KEY_RIGHTMETA) -> atset1:57436 */ + "Minus": 0xc, /* html:Minus (Minus) -> linux:12 (KEY_MINUS) -> atset1:12 */ + "NonConvert": 0x7b, /* html:NonConvert (NonConvert) -> linux:94 (KEY_MUHENKAN) -> atset1:123 */ + "NumLock": 0x45, /* html:NumLock (NumLock) -> linux:69 (KEY_NUMLOCK) -> atset1:69 */ + "Numpad0": 0x52, /* html:Numpad0 (Numpad0) -> linux:82 (KEY_KP0) -> atset1:82 */ + "Numpad1": 0x4f, /* html:Numpad1 (Numpad1) -> linux:79 (KEY_KP1) -> atset1:79 */ + "Numpad2": 0x50, /* html:Numpad2 (Numpad2) -> linux:80 (KEY_KP2) -> atset1:80 */ + "Numpad3": 0x51, /* html:Numpad3 (Numpad3) -> linux:81 (KEY_KP3) -> atset1:81 */ + "Numpad4": 0x4b, /* html:Numpad4 (Numpad4) -> linux:75 (KEY_KP4) -> atset1:75 */ + "Numpad5": 0x4c, /* html:Numpad5 (Numpad5) -> linux:76 (KEY_KP5) -> atset1:76 */ + "Numpad6": 0x4d, /* html:Numpad6 (Numpad6) -> linux:77 (KEY_KP6) -> atset1:77 */ + "Numpad7": 0x47, /* html:Numpad7 (Numpad7) -> linux:71 (KEY_KP7) -> atset1:71 */ + "Numpad8": 0x48, /* html:Numpad8 (Numpad8) -> linux:72 (KEY_KP8) -> atset1:72 */ + "Numpad9": 0x49, /* html:Numpad9 (Numpad9) -> linux:73 (KEY_KP9) -> atset1:73 */ + "NumpadAdd": 0x4e, /* html:NumpadAdd (NumpadAdd) -> linux:78 (KEY_KPPLUS) -> atset1:78 */ + "NumpadComma": 0x7e, /* html:NumpadComma (NumpadComma) -> linux:121 (KEY_KPCOMMA) -> atset1:126 */ + "NumpadDecimal": 0x53, /* html:NumpadDecimal (NumpadDecimal) -> linux:83 (KEY_KPDOT) -> atset1:83 */ + "NumpadDivide": 0xe035, /* html:NumpadDivide (NumpadDivide) -> linux:98 (KEY_KPSLASH) -> atset1:57397 */ + "NumpadEnter": 0xe01c, /* html:NumpadEnter (NumpadEnter) -> linux:96 (KEY_KPENTER) -> atset1:57372 */ + "NumpadEqual": 0x59, /* html:NumpadEqual (NumpadEqual) -> linux:117 (KEY_KPEQUAL) -> atset1:89 */ + "NumpadMultiply": 0x37, /* html:NumpadMultiply (NumpadMultiply) -> linux:55 (KEY_KPASTERISK) -> atset1:55 */ + "NumpadParenLeft": 0xe076, /* html:NumpadParenLeft (NumpadParenLeft) -> linux:179 (KEY_KPLEFTPAREN) -> atset1:57462 */ + "NumpadParenRight": 0xe07b, /* html:NumpadParenRight (NumpadParenRight) -> linux:180 (KEY_KPRIGHTPAREN) -> atset1:57467 */ + "NumpadSubtract": 0x4a, /* html:NumpadSubtract (NumpadSubtract) -> linux:74 (KEY_KPMINUS) -> atset1:74 */ + "Open": 0x64, /* html:Open (Open) -> linux:134 (KEY_OPEN) -> atset1:100 */ + "PageDown": 0xe051, /* html:PageDown (PageDown) -> linux:109 (KEY_PAGEDOWN) -> atset1:57425 */ + "PageUp": 0xe049, /* html:PageUp (PageUp) -> linux:104 (KEY_PAGEUP) -> atset1:57417 */ + "Paste": 0x65, /* html:Paste (Paste) -> linux:135 (KEY_PASTE) -> atset1:101 */ + "Pause": 0xe046, /* html:Pause (Pause) -> linux:119 (KEY_PAUSE) -> atset1:57414 */ + "Period": 0x34, /* html:Period (Period) -> linux:52 (KEY_DOT) -> atset1:52 */ + "Power": 0xe05e, /* html:Power (Power) -> linux:116 (KEY_POWER) -> atset1:57438 */ + "PrintScreen": 0x54, /* html:PrintScreen (PrintScreen) -> linux:99 (KEY_SYSRQ) -> atset1:84 */ + "Props": 0xe006, /* html:Props (Props) -> linux:130 (KEY_PROPS) -> atset1:57350 */ + "Quote": 0x28, /* html:Quote (Quote) -> linux:40 (KEY_APOSTROPHE) -> atset1:40 */ + "ScrollLock": 0x46, /* html:ScrollLock (ScrollLock) -> linux:70 (KEY_SCROLLLOCK) -> atset1:70 */ + "Semicolon": 0x27, /* html:Semicolon (Semicolon) -> linux:39 (KEY_SEMICOLON) -> atset1:39 */ + "ShiftLeft": 0x2a, /* html:ShiftLeft (ShiftLeft) -> linux:42 (KEY_LEFTSHIFT) -> atset1:42 */ + "ShiftRight": 0x36, /* html:ShiftRight (ShiftRight) -> linux:54 (KEY_RIGHTSHIFT) -> atset1:54 */ + "Slash": 0x35, /* html:Slash (Slash) -> linux:53 (KEY_SLASH) -> atset1:53 */ + "Sleep": 0xe05f, /* html:Sleep (Sleep) -> linux:142 (KEY_SLEEP) -> atset1:57439 */ + "Space": 0x39, /* html:Space (Space) -> linux:57 (KEY_SPACE) -> atset1:57 */ + "Suspend": 0xe025, /* html:Suspend (Suspend) -> linux:205 (KEY_SUSPEND) -> atset1:57381 */ + "Tab": 0xf, /* html:Tab (Tab) -> linux:15 (KEY_TAB) -> atset1:15 */ + "Undo": 0xe007, /* html:Undo (Undo) -> linux:131 (KEY_UNDO) -> atset1:57351 */ + "WakeUp": 0xe063, /* html:WakeUp (WakeUp) -> linux:143 (KEY_WAKEUP) -> atset1:57443 */ }; diff --git a/core/rfb.js b/core/rfb.js index 8f9a5469..21b5da17 100644 --- a/core/rfb.js +++ b/core/rfb.js @@ -18,7 +18,6 @@ import Display from "./display.js"; import Keyboard from "./input/keyboard.js"; import Mouse from "./input/mouse.js"; import Websock from "./websock.js"; -import Base64 from "./base64.js"; import DES from "./des.js"; import KeyTable from "./input/keysym.js"; import XtScancode from "./input/xtscancodes.js"; @@ -26,241 +25,244 @@ import Inflator from "./inflator.js"; import { encodings, encodingName } from "./encodings.js"; import "./util/polyfill.js"; -/*jslint white: false, browser: true */ -/*global window, Util, Display, Keyboard, Mouse, Websock, Websock_native, Base64, DES, KeyTable, Inflator, XtScancode */ - // How many seconds to wait for a disconnect to finish -var DISCONNECT_TIMEOUT = 3; +const DISCONNECT_TIMEOUT = 3; -export default function RFB(target, url, options) { - if (!target) { - throw Error("Must specify target"); - } - if (!url) { - throw Error("Must specify URL"); - } - - this._target = target; - this._url = url; - - // Connection details - options = options || {}; - this._rfb_credentials = options.credentials || {}; - this._shared = 'shared' in options ? !!options.shared : true; - this._repeaterID = options.repeaterID || ''; - - // Internal state - this._rfb_connection_state = ''; - this._rfb_init_state = ''; - this._rfb_auth_scheme = ''; - this._rfb_clean_disconnect = true; - - // Server capabilities - this._rfb_version = 0; - this._rfb_max_version = 3.8; - this._rfb_tightvnc = false; - this._rfb_xvp_ver = 0; - - this._fb_width = 0; - this._fb_height = 0; - - this._fb_name = ""; - - this._capabilities = { power: false }; - - this._supportsFence = false; - - this._supportsContinuousUpdates = false; - this._enabledContinuousUpdates = false; - - this._supportsSetDesktopSize = false; - this._screen_id = 0; - this._screen_flags = 0; - - this._qemuExtKeyEventSupported = false; - - // Internal objects - this._sock = null; // Websock object - this._display = null; // Display object - this._flushing = false; // Display flushing state - this._keyboard = null; // Keyboard input handler object - this._mouse = null; // Mouse input handler object - - // Timers - this._disconnTimer = null; // disconnection timer - this._resizeTimeout = null; // resize rate limiting - - // Decoder states and stats - this._encHandlers = {}; - this._encStats = {}; - - this._FBU = { - rects: 0, - subrects: 0, // RRE and HEXTILE - lines: 0, // RAW - tiles: 0, // HEXTILE - bytes: 0, - x: 0, - y: 0, - width: 0, - height: 0, - encoding: 0, - subencoding: -1, - background: null, - zlibs: [] // TIGHT zlib streams - }; - for (var i = 0; i < 4; i++) { - this._FBU.zlibs[i] = new Inflator(); - } - - this._destBuff = null; - this._paletteBuff = new Uint8Array(1024); // 256 * 4 (max palette size * max bytes-per-pixel) - - this._rre_chunk_sz = 100; - - this._timing = { - last_fbu: 0, - fbu_total: 0, - fbu_total_cnt: 0, - full_fbu_total: 0, - full_fbu_cnt: 0, - - fbu_rt_start: 0, - fbu_rt_total: 0, - fbu_rt_cnt: 0, - pixels: 0 - }; - - // Mouse state - this._mouse_buttonMask = 0; - this._mouse_arr = []; - this._viewportDragging = false; - this._viewportDragPos = {}; - this._viewportHasMoved = false; - - // Bound event handlers - this._eventHandlers = { - focusCanvas: this._focusCanvas.bind(this), - windowResize: this._windowResize.bind(this), - }; - - // main setup - Log.Debug(">> RFB.constructor"); - - // Create DOM elements - this._screen = document.createElement('div'); - this._screen.style.display = 'flex'; - this._screen.style.width = '100%'; - this._screen.style.height = '100%'; - this._screen.style.overflow = 'auto'; - this._screen.style.backgroundColor = 'rgb(40, 40, 40)'; - this._canvas = document.createElement('canvas'); - this._canvas.style.margin = 'auto'; - // Some browsers add an outline on focus - this._canvas.style.outline = 'none'; - // IE miscalculates width without this :( - this._canvas.style.flexShrink = '0'; - this._canvas.width = 0; - this._canvas.height = 0; - this._canvas.tabIndex = -1; - this._screen.appendChild(this._canvas); - - // populate encHandlers with bound versions - this._encHandlers[encodings.encodingRaw] = RFB.encodingHandlers.RAW.bind(this); - this._encHandlers[encodings.encodingCopyRect] = RFB.encodingHandlers.COPYRECT.bind(this); - this._encHandlers[encodings.encodingRRE] = RFB.encodingHandlers.RRE.bind(this); - this._encHandlers[encodings.encodingHextile] = RFB.encodingHandlers.HEXTILE.bind(this); - this._encHandlers[encodings.encodingTight] = RFB.encodingHandlers.TIGHT.bind(this); - - this._encHandlers[encodings.pseudoEncodingDesktopSize] = RFB.encodingHandlers.DesktopSize.bind(this); - this._encHandlers[encodings.pseudoEncodingLastRect] = RFB.encodingHandlers.last_rect.bind(this); - this._encHandlers[encodings.pseudoEncodingCursor] = RFB.encodingHandlers.Cursor.bind(this); - this._encHandlers[encodings.pseudoEncodingQEMUExtendedKeyEvent] = RFB.encodingHandlers.QEMUExtendedKeyEvent.bind(this); - this._encHandlers[encodings.pseudoEncodingExtendedDesktopSize] = RFB.encodingHandlers.ExtendedDesktopSize.bind(this); - - // NB: nothing that needs explicit teardown should be done - // before this point, since this can throw an exception - try { - this._display = new Display(this._canvas); - } catch (exc) { - Log.Error("Display exception: " + exc); - throw exc; - } - this._display.onflush = this._onFlush.bind(this); - this._display.clear(); - - this._keyboard = new Keyboard(this._canvas); - this._keyboard.onkeyevent = this._handleKeyEvent.bind(this); - - this._mouse = new Mouse(this._canvas); - this._mouse.onmousebutton = this._handleMouseButton.bind(this); - this._mouse.onmousemove = this._handleMouseMove.bind(this); - - this._sock = new Websock(); - this._sock.on('message', this._handle_message.bind(this)); - this._sock.on('open', function () { - if ((this._rfb_connection_state === 'connecting') && - (this._rfb_init_state === '')) { - this._rfb_init_state = 'ProtocolVersion'; - Log.Debug("Starting VNC handshake"); - } else { - this._fail("Unexpected server connection while " + - this._rfb_connection_state); +export default class RFB extends EventTargetMixin { + constructor(target, url, options) { + super(); + if (!target) { + throw Error("Must specify target"); } - }.bind(this)); - this._sock.on('close', function (e) { - Log.Debug("WebSocket on-close event"); - var msg = ""; - if (e.code) { - msg = "(code: " + e.code; - if (e.reason) { - msg += ", reason: " + e.reason; + if (!url) { + throw Error("Must specify URL"); + } + + this._target = target; + this._url = url; + + // Connection details + options = options || {}; + this._rfb_credentials = options.credentials || {}; + this._shared = 'shared' in options ? !!options.shared : true; + this._repeaterID = options.repeaterID || ''; + + // Internal state + this._rfb_connection_state = ''; + this._rfb_init_state = ''; + this._rfb_auth_scheme = ''; + this._rfb_clean_disconnect = true; + + // Server capabilities + this._rfb_version = 0; + this._rfb_max_version = 3.8; + this._rfb_tightvnc = false; + this._rfb_xvp_ver = 0; + + this._fb_width = 0; + this._fb_height = 0; + + this._fb_name = ""; + + this._capabilities = { power: false }; + + this._supportsFence = false; + + this._supportsContinuousUpdates = false; + this._enabledContinuousUpdates = false; + + this._supportsSetDesktopSize = false; + this._screen_id = 0; + this._screen_flags = 0; + + this._qemuExtKeyEventSupported = false; + + // Internal objects + this._sock = null; // Websock object + this._display = null; // Display object + this._flushing = false; // Display flushing state + this._keyboard = null; // Keyboard input handler object + this._mouse = null; // Mouse input handler object + + // Timers + this._disconnTimer = null; // disconnection timer + this._resizeTimeout = null; // resize rate limiting + + // Decoder states and stats + this._encHandlers = {}; + this._encStats = {}; + + this._FBU = { + rects: 0, + subrects: 0, // RRE and HEXTILE + lines: 0, // RAW + tiles: 0, // HEXTILE + bytes: 0, + x: 0, + y: 0, + width: 0, + height: 0, + encoding: 0, + subencoding: -1, + background: null, + zlibs: [] // TIGHT zlib streams + }; + for (let i = 0; i < 4; i++) { + this._FBU.zlibs[i] = new Inflator(); + } + + this._destBuff = null; + this._paletteBuff = new Uint8Array(1024); // 256 * 4 (max palette size * max bytes-per-pixel) + + this._rre_chunk_sz = 100; + + this._timing = { + last_fbu: 0, + fbu_total: 0, + fbu_total_cnt: 0, + full_fbu_total: 0, + full_fbu_cnt: 0, + + fbu_rt_start: 0, + fbu_rt_total: 0, + fbu_rt_cnt: 0, + pixels: 0 + }; + + // Mouse state + this._mouse_buttonMask = 0; + this._mouse_arr = []; + this._viewportDragging = false; + this._viewportDragPos = {}; + this._viewportHasMoved = false; + + // Bound event handlers + this._eventHandlers = { + focusCanvas: this._focusCanvas.bind(this), + windowResize: this._windowResize.bind(this), + }; + + // main setup + Log.Debug(">> RFB.constructor"); + + // Create DOM elements + this._screen = document.createElement('div'); + this._screen.style.display = 'flex'; + this._screen.style.width = '100%'; + this._screen.style.height = '100%'; + this._screen.style.overflow = 'auto'; + this._screen.style.backgroundColor = 'rgb(40, 40, 40)'; + this._canvas = document.createElement('canvas'); + this._canvas.style.margin = 'auto'; + // Some browsers add an outline on focus + this._canvas.style.outline = 'none'; + // IE miscalculates width without this :( + this._canvas.style.flexShrink = '0'; + this._canvas.width = 0; + this._canvas.height = 0; + this._canvas.tabIndex = -1; + this._screen.appendChild(this._canvas); + + // populate encHandlers with bound versions + this._encHandlers[encodings.encodingRaw] = RFB.encodingHandlers.RAW.bind(this); + this._encHandlers[encodings.encodingCopyRect] = RFB.encodingHandlers.COPYRECT.bind(this); + this._encHandlers[encodings.encodingRRE] = RFB.encodingHandlers.RRE.bind(this); + this._encHandlers[encodings.encodingHextile] = RFB.encodingHandlers.HEXTILE.bind(this); + this._encHandlers[encodings.encodingTight] = RFB.encodingHandlers.TIGHT.bind(this); + + this._encHandlers[encodings.pseudoEncodingDesktopSize] = RFB.encodingHandlers.DesktopSize.bind(this); + this._encHandlers[encodings.pseudoEncodingLastRect] = RFB.encodingHandlers.last_rect.bind(this); + this._encHandlers[encodings.pseudoEncodingCursor] = RFB.encodingHandlers.Cursor.bind(this); + this._encHandlers[encodings.pseudoEncodingQEMUExtendedKeyEvent] = RFB.encodingHandlers.QEMUExtendedKeyEvent.bind(this); + this._encHandlers[encodings.pseudoEncodingExtendedDesktopSize] = RFB.encodingHandlers.ExtendedDesktopSize.bind(this); + + // NB: nothing that needs explicit teardown should be done + // before this point, since this can throw an exception + try { + this._display = new Display(this._canvas); + } catch (exc) { + Log.Error("Display exception: " + exc); + throw exc; + } + this._display.onflush = this._onFlush.bind(this); + this._display.clear(); + + this._keyboard = new Keyboard(this._canvas); + this._keyboard.onkeyevent = this._handleKeyEvent.bind(this); + + this._mouse = new Mouse(this._canvas); + this._mouse.onmousebutton = this._handleMouseButton.bind(this); + this._mouse.onmousemove = this._handleMouseMove.bind(this); + + this._sock = new Websock(); + this._sock.on('message', this._handle_message.bind(this)); + this._sock.on('open', () => { + if ((this._rfb_connection_state === 'connecting') && + (this._rfb_init_state === '')) { + this._rfb_init_state = 'ProtocolVersion'; + Log.Debug("Starting VNC handshake"); + } else { + this._fail("Unexpected server connection while " + + this._rfb_connection_state); } - msg += ")"; - } - switch (this._rfb_connection_state) { - case 'connecting': - this._fail("Connection closed " + msg); - break; - case 'connected': - // Handle disconnects that were initiated server-side - this._updateConnectionState('disconnecting'); - this._updateConnectionState('disconnected'); - break; - case 'disconnecting': - // Normal disconnection path - this._updateConnectionState('disconnected'); - break; - case 'disconnected': - this._fail("Unexpected server disconnect " + - "when already disconnected " + msg); - break; - default: - this._fail("Unexpected server disconnect before connecting " + - msg); - break; - } - this._sock.off('close'); - }.bind(this)); - this._sock.on('error', function (e) { - Log.Warn("WebSocket on-error event"); - }); + }); + this._sock.on('close', (e) => { + Log.Debug("WebSocket on-close event"); + let msg = ""; + if (e.code) { + msg = "(code: " + e.code; + if (e.reason) { + msg += ", reason: " + e.reason; + } + msg += ")"; + } + switch (this._rfb_connection_state) { + case 'connecting': + this._fail("Connection closed " + msg); + break; + case 'connected': + // Handle disconnects that were initiated server-side + this._updateConnectionState('disconnecting'); + this._updateConnectionState('disconnected'); + break; + case 'disconnecting': + // Normal disconnection path + this._updateConnectionState('disconnected'); + break; + case 'disconnected': + this._fail("Unexpected server disconnect " + + "when already disconnected " + msg); + break; + default: + this._fail("Unexpected server disconnect before connecting " + + msg); + break; + } + this._sock.off('close'); + }); + this._sock.on('error', () => { + Log.Warn("WebSocket on-error event"); + }); - // Slight delay of the actual connection so that the caller has - // time to set up callbacks - setTimeout(this._updateConnectionState.bind(this, 'connecting')); + // Slight delay of the actual connection so that the caller has + // time to set up callbacks + setTimeout(this._updateConnectionState.bind(this, 'connecting')); - Log.Debug("<< RFB.constructor"); -}; -RFB.prototype = { + // ===== PROPERTIES ===== + + this.dragViewport = false; + this.focusOnClick = true; + this._viewOnly = false; + this._clipViewport = false; + this._scaleViewport = false; + this._resizeSession = false; + + Log.Debug("<< RFB.constructor"); + } + // ===== PROPERTIES ===== - - dragViewport: false, - focusOnClick: true, - - _viewOnly: false, - get viewOnly() { return this._viewOnly; }, + get viewOnly() { return this._viewOnly; } set viewOnly(viewOnly) { this._viewOnly = viewOnly; @@ -274,22 +276,20 @@ RFB.prototype = { this._mouse.grab(); } } - }, + } - get capabilities() { return this._capabilities; }, + get capabilities() { return this._capabilities; } - get touchButton() { return this._mouse.touchButton; }, - set touchButton(button) { this._mouse.touchButton = button; }, + get touchButton() { return this._mouse.touchButton; } + set touchButton(button) { this._mouse.touchButton = button; } - _clipViewport: false, - get clipViewport() { return this._clipViewport; }, + get clipViewport() { return this._clipViewport; } set clipViewport(viewport) { this._clipViewport = viewport; this._updateClip(); - }, + } - _scaleViewport: false, - get scaleViewport() { return this._scaleViewport; }, + get scaleViewport() { return this._scaleViewport; } set scaleViewport(scale) { this._scaleViewport = scale; // Scaling trumps clipping, so we may need to adjust @@ -301,32 +301,31 @@ RFB.prototype = { if (!scale && this._clipViewport) { this._updateClip(); } - }, + } - _resizeSession: false, - get resizeSession() { return this._resizeSession; }, + get resizeSession() { return this._resizeSession; } set resizeSession(resize) { this._resizeSession = resize; if (resize) { this._requestRemoteResize(); } - }, + } // ===== PUBLIC METHODS ===== - disconnect: function () { + disconnect() { this._updateConnectionState('disconnecting'); this._sock.off('error'); this._sock.off('message'); this._sock.off('open'); - }, + } - sendCredentials: function (creds) { + sendCredentials(creds) { this._rfb_credentials = creds; setTimeout(this._init_msg.bind(this), 0); - }, + } - sendCtrlAltDel: function () { + sendCtrlAltDel() { if (this._rfb_connection_state !== 'connected' || this._viewOnly) { return; } Log.Info("Sending Ctrl-Alt-Del"); @@ -336,23 +335,23 @@ RFB.prototype = { this.sendKey(KeyTable.XK_Delete, "Delete", false); this.sendKey(KeyTable.XK_Alt_L, "AltLeft", false); this.sendKey(KeyTable.XK_Control_L, "ControlLeft", false); - }, + } - machineShutdown: function () { + machineShutdown() { this._xvpOp(1, 2); - }, + } - machineReboot: function () { + machineReboot() { this._xvpOp(1, 3); - }, + } - machineReset: function () { + machineReset() { this._xvpOp(1, 4); - }, + } // Send a key press. If 'down' is not specified then send a down key // followed by an up key. - sendKey: function (keysym, code, down) { + sendKey(keysym, code, down) { if (this._rfb_connection_state !== 'connected' || this._viewOnly) { return; } if (down === undefined) { @@ -361,7 +360,7 @@ RFB.prototype = { return; } - var scancode = XtScancode[code]; + const scancode = XtScancode[code]; if (this._qemuExtKeyEventSupported && scancode) { // 0 is NoSymbol @@ -377,24 +376,24 @@ RFB.prototype = { Log.Info("Sending keysym (" + (down ? "down" : "up") + "): " + keysym); RFB.messages.keyEvent(this._sock, keysym, down ? 1 : 0); } - }, + } - focus: function () { + focus() { this._canvas.focus(); - }, + } - blur: function () { + blur() { this._canvas.blur(); - }, + } - clipboardPasteFrom: function (text) { + clipboardPasteFrom(text) { if (this._rfb_connection_state !== 'connected' || this._viewOnly) { return; } RFB.messages.clientCutText(this._sock, text); - }, + } // ===== PRIVATE METHODS ===== - _connect: function () { + _connect() { Log.Debug(">> RFB.connect"); Log.Info("connecting to " + this._url); @@ -422,9 +421,9 @@ RFB.prototype = { this._canvas.addEventListener("touchstart", this._eventHandlers.focusCanvas); Log.Debug("<< RFB.connect"); - }, + } - _disconnect: function () { + _disconnect() { Log.Debug(">> RFB.disconnect"); this._canvas.removeEventListener("mousedown", this._eventHandlers.focusCanvas); this._canvas.removeEventListener("touchstart", this._eventHandlers.focusCanvas); @@ -445,27 +444,27 @@ RFB.prototype = { } clearTimeout(this._resizeTimeout); Log.Debug("<< RFB.disconnect"); - }, + } - _print_stats: function () { - var stats = this._encStats; + _print_stats() { + const stats = this._encStats; Log.Info("Encoding stats for this connection:"); - Object.keys(stats).forEach(function (key) { - var s = stats[key]; + Object.keys(stats).forEach((key) => { + const s = stats[key]; if (s[0] + s[1] > 0) { Log.Info(" " + encodingName(key) + ": " + s[0] + " rects"); } }); Log.Info("Encoding stats since page load:"); - Object.keys(stats).forEach(function (key) { - var s = stats[key]; + Object.keys(stats).forEach((key) => { + const s = stats[key]; Log.Info(" " + encodingName(key) + ": " + s[1] + " rects"); }); - }, + } - _focusCanvas: function(event) { + _focusCanvas(event) { // Respect earlier handlers' request to not do side-effects if (event.defaultPrevented) { return; @@ -476,15 +475,15 @@ RFB.prototype = { } this.focus(); - }, + } - _windowResize: function (event) { + _windowResize() { // If the window resized then our screen element might have // as well. Update the viewport dimensions. - window.requestAnimationFrame(function () { + window.requestAnimationFrame(() => { this._updateClip(); this._updateScale(); - }.bind(this)); + }); if (this._resizeSession) { // Request changing the resolution of the remote display to @@ -495,13 +494,13 @@ RFB.prototype = { clearTimeout(this._resizeTimeout); this._resizeTimeout = setTimeout(this._requestRemoteResize.bind(this), 500); } - }, + } // Update state of clipping in Display object, and make sure the // configured viewport matches the current screen size - _updateClip: function () { - var cur_clip = this._display.clipViewport; - var new_clip = this._clipViewport; + _updateClip() { + let cur_clip = this._display.clipViewport; + let new_clip = this._clipViewport; if (this._scaleViewport) { // Disable viewport clipping if we are scaling @@ -519,9 +518,9 @@ RFB.prototype = { this._display.viewportChangeSize(size.w, size.h); this._fixScrollbars(); } - }, + } - _updateScale: function () { + _updateScale() { if (!this._scaleViewport) { this._display.scale = 1.0; } else { @@ -529,11 +528,11 @@ RFB.prototype = { this._display.autoscale(size.w, size.h); } this._fixScrollbars(); - }, + } // Requests a change of remote desktop size. This message is an extension // and may only be sent if we have received an ExtendedDesktopSize message - _requestRemoteResize: function () { + _requestRemoteResize() { clearTimeout(this._resizeTimeout); this._resizeTimeout = null; @@ -548,25 +547,25 @@ RFB.prototype = { Log.Debug('Requested new desktop size: ' + size.w + 'x' + size.h); - }, + } // Gets the the size of the available screen - _screenSize: function () { + _screenSize() { return { w: this._screen.offsetWidth, h: this._screen.offsetHeight }; - }, + } - _fixScrollbars: function () { + _fixScrollbars() { // This is a hack because Chrome screws up the calculation // for when scrollbars are needed. So to fix it we temporarily // toggle them off and on. - var orig = this._screen.style.overflow; + const orig = this._screen.style.overflow; this._screen.style.overflow = 'hidden'; // Force Chrome to recalculate the layout by asking for // an element's dimensions this._screen.getBoundingClientRect(); this._screen.style.overflow = orig; - }, + } /* * Connection states: @@ -575,8 +574,8 @@ RFB.prototype = { * disconnecting * disconnected - permanent state */ - _updateConnectionState: function (state) { - var oldstate = this._rfb_connection_state; + _updateConnectionState(state) { + const oldstate = this._rfb_connection_state; if (state === oldstate) { Log.Debug("Already in state '" + state + "', ignoring"); @@ -632,8 +631,7 @@ RFB.prototype = { this._rfb_connection_state = state; - var smsg = "New state '" + state + "', was '" + oldstate + "'."; - Log.Debug(smsg); + Log.Debug("New state '" + state + "', was '" + oldstate + "'."); if (this._disconnTimer && state !== 'disconnecting') { Log.Debug("Clearing disconnect timer"); @@ -650,34 +648,32 @@ RFB.prototype = { break; case 'connected': - var event = new CustomEvent("connect", { detail: {} }); - this.dispatchEvent(event); + this.dispatchEvent(new CustomEvent("connect", { detail: {} })); break; case 'disconnecting': this._disconnect(); - this._disconnTimer = setTimeout(function () { + this._disconnTimer = setTimeout(() => { Log.Error("Disconnection timed out."); this._updateConnectionState('disconnected'); - }.bind(this), DISCONNECT_TIMEOUT * 1000); + }, DISCONNECT_TIMEOUT * 1000); break; case 'disconnected': - event = new CustomEvent( + this.dispatchEvent(new CustomEvent( "disconnect", { detail: - { clean: this._rfb_clean_disconnect } }); - this.dispatchEvent(event); + { clean: this._rfb_clean_disconnect } })); break; } - }, + } /* Print errors and disconnect * * The parameter 'details' is used for information that * should be logged but not sent to the user interface. */ - _fail: function (details) { + _fail(details) { switch (this._rfb_connection_state) { case 'disconnecting': Log.Error("Failed when disconnecting: " + details); @@ -699,16 +695,16 @@ RFB.prototype = { this._updateConnectionState('disconnected'); return false; - }, + } - _setCapability: function (cap, val) { + _setCapability(cap, val) { this._capabilities[cap] = val; - var event = new CustomEvent("capabilities", + const event = new CustomEvent("capabilities", { detail: { capabilities: this._capabilities } }); this.dispatchEvent(event); - }, + } - _handle_message: function () { + _handle_message() { if (this._sock.rQlen() === 0) { Log.Warn("handle_message called on an empty receive queue"); return; @@ -719,6 +715,7 @@ RFB.prototype = { Log.Error("Got data while disconnected"); break; case 'connected': + // eslint-disable-next-line no-constant-condition while (true) { if (this._flushing) { break; @@ -735,13 +732,13 @@ RFB.prototype = { this._init_msg(); break; } - }, + } - _handleKeyEvent: function (keysym, code, down) { + _handleKeyEvent(keysym, code, down) { this.sendKey(keysym, code, down); - }, + } - _handleMouseButton: function (x, y, down, bmask) { + _handleMouseButton(x, y, down, bmask) { if (down) { this._mouse_buttonMask |= bmask; } else { @@ -779,16 +776,16 @@ RFB.prototype = { if (this._rfb_connection_state !== 'connected') { return; } RFB.messages.pointerEvent(this._sock, this._display.absX(x), this._display.absY(y), this._mouse_buttonMask); - }, + } - _handleMouseMove: function (x, y) { + _handleMouseMove(x, y) { if (this._viewportDragging) { - var deltaX = this._viewportDragPos.x - x; - var deltaY = this._viewportDragPos.y - y; + const deltaX = this._viewportDragPos.x - x; + const deltaY = this._viewportDragPos.y - y; // The goal is to trigger on a certain physical width, the // devicePixelRatio brings us a bit closer but is not optimal. - var dragThreshold = 10 * (window.devicePixelRatio || 1); + const dragThreshold = 10 * (window.devicePixelRatio || 1); if (this._viewportHasMoved || (Math.abs(deltaX) > dragThreshold || Math.abs(deltaY) > dragThreshold)) { @@ -806,18 +803,18 @@ RFB.prototype = { if (this._rfb_connection_state !== 'connected') { return; } RFB.messages.pointerEvent(this._sock, this._display.absX(x), this._display.absY(y), this._mouse_buttonMask); - }, + } // Message Handlers - _negotiate_protocol_version: function () { + _negotiate_protocol_version() { if (this._sock.rQlen() < 12) { return this._fail("Received incomplete protocol version."); } - var sversion = this._sock.rQshiftStr(12).substr(4, 7); + const sversion = this._sock.rQshiftStr(12).substr(4, 7); Log.Info("Server ProtocolVersion: " + sversion); - var is_repeater = 0; + let is_repeater = 0; switch (sversion) { case "000.000": // UltraVNC repeater is_repeater = 1; @@ -841,7 +838,7 @@ RFB.prototype = { } if (is_repeater) { - var repeaterID = "ID:" + this._repeaterID; + let repeaterID = "ID:" + this._repeaterID; while (repeaterID.length < 250) { repeaterID += "\0"; } @@ -853,19 +850,19 @@ RFB.prototype = { this._rfb_version = this._rfb_max_version; } - var cversion = "00" + parseInt(this._rfb_version, 10) + + const cversion = "00" + parseInt(this._rfb_version, 10) + ".00" + ((this._rfb_version * 10) % 10); this._sock.send_string("RFB " + cversion + "\n"); Log.Debug('Sent ProtocolVersion: ' + cversion); this._rfb_init_state = 'Security'; - }, + } - _negotiate_security: function () { + _negotiate_security() { // Polyfill since IE and PhantomJS doesn't have // TypedArray.includes() function includes(item, array) { - for (var i = 0; i < array.length; i++) { + for (let i = 0; i < array.length; i++) { if (array[i] === item) { return true; } @@ -875,14 +872,14 @@ RFB.prototype = { if (this._rfb_version >= 3.7) { // Server sends supported list, client decides - var num_types = this._sock.rQshift8(); + const num_types = this._sock.rQshift8(); if (this._sock.rQwait("security type", num_types, 1)) { return false; } if (num_types === 0) { return this._handle_security_failure("no security types"); } - var types = this._sock.rQshiftBytes(num_types); + const types = this._sock.rQshiftBytes(num_types); Log.Debug("Server security types: " + types); // Look for each auth in preferred order @@ -910,7 +907,7 @@ RFB.prototype = { Log.Debug('Authenticating using scheme: ' + this._rfb_auth_scheme); return this._init_msg(); // jump to authentication - }, + } /* * Get the security failure reason if sent from the server and @@ -922,7 +919,7 @@ RFB.prototype = { * - The optional parameter security_result_status can be used to * add a custom status code to the event. */ - _handle_security_failure: function (context, security_result_status) { + _handle_security_failure(context, security_result_status) { if (typeof context === 'undefined') { context = ""; @@ -937,7 +934,8 @@ RFB.prototype = { if (this._sock.rQwait("reason length", 4)) { return false; } - let strlen = this._sock.rQshift32(); + + const strlen = this._sock.rQshift32(); let reason = ""; if (strlen > 0) { @@ -963,56 +961,56 @@ RFB.prototype = { return this._fail("Security negotiation failed" + context); } - }, + } // authentication - _negotiate_xvp_auth: function () { + _negotiate_xvp_auth() { if (!this._rfb_credentials.username || !this._rfb_credentials.password || !this._rfb_credentials.target) { - var event = new CustomEvent("credentialsrequired", + const event = new CustomEvent("credentialsrequired", { detail: { types: ["username", "password", "target"] } }); this.dispatchEvent(event); return false; } - var xvp_auth_str = String.fromCharCode(this._rfb_credentials.username.length) + + const xvp_auth_str = String.fromCharCode(this._rfb_credentials.username.length) + String.fromCharCode(this._rfb_credentials.target.length) + this._rfb_credentials.username + this._rfb_credentials.target; this._sock.send_string(xvp_auth_str); this._rfb_auth_scheme = 2; return this._negotiate_authentication(); - }, + } - _negotiate_std_vnc_auth: function () { + _negotiate_std_vnc_auth() { if (this._sock.rQwait("auth challenge", 16)) { return false; } if (!this._rfb_credentials.password) { - var event = new CustomEvent("credentialsrequired", + const event = new CustomEvent("credentialsrequired", { detail: { types: ["password"] } }); this.dispatchEvent(event); return false; } // TODO(directxman12): make genDES not require an Array - var challenge = Array.prototype.slice.call(this._sock.rQshiftBytes(16)); - var response = RFB.genDES(this._rfb_credentials.password, challenge); + const challenge = Array.prototype.slice.call(this._sock.rQshiftBytes(16)); + const response = RFB.genDES(this._rfb_credentials.password, challenge); this._sock.send(response); this._rfb_init_state = "SecurityResult"; return true; - }, + } - _negotiate_tight_tunnels: function (numTunnels) { - var clientSupportedTunnelTypes = { + _negotiate_tight_tunnels(numTunnels) { + const clientSupportedTunnelTypes = { 0: { vendor: 'TGHT', signature: 'NOTUNNEL' } }; - var serverSupportedTunnelTypes = {}; + const serverSupportedTunnelTypes = {}; // receive tunnel capabilities - for (var i = 0; i < numTunnels; i++) { - var cap_code = this._sock.rQshift32(); - var cap_vendor = this._sock.rQshiftStr(4); - var cap_signature = this._sock.rQshiftStr(8); + for (let i = 0; i < numTunnels; i++) { + const cap_code = this._sock.rQshift32(); + const cap_vendor = this._sock.rQshiftStr(4); + const cap_signature = this._sock.rQshiftStr(8); serverSupportedTunnelTypes[cap_code] = { vendor: cap_vendor, signature: cap_signature }; } @@ -1029,12 +1027,12 @@ RFB.prototype = { return this._fail("Server wanted tunnels, but doesn't support " + "the notunnel type"); } - }, + } - _negotiate_tight_auth: function () { + _negotiate_tight_auth() { if (!this._rfb_tightvnc) { // first pass, do the tunnel negotiation if (this._sock.rQwait("num tunnels", 4)) { return false; } - var numTunnels = this._sock.rQshift32(); + const numTunnels = this._sock.rQshift32(); if (numTunnels > 0 && this._sock.rQwait("tunnel capabilities", 16 * numTunnels, 4)) { return false; } this._rfb_tightvnc = true; @@ -1047,7 +1045,7 @@ RFB.prototype = { // second pass, do the sub-auth negotiation if (this._sock.rQwait("sub auth count", 4)) { return false; } - var subAuthCount = this._sock.rQshift32(); + const subAuthCount = this._sock.rQshift32(); if (subAuthCount === 0) { // empty sub-auth list received means 'no auth' subtype selected this._rfb_init_state = 'SecurityResult'; return true; @@ -1055,20 +1053,20 @@ RFB.prototype = { if (this._sock.rQwait("sub auth capabilities", 16 * subAuthCount, 4)) { return false; } - var clientSupportedTypes = { + const clientSupportedTypes = { 'STDVNOAUTH__': 1, 'STDVVNCAUTH_': 2 }; - var serverSupportedTypes = []; + const serverSupportedTypes = []; - for (var i = 0; i < subAuthCount; i++) { - var capNum = this._sock.rQshift32(); - var capabilities = this._sock.rQshiftStr(12); + for (let i = 0; i < subAuthCount; i++) { + this._sock.rQshift32(); // Cap num + const capabilities = this._sock.rQshiftStr(12); serverSupportedTypes.push(capabilities); } - for (var authType in clientSupportedTypes) { + for (let authType in clientSupportedTypes) { if (serverSupportedTypes.indexOf(authType) != -1) { this._sock.send([0, 0, 0, clientSupportedTypes[authType]]); @@ -1087,9 +1085,9 @@ RFB.prototype = { } return this._fail("No supported sub-auth types!"); - }, + } - _negotiate_authentication: function () { + _negotiate_authentication() { switch (this._rfb_auth_scheme) { case 0: // connection failed return this._handle_security_failure("authentication scheme"); @@ -1115,9 +1113,9 @@ RFB.prototype = { return this._fail("Unsupported auth scheme (scheme: " + this._rfb_auth_scheme + ")"); } - }, + } - _handle_security_result: function () { + _handle_security_result() { if (this._sock.rQwait('VNC auth response ', 4)) { return false; } let status = this._sock.rQshift32(); @@ -1137,46 +1135,46 @@ RFB.prototype = { return this._fail("Security handshake failed"); } } - }, + } - _negotiate_server_init: function () { + _negotiate_server_init() { if (this._sock.rQwait("server initialization", 24)) { return false; } /* Screen size */ - var width = this._sock.rQshift16(); - var height = this._sock.rQshift16(); + const width = this._sock.rQshift16(); + const height = this._sock.rQshift16(); /* PIXEL_FORMAT */ - var bpp = this._sock.rQshift8(); - var depth = this._sock.rQshift8(); - var big_endian = this._sock.rQshift8(); - var true_color = this._sock.rQshift8(); + const bpp = this._sock.rQshift8(); + const depth = this._sock.rQshift8(); + const big_endian = this._sock.rQshift8(); + const true_color = this._sock.rQshift8(); - var red_max = this._sock.rQshift16(); - var green_max = this._sock.rQshift16(); - var blue_max = this._sock.rQshift16(); - var red_shift = this._sock.rQshift8(); - var green_shift = this._sock.rQshift8(); - var blue_shift = this._sock.rQshift8(); + const red_max = this._sock.rQshift16(); + const green_max = this._sock.rQshift16(); + const blue_max = this._sock.rQshift16(); + const red_shift = this._sock.rQshift8(); + const green_shift = this._sock.rQshift8(); + const blue_shift = this._sock.rQshift8(); this._sock.rQskipBytes(3); // padding // NB(directxman12): we don't want to call any callbacks or print messages until // *after* we're past the point where we could backtrack /* Connection name/title */ - var name_length = this._sock.rQshift32(); + const name_length = this._sock.rQshift32(); if (this._sock.rQwait('server init name', name_length, 24)) { return false; } this._fb_name = decodeUTF8(this._sock.rQshiftStr(name_length)); if (this._rfb_tightvnc) { if (this._sock.rQwait('TightVNC extended server init header', 8, 24 + name_length)) { return false; } // In TightVNC mode, ServerInit message is extended - var numServerMessages = this._sock.rQshift16(); - var numClientMessages = this._sock.rQshift16(); - var numEncodings = this._sock.rQshift16(); + const numServerMessages = this._sock.rQshift16(); + const numClientMessages = this._sock.rQshift16(); + const numEncodings = this._sock.rQshift16(); this._sock.rQskipBytes(2); // padding - var totalMessagesLength = (numServerMessages + numClientMessages + numEncodings) * 16; + const totalMessagesLength = (numServerMessages + numClientMessages + numEncodings) * 16; if (this._sock.rQwait('TightVNC extended server init header', totalMessagesLength, 32 + name_length)) { return false; } // we don't actually do anything with the capability information that TIGHT sends, @@ -1218,7 +1216,7 @@ RFB.prototype = { } // we're past the point where we could backtrack, so it's safe to call this - var event = new CustomEvent("desktopname", + const event = new CustomEvent("desktopname", { detail: { name: this._fb_name } }); this.dispatchEvent(event); @@ -1247,10 +1245,10 @@ RFB.prototype = { this._updateConnectionState('connected'); return true; - }, + } - _sendEncodings: function () { - var encs = []; + _sendEncodings() { + const encs = []; // In preference order encs.push(encodings.encodingCopyRect); @@ -1281,7 +1279,7 @@ RFB.prototype = { } RFB.messages.clientEncodings(this._sock, encs); - }, + } /* RFB protocol initialization states: * ProtocolVersion @@ -1291,7 +1289,7 @@ RFB.prototype = { * ClientInitialization - not triggered by server message * ServerInitialization */ - _init_msg: function () { + _init_msg() { switch (this._rfb_init_state) { case 'ProtocolVersion': return this._negotiate_protocol_version(); @@ -1317,38 +1315,38 @@ RFB.prototype = { return this._fail("Unknown init state (state: " + this._rfb_init_state + ")"); } - }, + } - _handle_set_colour_map_msg: function () { + _handle_set_colour_map_msg() { Log.Debug("SetColorMapEntries"); return this._fail("Unexpected SetColorMapEntries message"); - }, + } - _handle_server_cut_text: function () { + _handle_server_cut_text() { Log.Debug("ServerCutText"); if (this._sock.rQwait("ServerCutText header", 7, 1)) { return false; } this._sock.rQskipBytes(3); // Padding - var length = this._sock.rQshift32(); + const length = this._sock.rQshift32(); if (this._sock.rQwait("ServerCutText", length, 8)) { return false; } - var text = this._sock.rQshiftStr(length); + const text = this._sock.rQshiftStr(length); if (this._viewOnly) { return true; } - var event = new CustomEvent("clipboard", + const event = new CustomEvent("clipboard", { detail: { text: text } }); this.dispatchEvent(event); return true; - }, + } - _handle_server_fence_msg: function() { + _handle_server_fence_msg() { if (this._sock.rQwait("ServerFence header", 8, 1)) { return false; } this._sock.rQskipBytes(3); // Padding - var flags = this._sock.rQshift32(); - var length = this._sock.rQshift8(); + let flags = this._sock.rQshift32(); + let length = this._sock.rQshift8(); if (this._sock.rQwait("ServerFence payload", length, 9)) { return false; } @@ -1357,7 +1355,7 @@ RFB.prototype = { length = 64; } - var payload = this._sock.rQshiftStr(length); + const payload = this._sock.rQshiftStr(length); this._supportsFence = true; @@ -1384,13 +1382,13 @@ RFB.prototype = { RFB.messages.clientFence(this._sock, flags, payload); return true; - }, + } - _handle_xvp_msg: function () { + _handle_xvp_msg() { if (this._sock.rQwait("XVP version and message", 3, 1)) { return false; } this._sock.rQskip8(); // Padding - var xvp_ver = this._sock.rQshift8(); - var xvp_msg = this._sock.rQshift8(); + const xvp_ver = this._sock.rQshift8(); + const xvp_msg = this._sock.rQshift8(); switch (xvp_msg) { case 0: // XVP_FAIL @@ -1407,20 +1405,17 @@ RFB.prototype = { } return true; - }, + } - _normal_msg: function () { - var msg_type; - - if (this._FBU.rects > 0) { - msg_type = 0; - } else { - msg_type = this._sock.rQshift8(); - } + _normal_msg() { + const msg_type = (this._FBU.rects > 0) + ? 0 + : this._sock.rQshift8(); + let ret, first; switch (msg_type) { case 0: // FramebufferUpdate - var ret = this._framebufferUpdate(); + ret = this._framebufferUpdate(); if (ret && !this._enabledContinuousUpdates) { RFB.messages.fbUpdateRequest(this._sock, true, 0, 0, this._fb_width, this._fb_height); @@ -1432,15 +1427,14 @@ RFB.prototype = { case 2: // Bell Log.Debug("Bell"); - var event = new CustomEvent("bell", { detail: {} }); - this.dispatchEvent(event); + this.dispatchEvent(new CustomEvent("bell", { detail: {} })); return true; case 3: // ServerCutText return this._handle_server_cut_text(); case 150: // EndOfContinuousUpdates - var first = !(this._supportsContinuousUpdates); + first = !(this._supportsContinuousUpdates); this._supportsContinuousUpdates = true; this._enabledContinuousUpdates = false; if (first) { @@ -1464,19 +1458,19 @@ RFB.prototype = { Log.Debug("sock.rQslice(0, 30): " + this._sock.rQslice(0, 30)); return true; } - }, + } - _onFlush: function() { + _onFlush() { this._flushing = false; // Resume processing if (this._sock.rQlen() > 0) { this._handle_message(); } - }, + } - _framebufferUpdate: function () { - var ret = true; - var now; + _framebufferUpdate() { + let ret = true; + let now; if (this._FBU.rects === 0) { if (this._sock.rQwait("FBU header", 3, 1)) { return false; } @@ -1506,7 +1500,7 @@ RFB.prototype = { if (this._sock.rQwait("rect header", 12)) { return false; } /* New FramebufferUpdate */ - var hdr = this._sock.rQshiftBytes(12); + const hdr = this._sock.rQshiftBytes(12); this._FBU.x = (hdr[0] << 8) + hdr[1]; this._FBU.y = (hdr[2] << 8) + hdr[3]; this._FBU.width = (hdr[4] << 8) + hdr[5]; @@ -1550,7 +1544,7 @@ RFB.prototype = { } if (this._timing.fbu_rt_start > 0) { - var fbu_rt_diff = now - this._timing.fbu_rt_start; + const fbu_rt_diff = now - this._timing.fbu_rt_start; this._timing.fbu_rt_total += fbu_rt_diff; this._timing.fbu_rt_cnt++; Log.Info("full FBU round-trip, cur: " + @@ -1568,16 +1562,16 @@ RFB.prototype = { this._display.flip(); return true; // We finished this FBU - }, + } - _updateContinuousUpdates: function() { + _updateContinuousUpdates() { if (!this._enabledContinuousUpdates) { return; } RFB.messages.enableContinuousUpdates(this._sock, true, 0, 0, this._fb_width, this._fb_height); - }, + } - _resize: function(width, height) { + _resize(width, height) { this._fb_width = width; this._fb_height = height; @@ -1591,22 +1585,20 @@ RFB.prototype = { this._timing.fbu_rt_start = (new Date()).getTime(); this._updateContinuousUpdates(); - }, + } - _xvpOp: function (ver, op) { + _xvpOp(ver, op) { if (this._rfb_xvp_ver < ver) { return; } Log.Info("Sending XVP operation " + op + " (version " + ver + ")"); RFB.messages.xvpOp(this._sock, ver, op); - }, -}; - -Object.assign(RFB.prototype, EventTargetMixin); + } +} // Class Methods RFB.messages = { - keyEvent: function (sock, keysym, down) { - var buff = sock._sQ; - var offset = sock._sQlen; + keyEvent(sock, keysym, down) { + const buff = sock._sQ; + const offset = sock._sQlen; buff[offset] = 4; // msg-type buff[offset + 1] = down; @@ -1623,10 +1615,10 @@ RFB.messages = { sock.flush(); }, - QEMUExtendedKeyEvent: function (sock, keysym, down, keycode) { + QEMUExtendedKeyEvent(sock, keysym, down, keycode) { function getRFBkeycode(xt_scancode) { - var upperByte = (keycode >> 8); - var lowerByte = (keycode & 0x00ff); + const upperByte = (keycode >> 8); + let lowerByte = (keycode & 0x00ff); if (upperByte === 0xe0 && lowerByte < 0x7f) { lowerByte = lowerByte | 0x80; return lowerByte; @@ -1634,8 +1626,8 @@ RFB.messages = { return xt_scancode; } - var buff = sock._sQ; - var offset = sock._sQlen; + const buff = sock._sQ; + const offset = sock._sQlen; buff[offset] = 255; // msg-type buff[offset + 1] = 0; // sub msg-type @@ -1648,7 +1640,7 @@ RFB.messages = { buff[offset + 6] = (keysym >> 8); buff[offset + 7] = keysym; - var RFBkeycode = getRFBkeycode(keycode); + const RFBkeycode = getRFBkeycode(keycode); buff[offset + 8] = (RFBkeycode >> 24); buff[offset + 9] = (RFBkeycode >> 16); @@ -1659,9 +1651,9 @@ RFB.messages = { sock.flush(); }, - pointerEvent: function (sock, x, y, mask) { - var buff = sock._sQ; - var offset = sock._sQlen; + pointerEvent(sock, x, y, mask) { + const buff = sock._sQ; + const offset = sock._sQlen; buff[offset] = 5; // msg-type @@ -1678,9 +1670,9 @@ RFB.messages = { }, // TODO(directxman12): make this unicode compatible? - clientCutText: function (sock, text) { - var buff = sock._sQ; - var offset = sock._sQlen; + clientCutText(sock, text) { + const buff = sock._sQ; + const offset = sock._sQlen; buff[offset] = 6; // msg-type @@ -1688,14 +1680,14 @@ RFB.messages = { buff[offset + 2] = 0; // padding buff[offset + 3] = 0; // padding - var n = text.length; + const n = text.length; buff[offset + 4] = n >> 24; buff[offset + 5] = n >> 16; buff[offset + 6] = n >> 8; buff[offset + 7] = n; - for (var i = 0; i < n; i++) { + for (let i = 0; i < n; i++) { buff[offset + 8 + i] = text.charCodeAt(i); } @@ -1703,9 +1695,9 @@ RFB.messages = { sock.flush(); }, - setDesktopSize: function (sock, width, height, id, flags) { - var buff = sock._sQ; - var offset = sock._sQlen; + setDesktopSize(sock, width, height, id, flags) { + const buff = sock._sQ; + const offset = sock._sQlen; buff[offset] = 251; // msg-type buff[offset + 1] = 0; // padding @@ -1739,9 +1731,9 @@ RFB.messages = { sock.flush(); }, - clientFence: function (sock, flags, payload) { - var buff = sock._sQ; - var offset = sock._sQlen; + clientFence(sock, flags, payload) { + const buff = sock._sQ; + const offset = sock._sQlen; buff[offset] = 248; // msg-type @@ -1754,11 +1746,11 @@ RFB.messages = { buff[offset + 6] = flags >> 8; buff[offset + 7] = flags; - var n = payload.length; + const n = payload.length; buff[offset + 8] = n; // length - for (var i = 0; i < n; i++) { + for (let i = 0; i < n; i++) { buff[offset + 9 + i] = payload.charCodeAt(i); } @@ -1766,9 +1758,9 @@ RFB.messages = { sock.flush(); }, - enableContinuousUpdates: function (sock, enable, x, y, width, height) { - var buff = sock._sQ; - var offset = sock._sQlen; + enableContinuousUpdates(sock, enable, x, y, width, height) { + const buff = sock._sQ; + const offset = sock._sQlen; buff[offset] = 150; // msg-type buff[offset + 1] = enable; // enable-flag @@ -1786,11 +1778,11 @@ RFB.messages = { sock.flush(); }, - pixelFormat: function (sock, depth, true_color) { - var buff = sock._sQ; - var offset = sock._sQlen; + pixelFormat(sock, depth, true_color) { + const buff = sock._sQ; + const offset = sock._sQlen; - var bpp, bits; + let bpp; if (depth > 16) { bpp = 32; @@ -1800,7 +1792,7 @@ RFB.messages = { bpp = 8; } - bits = Math.floor(depth/3); + const bits = Math.floor(depth/3); buff[offset] = 0; // msg-type @@ -1834,9 +1826,9 @@ RFB.messages = { sock.flush(); }, - clientEncodings: function (sock, encodings) { - var buff = sock._sQ; - var offset = sock._sQlen; + clientEncodings(sock, encodings) { + const buff = sock._sQ; + const offset = sock._sQlen; buff[offset] = 2; // msg-type buff[offset + 1] = 0; // padding @@ -1844,9 +1836,9 @@ RFB.messages = { buff[offset + 2] = encodings.length >> 8; buff[offset + 3] = encodings.length; - var i, j = offset + 4; - for (i = 0; i < encodings.length; i++) { - var enc = encodings[i]; + let j = offset + 4; + for (let i = 0; i < encodings.length; i++) { + const enc = encodings[i]; buff[j] = enc >> 24; buff[j + 1] = enc >> 16; buff[j + 2] = enc >> 8; @@ -1859,9 +1851,9 @@ RFB.messages = { sock.flush(); }, - fbUpdateRequest: function (sock, incremental, x, y, w, h) { - var buff = sock._sQ; - var offset = sock._sQlen; + fbUpdateRequest(sock, incremental, x, y, w, h) { + const buff = sock._sQ; + const offset = sock._sQlen; if (typeof(x) === "undefined") { x = 0; } if (typeof(y) === "undefined") { y = 0; } @@ -1885,9 +1877,9 @@ RFB.messages = { sock.flush(); }, - xvpOp: function (sock, ver, op) { - var buff = sock._sQ; - var offset = sock._sQlen; + xvpOp(sock, ver, op) { + const buff = sock._sQ; + const offset = sock._sQlen; buff[offset] = 250; // msg-type buff[offset + 1] = 0; // padding @@ -1897,36 +1889,35 @@ RFB.messages = { sock._sQlen += 4; sock.flush(); - }, + } }; -RFB.genDES = function (password, challenge) { - var passwd = []; - for (var i = 0; i < password.length; i++) { +RFB.genDES = (password, challenge) => { + const passwd = []; + for (let i = 0; i < password.length; i++) { passwd.push(password.charCodeAt(i)); } return (new DES(passwd)).encrypt(challenge); }; RFB.encodingHandlers = { - RAW: function () { + RAW() { if (this._FBU.lines === 0) { this._FBU.lines = this._FBU.height; } - var pixelSize = this._fb_depth == 8 ? 1 : 4; + const pixelSize = this._fb_depth == 8 ? 1 : 4; this._FBU.bytes = this._FBU.width * pixelSize; // at least a line if (this._sock.rQwait("RAW", this._FBU.bytes)) { return false; } - var cur_y = this._FBU.y + (this._FBU.height - this._FBU.lines); - var curr_height = Math.min(this._FBU.lines, + const cur_y = this._FBU.y + (this._FBU.height - this._FBU.lines); + const curr_height = Math.min(this._FBU.lines, Math.floor(this._sock.rQlen() / (this._FBU.width * pixelSize))); - var data = this._sock.get_rQ(); - var index = this._sock.get_rQi(); + let data = this._sock.get_rQ(); + let index = this._sock.get_rQi(); if (this._fb_depth == 8) { - var pixels = this._FBU.width * curr_height - var newdata = new Uint8Array(pixels * 4); - var i; - for (i = 0;i < pixels;i++) { + const pixels = this._FBU.width * curr_height + const newdata = new Uint8Array(pixels * 4); + for (let i = 0;i < pixels;i++) { newdata[i * 4 + 0] = ((data[index + i] >> 0) & 0x3) * 255 / 3; newdata[i * 4 + 1] = ((data[index + i] >> 2) & 0x3) * 255 / 3; newdata[i * 4 + 2] = ((data[index + i] >> 4) & 0x3) * 255 / 3; @@ -1950,7 +1941,7 @@ RFB.encodingHandlers = { return true; }, - COPYRECT: function () { + COPYRECT() { this._FBU.bytes = 4; if (this._sock.rQwait("COPYRECT", 4)) { return false; } this._display.copyImage(this._sock.rQshift16(), this._sock.rQshift16(), @@ -1962,8 +1953,8 @@ RFB.encodingHandlers = { return true; }, - RRE: function () { - var color; + RRE() { + let color; if (this._FBU.subrects === 0) { this._FBU.bytes = 4 + 4; if (this._sock.rQwait("RRE", 4 + 4)) { return false; } @@ -1974,16 +1965,16 @@ RFB.encodingHandlers = { while (this._FBU.subrects > 0 && this._sock.rQlen() >= (4 + 8)) { color = this._sock.rQshiftBytes(4); - var x = this._sock.rQshift16(); - var y = this._sock.rQshift16(); - var width = this._sock.rQshift16(); - var height = this._sock.rQshift16(); + const x = this._sock.rQshift16(); + const y = this._sock.rQshift16(); + const width = this._sock.rQshift16(); + const height = this._sock.rQshift16(); this._display.fillRect(this._FBU.x + x, this._FBU.y + y, width, height, color); this._FBU.subrects--; } if (this._FBU.subrects > 0) { - var chunk = Math.min(this._rre_chunk_sz, this._FBU.subrects); + const chunk = Math.min(this._rre_chunk_sz, this._FBU.subrects); this._FBU.bytes = (4 + 8) * chunk; } else { this._FBU.rects--; @@ -1993,9 +1984,9 @@ RFB.encodingHandlers = { return true; }, - HEXTILE: function () { - var rQ = this._sock.get_rQ(); - var rQi = this._sock.get_rQi(); + HEXTILE() { + const rQ = this._sock.get_rQ(); + let rQi = this._sock.get_rQi(); if (this._FBU.tiles === 0) { this._FBU.tiles_x = Math.ceil(this._FBU.width / 16); @@ -2007,21 +1998,21 @@ RFB.encodingHandlers = { while (this._FBU.tiles > 0) { this._FBU.bytes = 1; if (this._sock.rQwait("HEXTILE subencoding", this._FBU.bytes)) { return false; } - var subencoding = rQ[rQi]; // Peek + const subencoding = rQ[rQi]; // Peek if (subencoding > 30) { // Raw this._fail("Illegal hextile subencoding (subencoding: " + subencoding + ")"); return false; } - var subrects = 0; - var curr_tile = this._FBU.total_tiles - this._FBU.tiles; - var tile_x = curr_tile % this._FBU.tiles_x; - var tile_y = Math.floor(curr_tile / this._FBU.tiles_x); - var x = this._FBU.x + tile_x * 16; - var y = this._FBU.y + tile_y * 16; - var w = Math.min(16, (this._FBU.x + this._FBU.width) - x); - var h = Math.min(16, (this._FBU.y + this._FBU.height) - y); + let subrects = 0; + const curr_tile = this._FBU.total_tiles - this._FBU.tiles; + const tile_x = curr_tile % this._FBU.tiles_x; + const tile_y = Math.floor(curr_tile / this._FBU.tiles_x); + const x = this._FBU.x + tile_x * 16; + const y = this._FBU.y + tile_y * 16; + const w = Math.min(16, (this._FBU.x + this._FBU.width) - x); + const h = Math.min(16, (this._FBU.y + this._FBU.height) - y); // Figure out how much we are expecting if (subencoding & 0x01) { // Raw @@ -2075,23 +2066,23 @@ RFB.encodingHandlers = { subrects = rQ[rQi]; rQi++; - for (var s = 0; s < subrects; s++) { - var color; + for (let s = 0; s < subrects; s++) { + let color; if (this._FBU.subencoding & 0x10) { // SubrectsColoured color = [rQ[rQi], rQ[rQi + 1], rQ[rQi + 2], rQ[rQi + 3]]; rQi += 4; } else { color = this._FBU.foreground; } - var xy = rQ[rQi]; + const xy = rQ[rQi]; rQi++; - var sx = (xy >> 4); - var sy = (xy & 0x0f); + const sx = (xy >> 4); + const sy = (xy & 0x0f); - var wh = rQ[rQi]; + const wh = rQ[rQi]; rQi++; - var sw = (wh >> 4) + 1; - var sh = (wh & 0x0f) + 1; + const sw = (wh >> 4) + 1; + const sh = (wh & 0x0f) + 1; this._display.subTile(sx, sy, sw, sh, color); } @@ -2111,51 +2102,42 @@ RFB.encodingHandlers = { return true; }, - TIGHT: function () { + TIGHT() { this._FBU.bytes = 1; // compression-control byte if (this._sock.rQwait("TIGHT compression-control", this._FBU.bytes)) { return false; } - var checksum = function (data) { - var sum = 0; - for (var i = 0; i < data.length; i++) { - sum += data[i]; - if (sum > 65536) sum -= 65536; - } - return sum; - }; - - var resetStreams = 0; - var streamId = -1; - var decompress = function (data, expected) { - for (var i = 0; i < 4; i++) { + let resetStreams = 0; + let streamId = -1; + const decompress = (data, expected) => { + for (let i = 0; i < 4; i++) { if ((resetStreams >> i) & 1) { this._FBU.zlibs[i].reset(); Log.Info("Reset zlib stream " + i); } } - //var uncompressed = this._FBU.zlibs[streamId].uncompress(data, 0); - var uncompressed = this._FBU.zlibs[streamId].inflate(data, true, expected); + //const uncompressed = this._FBU.zlibs[streamId].uncompress(data, 0); + const uncompressed = this._FBU.zlibs[streamId].inflate(data, true, expected); /*if (uncompressed.status !== 0) { Log.Error("Invalid data in zlib stream"); }*/ //return uncompressed.data; return uncompressed; - }.bind(this); + }; - var indexedToRGBX2Color = function (data, palette, width, height) { + const indexedToRGBX2Color = (data, palette, width, height) => { // Convert indexed (palette based) image data to RGB // TODO: reduce number of calculations inside loop - var dest = this._destBuff; - var w = Math.floor((width + 7) / 8); - var w1 = Math.floor(width / 8); + const dest = this._destBuff; + const w = Math.floor((width + 7) / 8); + const w1 = Math.floor(width / 8); - /*for (var y = 0; y < height; y++) { - var b, x, dp, sp; - var yoffset = y * width; - var ybitoffset = y * w; - var xoffset, targetbyte; + /*for (let y = 0; y < height; y++) { + let b, x, dp, sp; + const yoffset = y * width; + const ybitoffset = y * w; + let xoffset, targetbyte; for (x = 0; x < w1; x++) { xoffset = yoffset + x * 8; targetbyte = data[ybitoffset + x]; @@ -2179,8 +2161,8 @@ RFB.encodingHandlers = { } }*/ - for (var y = 0; y < height; y++) { - var b, x, dp, sp; + for (let y = 0; y < height; y++) { + let b, x, dp, sp; for (x = 0; x < w1; x++) { for (b = 7; b >= 0; b--) { dp = (y * width + x * 8 + 7 - b) * 4; @@ -2203,14 +2185,14 @@ RFB.encodingHandlers = { } return dest; - }.bind(this); + }; - var indexedToRGBX = function (data, palette, width, height) { + const indexedToRGBX = (data, palette, width, height) => { // Convert indexed (palette based) image data to RGB - var dest = this._destBuff; - var total = width * height * 4; - for (var i = 0, j = 0; i < total; i += 4, j++) { - var sp = data[j] * 3; + const dest = this._destBuff; + const total = width * height * 4; + for (let i = 0, j = 0; i < total; i += 4, j++) { + const sp = data[j] * 3; dest[i] = palette[sp]; dest[i + 1] = palette[sp + 1]; dest[i + 2] = palette[sp + 2]; @@ -2218,22 +2200,22 @@ RFB.encodingHandlers = { } return dest; - }.bind(this); + }; - var rQi = this._sock.get_rQi(); - var rQ = this._sock.rQwhole(); - var cmode, data; - var cl_header, cl_data; + const rQi = this._sock.get_rQi(); + const rQ = this._sock.rQwhole(); + let cmode, data; + let cl_header, cl_data; - var handlePalette = function () { - var numColors = rQ[rQi + 2] + 1; - var paletteSize = numColors * 3; + const handlePalette = () => { + const numColors = rQ[rQi + 2] + 1; + const paletteSize = numColors * 3; this._FBU.bytes += paletteSize; if (this._sock.rQwait("TIGHT palette " + cmode, this._FBU.bytes)) { return false; } - var bpp = (numColors <= 2) ? 1 : 8; - var rowSize = Math.floor((this._FBU.width * bpp + 7) / 8); - var raw = false; + const bpp = (numColors <= 2) ? 1 : 8; + const rowSize = Math.floor((this._FBU.width * bpp + 7) / 8); + let raw = false; if (rowSize * this._FBU.height < 12) { raw = true; cl_header = 0; @@ -2241,7 +2223,7 @@ RFB.encodingHandlers = { //clength = [0, rowSize * this._FBU.height]; } else { // begin inline getTightCLength (returning two-item arrays is bad for performance with GC) - var cl_offset = rQi + 3 + paletteSize; + const cl_offset = rQi + 3 + paletteSize; cl_header = 1; cl_data = 0; cl_data += rQ[cl_offset] & 0x7f; @@ -2261,7 +2243,7 @@ RFB.encodingHandlers = { // Shift ctl, filter id, num colors, palette entries, and clength off this._sock.rQskipBytes(3); - //var palette = this._sock.rQshiftBytes(paletteSize); + //const palette = this._sock.rQshiftBytes(paletteSize); this._sock.rQshiftTo(this._paletteBuff, paletteSize); this._sock.rQskipBytes(cl_header); @@ -2272,7 +2254,7 @@ RFB.encodingHandlers = { } // Convert indexed (palette based) image data to RGB - var rgbx; + let rgbx; if (numColors == 2) { rgbx = indexedToRGBX2Color(data, this._paletteBuff, this._FBU.width, this._FBU.height); this._display.blitRgbxImage(this._FBU.x, this._FBU.y, this._FBU.width, this._FBU.height, rgbx, 0, false); @@ -2283,18 +2265,18 @@ RFB.encodingHandlers = { return true; - }.bind(this); + }; - var handleCopy = function () { - var raw = false; - var uncompressedSize = this._FBU.width * this._FBU.height * 3; + const handleCopy = () => { + let raw = false; + const uncompressedSize = this._FBU.width * this._FBU.height * 3; if (uncompressedSize < 12) { raw = true; cl_header = 0; cl_data = uncompressedSize; } else { // begin inline getTightCLength (returning two-item arrays is for peformance with GC) - var cl_offset = rQi + 1; + const cl_offset = rQi + 1; cl_header = 1; cl_data = 0; cl_data += rQ[cl_offset] & 0x7f; @@ -2323,9 +2305,9 @@ RFB.encodingHandlers = { this._display.blitRgbImage(this._FBU.x, this._FBU.y, this._FBU.width, this._FBU.height, data, 0, false); return true; - }.bind(this); + }; - var ctl = this._sock.rQpeek8(); + let ctl = this._sock.rQpeek8(); // Keep tight reset bits resetStreams = ctl & 0xF; @@ -2362,6 +2344,7 @@ RFB.encodingHandlers = { if (this._sock.rQwait("TIGHT " + cmode, this._FBU.bytes)) { return false; } + let cl_offset, filterId; // Determine FBU.bytes switch (cmode) { case "fill": @@ -2372,7 +2355,7 @@ RFB.encodingHandlers = { case "png": case "jpeg": // begin inline getTightCLength (returning two-item arrays is for peformance with GC) - var cl_offset = rQi + 1; + cl_offset = rQi + 1; cl_header = 1; cl_data = 0; cl_data += rQ[cl_offset] & 0x7f; @@ -2394,7 +2377,7 @@ RFB.encodingHandlers = { this._display.imageRect(this._FBU.x, this._FBU.y, "image/" + cmode, data); break; case "filter": - var filterId = rQ[rQi + 1]; + filterId = rQ[rQi + 1]; if (filterId === 1) { if (!handlePalette()) { return false; } } else { @@ -2416,16 +2399,16 @@ RFB.encodingHandlers = { return true; }, - last_rect: function () { + last_rect() { this._FBU.rects = 0; return true; }, - ExtendedDesktopSize: function () { + ExtendedDesktopSize() { this._FBU.bytes = 1; if (this._sock.rQwait("ExtendedDesktopSize", this._FBU.bytes)) { return false; } - var firstUpdate = !this._supportsSetDesktopSize; + const firstUpdate = !this._supportsSetDesktopSize; this._supportsSetDesktopSize = true; // Normally we only apply the current resize mode after a @@ -2436,7 +2419,7 @@ RFB.encodingHandlers = { this._requestRemoteResize(); } - var number_of_screens = this._sock.rQpeek8(); + const number_of_screens = this._sock.rQpeek8(); this._FBU.bytes = 4 + (number_of_screens * 16); if (this._sock.rQwait("ExtendedDesktopSize", this._FBU.bytes)) { return false; } @@ -2444,7 +2427,7 @@ RFB.encodingHandlers = { this._sock.rQskipBytes(1); // number-of-screens this._sock.rQskipBytes(3); // padding - for (var i = 0; i < number_of_screens; i += 1) { + for (let i = 0; i < number_of_screens; i += 1) { // Save the id and flags of the first screen if (i === 0) { this._screen_id = this._sock.rQshiftBytes(4); // id @@ -2468,7 +2451,7 @@ RFB.encodingHandlers = { // We need to handle errors when we requested the resize. if (this._FBU.x === 1 && this._FBU.y !== 0) { - var msg = ""; + let msg = ""; // The y-position indicates the status code from the server switch (this._FBU.y) { case 1: @@ -2495,22 +2478,22 @@ RFB.encodingHandlers = { return true; }, - DesktopSize: function () { + DesktopSize() { this._resize(this._FBU.width, this._FBU.height); this._FBU.bytes = 0; this._FBU.rects -= 1; return true; }, - Cursor: function () { + Cursor() { Log.Debug(">> set_cursor"); - var x = this._FBU.x; // hotspot-x - var y = this._FBU.y; // hotspot-y - var w = this._FBU.width; - var h = this._FBU.height; + const x = this._FBU.x; // hotspot-x + const y = this._FBU.y; // hotspot-y + const w = this._FBU.width; + const h = this._FBU.height; - var pixelslength = w * h * 4; - var masklength = Math.floor((w + 7) / 8) * h; + const pixelslength = w * h * 4; + const masklength = Math.floor((w + 7) / 8) * h; this._FBU.bytes = pixelslength + masklength; if (this._sock.rQwait("cursor encoding", this._FBU.bytes)) { return false; } @@ -2526,16 +2509,17 @@ RFB.encodingHandlers = { return true; }, - QEMUExtendedKeyEvent: function () { + QEMUExtendedKeyEvent() { this._FBU.rects--; // Old Safari doesn't support creating keyboard events try { - var keyboardEvent = document.createEvent("keyboardEvent"); + const keyboardEvent = document.createEvent("keyboardEvent"); if (keyboardEvent.code !== undefined) { this._qemuExtKeyEventSupported = true; } } catch (err) { + // Do nothing } }, }; diff --git a/core/util/browsers.js b/core/util/browsers.js index 50f59863..b80eee46 100644 --- a/core/util/browsers.js +++ b/core/util/browsers.js @@ -8,24 +8,48 @@ import * as Log from './logging.js'; +export function isMac() { + return navigator && !!(/mac/i).exec(navigator.platform); +} + +export function isIE() { + return navigator && !!(/trident/i).exec(navigator.userAgent); +} + +export function isEdge() { + return navigator && !!(/edge/i).exec(navigator.userAgent); +} + +export function isWindows() { + return navigator && !!(/win/i).exec(navigator.platform); +} + +export function isIOS() { + return navigator && + (!!(/ipad/i).exec(navigator.platform) || + !!(/iphone/i).exec(navigator.platform) || + !!(/ipod/i).exec(navigator.platform)); +} + // Touch detection -export var isTouchDevice = ('ontouchstart' in document.documentElement) || +export let isTouchDevice = ('ontouchstart' in document.documentElement) || // requried for Chrome debugger (document.ontouchstart !== undefined) || // required for MS Surface (navigator.maxTouchPoints > 0) || (navigator.msMaxTouchPoints > 0); + window.addEventListener('touchstart', function onFirstTouch() { isTouchDevice = true; window.removeEventListener('touchstart', onFirstTouch, false); }, false); -var _cursor_uris_supported = null; +let _cursor_uris_supported = null; export function browserSupportsCursorURIs () { - if (_cursor_uris_supported === null) { + if (_cursor_uris_supported !== null) { try { - var target = document.createElement('canvas'); + const target = document.createElement('canvas'); target.style.cursor = 'url("data:image/x-icon;base64,AAACAAEACAgAAAIAAgA4AQAAFgAAACgAAAAIAAAAEAAAAAEAIAAAAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAD/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////AAAAAAAAAAAAAAAAAAAAAA==") 2 2, default'; if (target.style.cursor) { @@ -42,4 +66,4 @@ export function browserSupportsCursorURIs () { } return _cursor_uris_supported; -}; +} diff --git a/core/util/events.js b/core/util/events.js index c1afb48a..55bcbdc7 100644 --- a/core/util/events.js +++ b/core/util/events.js @@ -10,26 +10,24 @@ * Cross-browser event and position routines */ -import * as Log from './logging.js'; - export function getPointerEvent (e) { return e.changedTouches ? e.changedTouches[0] : e.touches ? e.touches[0] : e; -}; +} export function stopEvent (e) { e.stopPropagation(); e.preventDefault(); -}; +} // Emulate Element.setCapture() when not supported -var _captureRecursion = false; -var _captureElem = null; +let _captureRecursion = false; +let _captureElem = null; function _captureProxy(e) { // Recursion protection as we'll see our own event if (_captureRecursion) return; // Clone the event as we cannot dispatch an already dispatched event - var newEv = new e.constructor(e.type, e); + const newEv = new e.constructor(e.type, e); _captureRecursion = true; _captureElem.dispatchEvent(newEv); @@ -47,16 +45,17 @@ function _captureProxy(e) { if (e.type === "mouseup") { releaseCapture(); } -}; +} // Follow cursor style of target element function _captureElemChanged() { - var captureElem = document.getElementById("noVNC_mouse_capture_elem"); + const captureElem = document.getElementById("noVNC_mouse_capture_elem"); captureElem.style.cursor = window.getComputedStyle(_captureElem).cursor; -}; -var _captureObserver = new MutationObserver(_captureElemChanged); +} -var _captureIndex = 0; +let _captureObserver = new MutationObserver(_captureElemChanged); + +let _captureIndex = 0; export function setCapture (elem) { if (elem.setCapture) { @@ -71,7 +70,7 @@ export function setCapture (elem) { // called multiple times without coordination releaseCapture(); - var captureElem = document.getElementById("noVNC_mouse_capture_elem"); + let captureElem = document.getElementById("noVNC_mouse_capture_elem"); if (captureElem === null) { captureElem = document.createElement("div"); @@ -107,13 +106,11 @@ export function setCapture (elem) { window.addEventListener('mousemove', _captureProxy); window.addEventListener('mouseup', _captureProxy); } -}; +} export function releaseCapture () { if (document.releaseCapture) { - document.releaseCapture(); - } else { if (!_captureElem) { return; @@ -121,7 +118,7 @@ export function releaseCapture () { // There might be events already queued, so we need to wait for // them to flush. E.g. contextmenu in Microsoft Edge - window.setTimeout(function(expected) { + window.setTimeout((expected) => { // Only clear it if it's the expected grab (i.e. no one // else has initiated a new grab) if (_captureIndex === expected) { @@ -131,10 +128,10 @@ export function releaseCapture () { _captureObserver.disconnect(); - var captureElem = document.getElementById("noVNC_mouse_capture_elem"); + const captureElem = document.getElementById("noVNC_mouse_capture_elem"); captureElem.style.display = "none"; window.removeEventListener('mousemove', _captureProxy); window.removeEventListener('mouseup', _captureProxy); } -}; +} diff --git a/core/util/eventtarget.js b/core/util/eventtarget.js index 61bc7a1c..bb8d6e00 100644 --- a/core/util/eventtarget.js +++ b/core/util/eventtarget.js @@ -6,10 +6,12 @@ * See README.md for usage and integration instructions. */ -var EventTargetMixin = { - _listeners: null, +export default class EventTargetMixin { + constructor() { + this._listeners = null; + } - addEventListener: function(type, callback) { + addEventListener(type, callback) { if (!this._listeners) { this._listeners = new Map(); } @@ -17,24 +19,22 @@ var EventTargetMixin = { this._listeners.set(type, new Set()); } this._listeners.get(type).add(callback); - }, + } - removeEventListener: function(type, callback) { + removeEventListener(type, callback) { if (!this._listeners || !this._listeners.has(type)) { return; } this._listeners.get(type).delete(callback); - }, + } - dispatchEvent: function(event) { + dispatchEvent(event) { if (!this._listeners || !this._listeners.has(event.type)) { return true; } - this._listeners.get(event.type).forEach(function (callback) { + this._listeners.get(event.type).forEach((callback) => { callback.call(this, event); }, this); return !event.defaultPrevented; - }, -}; - -export default EventTargetMixin; + } +} diff --git a/core/util/logging.js b/core/util/logging.js index 342bfa7c..c1c1a9b7 100644 --- a/core/util/logging.js +++ b/core/util/logging.js @@ -10,12 +10,12 @@ * Logging/debug routines */ -var _log_level = 'warn'; +let _log_level = 'warn'; -var Debug = function (msg) {}; -var Info = function (msg) {}; -var Warn = function (msg) {}; -var Error = function (msg) {}; +let Debug = () => {}; +let Info = () => {}; +let Warn = () => {}; +let Error = () => {}; export function init_logging (level) { if (typeof level === 'undefined') { @@ -24,9 +24,9 @@ export function init_logging (level) { _log_level = level; } - Debug = Info = Warn = Error = function (msg) {}; + Debug = Info = Warn = Error = () => {}; if (typeof window.console !== "undefined") { - /* jshint -W086 */ + /* eslint-disable no-fallthrough, no-console */ switch (level) { case 'debug': Debug = console.debug.bind(window.console); @@ -41,12 +41,14 @@ export function init_logging (level) { default: throw new Error("invalid logging type '" + level + "'"); } - /* jshint +W086 */ + /* eslint-enable no-fallthrough, no-console */ } -}; +} + export function get_logging () { return _log_level; -}; +} + export { Debug, Info, Warn, Error }; // Initialize logging level diff --git a/core/util/polyfill.js b/core/util/polyfill.js index 8c600e6f..d8fc430c 100644 --- a/core/util/polyfill.js +++ b/core/util/polyfill.js @@ -10,19 +10,18 @@ if (typeof Object.assign != 'function') { // Must be writable: true, enumerable: false, configurable: true Object.defineProperty(Object, "assign", { - value: function assign(target, varArgs) { // .length of function is 2 - 'use strict'; + value(target) { // .length of function is 2 if (target == null) { // TypeError if undefined or null throw new TypeError('Cannot convert undefined or null to object'); } - var to = Object(target); + const to = Object(target); - for (var index = 1; index < arguments.length; index++) { - var nextSource = arguments[index]; + for (let index = 1; index < arguments.length; index++) { + const nextSource = arguments[index]; if (nextSource != null) { // Skip over if undefined or null - for (var nextKey in nextSource) { + for (let nextKey in nextSource) { // Avoid bugs when hasOwnProperty is shadowed if (Object.prototype.hasOwnProperty.call(nextSource, nextKey)) { to[nextKey] = nextSource[nextKey]; @@ -38,17 +37,17 @@ if (typeof Object.assign != 'function') { } /* CustomEvent constructor (taken from MDN) */ -(function () { - function CustomEvent ( event, params ) { +(() => { + function CustomEvent( event, params ) { params = params || { bubbles: false, cancelable: false, detail: undefined }; - var evt = document.createEvent( 'CustomEvent' ); + const evt = document.createEvent( 'CustomEvent' ); evt.initCustomEvent( event, params.bubbles, params.cancelable, params.detail ); return evt; } CustomEvent.prototype = window.Event.prototype; - if (typeof window.CustomEvent !== "function") { + if (typeof window.CustomEvent !== 'function') { window.CustomEvent = CustomEvent; } })(); diff --git a/core/util/strings.js b/core/util/strings.js index 00a6156c..b3de5476 100644 --- a/core/util/strings.js +++ b/core/util/strings.js @@ -10,6 +10,5 @@ * Decode from UTF-8 */ export function decodeUTF8 (utf8string) { - "use strict"; return decodeURIComponent(escape(utf8string)); -}; +} diff --git a/core/websock.js b/core/websock.js index 03909bca..26dde1a9 100644 --- a/core/websock.js +++ b/core/websock.js @@ -14,207 +14,199 @@ import * as Log from './util/logging.js'; -/*jslint browser: true, bitwise: true */ -/*global Util*/ - -export default function Websock() { - "use strict"; - - this._websocket = null; // WebSocket object - - this._rQi = 0; // Receive queue index - this._rQlen = 0; // Next write position in the receive queue - this._rQbufferSize = 1024 * 1024 * 4; // Receive queue buffer size (4 MiB) - this._rQmax = this._rQbufferSize / 8; - // called in init: this._rQ = new Uint8Array(this._rQbufferSize); - this._rQ = null; // Receive queue - - this._sQbufferSize = 1024 * 10; // 10 KiB - // called in init: this._sQ = new Uint8Array(this._sQbufferSize); - this._sQlen = 0; - this._sQ = null; // Send queue - - this._eventHandlers = { - 'message': function () {}, - 'open': function () {}, - 'close': function () {}, - 'error': function () {} - }; -}; - // this has performance issues in some versions Chromium, and // doesn't gain a tremendous amount of performance increase in Firefox // at the moment. It may be valuable to turn it on in the future. -var ENABLE_COPYWITHIN = false; +const ENABLE_COPYWITHIN = false; -var MAX_RQ_GROW_SIZE = 40 * 1024 * 1024; // 40 MiB +const MAX_RQ_GROW_SIZE = 40 * 1024 * 1024; // 40 MiB -var typedArrayToString = (function () { +const typedArrayToString = (() => { // This is only for PhantomJS, which doesn't like apply-ing // with Typed Arrays try { - var arr = new Uint8Array([1, 2, 3]); + const arr = new Uint8Array([1, 2, 3]); String.fromCharCode.apply(null, arr); - return function (a) { return String.fromCharCode.apply(null, a); }; + return (a) => String.fromCharCode.apply(null, a); } catch (ex) { - return function (a) { - return String.fromCharCode.apply( + return (a) => + String.fromCharCode.apply( null, Array.prototype.slice.call(a)); - }; } })(); -Websock.prototype = { +export default class Websock { + constructor() { + this._websocket = null; // WebSocket object + + this._rQi = 0; // Receive queue index + this._rQlen = 0; // Next write position in the receive queue + this._rQbufferSize = 1024 * 1024 * 4; // Receive queue buffer size (4 MiB) + this._rQmax = this._rQbufferSize / 8; + // called in init: this._rQ = new Uint8Array(this._rQbufferSize); + this._rQ = null; // Receive queue + + this._sQbufferSize = 1024 * 10; // 10 KiB + // called in init: this._sQ = new Uint8Array(this._sQbufferSize); + this._sQlen = 0; + this._sQ = null; // Send queue + + this._eventHandlers = { + 'message'() {}, + 'open'() {}, + 'close'() {}, + 'error'() {} + }; + } + // Getters and Setters - get_sQ: function () { + get_sQ() { return this._sQ; - }, + } - get_rQ: function () { + get_rQ() { return this._rQ; - }, + } - get_rQi: function () { + get_rQi() { return this._rQi; - }, + } - set_rQi: function (val) { + set_rQi(val) { this._rQi = val; - }, + } // Receive Queue - rQlen: function () { + rQlen() { return this._rQlen - this._rQi; - }, + } - rQpeek8: function () { + rQpeek8() { return this._rQ[this._rQi]; - }, + } - rQshift8: function () { + rQshift8() { return this._rQ[this._rQi++]; - }, + } - rQskip8: function () { + rQskip8() { this._rQi++; - }, + } - rQskipBytes: function (num) { + rQskipBytes(num) { this._rQi += num; - }, + } // TODO(directxman12): test performance with these vs a DataView - rQshift16: function () { + rQshift16() { return (this._rQ[this._rQi++] << 8) + this._rQ[this._rQi++]; - }, + } - rQshift32: function () { + rQshift32() { return (this._rQ[this._rQi++] << 24) + (this._rQ[this._rQi++] << 16) + (this._rQ[this._rQi++] << 8) + this._rQ[this._rQi++]; - }, + } - rQshiftStr: function (len) { + rQshiftStr(len) { if (typeof(len) === 'undefined') { len = this.rQlen(); } - var arr = new Uint8Array(this._rQ.buffer, this._rQi, len); + const arr = new Uint8Array(this._rQ.buffer, this._rQi, len); this._rQi += len; return typedArrayToString(arr); - }, + } - rQshiftBytes: function (len) { + rQshiftBytes(len) { if (typeof(len) === 'undefined') { len = this.rQlen(); } this._rQi += len; return new Uint8Array(this._rQ.buffer, this._rQi - len, len); - }, + } - rQshiftTo: function (target, len) { + rQshiftTo(target, len) { if (len === undefined) { len = this.rQlen(); } // TODO: make this just use set with views when using a ArrayBuffer to store the rQ target.set(new Uint8Array(this._rQ.buffer, this._rQi, len)); this._rQi += len; - }, + } - rQwhole: function () { + rQwhole() { return new Uint8Array(this._rQ.buffer, 0, this._rQlen); - }, + } - rQslice: function (start, end) { + rQslice(start, end) { if (end) { return new Uint8Array(this._rQ.buffer, this._rQi + start, end - start); } else { return new Uint8Array(this._rQ.buffer, this._rQi + start, this._rQlen - this._rQi - start); } - }, + } // Check to see if we must wait for 'num' bytes (default to FBU.bytes) // to be available in the receive queue. Return true if we need to // wait (and possibly print a debug message), otherwise false. - rQwait: function (msg, num, goback) { - var rQlen = this._rQlen - this._rQi; // Skip rQlen() function call - if (rQlen < num) { - if (goback) { - if (this._rQi < goback) { - throw new Error("rQwait cannot backup " + goback + " bytes"); - } - this._rQi -= goback; - } - return true; // true means need more data + rQwait(msg, num, goback) { + const rQlen = this._rQlen - this._rQi; // Skip rQlen() function call + if (rQlen >= num) { + return false; } - return false; - }, + + if (goback) { + if (this._rQi < goback) { + throw new Error("rQwait cannot backup " + goback + " bytes"); + } + this._rQi -= goback; + } + return true; // true means need more data + } // Send Queue - flush: function () { + flush() { if (this._sQlen > 0 && this._websocket.readyState === WebSocket.OPEN) { this._websocket.send(this._encode_message()); this._sQlen = 0; } - }, + } - send: function (arr) { + send(arr) { this._sQ.set(arr, this._sQlen); this._sQlen += arr.length; this.flush(); - }, + } - send_string: function (str) { - this.send(str.split('').map(function (chr) { - return chr.charCodeAt(0); - })); - }, + send_string(str) { + this.send(str.split('').map(chr => chr.charCodeAt(0))); + } // Event Handlers - off: function (evt) { - this._eventHandlers[evt] = function () {}; - }, + off(evt) { + this._eventHandlers[evt] = () => {}; + } - on: function (evt, handler) { + on(evt, handler) { this._eventHandlers[evt] = handler; - }, + } - _allocate_buffers: function () { + _allocate_buffers() { this._rQ = new Uint8Array(this._rQbufferSize); this._sQ = new Uint8Array(this._sQbufferSize); - }, + } - init: function () { + init() { this._allocate_buffers(); this._rQi = 0; this._websocket = null; - }, + } - open: function (uri, protocols) { - var ws_schema = uri.match(/^([a-z]+):\/\//)[1]; + open(uri, protocols) { this.init(); this._websocket = new WebSocket(uri, protocols); this._websocket.binaryType = 'arraybuffer'; this._websocket.onmessage = this._recv_message.bind(this); - this._websocket.onopen = (function () { + this._websocket.onopen = () => { Log.Debug('>> WebSock.onopen'); if (this._websocket.protocol) { Log.Info("Server choose sub-protocol: " + this._websocket.protocol); @@ -222,20 +214,20 @@ Websock.prototype = { this._eventHandlers.open(); Log.Debug("<< WebSock.onopen"); - }).bind(this); - this._websocket.onclose = (function (e) { + }; + this._websocket.onclose = (e) => { Log.Debug(">> WebSock.onclose"); this._eventHandlers.close(e); Log.Debug("<< WebSock.onclose"); - }).bind(this); - this._websocket.onerror = (function (e) { + }; + this._websocket.onerror = (e) => { Log.Debug(">> WebSock.onerror: " + e); this._eventHandlers.error(e); Log.Debug("<< WebSock.onerror: " + e); - }).bind(this); - }, + }; + } - close: function () { + close() { if (this._websocket) { if ((this._websocket.readyState === WebSocket.OPEN) || (this._websocket.readyState === WebSocket.CONNECTING)) { @@ -243,19 +235,19 @@ Websock.prototype = { this._websocket.close(); } - this._websocket.onmessage = function (e) { return; }; + this._websocket.onmessage = () => {}; } - }, + } // private methods - _encode_message: function () { + _encode_message() { // Put in a binary arraybuffer // according to the spec, you can send ArrayBufferViews with the send method return new Uint8Array(this._sQ.buffer, 0, this._sQlen); - }, + } - _expand_compact_rQ: function (min_fit) { - var resizeNeeded = min_fit || this._rQlen - this._rQi > this._rQbufferSize / 2; + _expand_compact_rQ(min_fit) { + const resizeNeeded = min_fit || this._rQlen - this._rQi > this._rQbufferSize / 2; if (resizeNeeded) { if (!min_fit) { // just double the size if we need to do compaction @@ -270,12 +262,12 @@ Websock.prototype = { if (this._rQbufferSize > MAX_RQ_GROW_SIZE) { this._rQbufferSize = MAX_RQ_GROW_SIZE; if (this._rQbufferSize - this._rQlen - this._rQi < min_fit) { - throw new Exception("Receive Queue buffer exceeded " + MAX_RQ_GROW_SIZE + " bytes, and the new message could not fit"); + throw new Error("Receive Queue buffer exceeded " + MAX_RQ_GROW_SIZE + " bytes, and the new message could not fit"); } } if (resizeNeeded) { - var old_rQbuffer = this._rQ.buffer; + const old_rQbuffer = this._rQ.buffer; this._rQmax = this._rQbufferSize / 8; this._rQ = new Uint8Array(this._rQbufferSize); this._rQ.set(new Uint8Array(old_rQbuffer, this._rQi)); @@ -289,31 +281,32 @@ Websock.prototype = { this._rQlen = this._rQlen - this._rQi; this._rQi = 0; - }, + } - _decode_message: function (data) { + _decode_message(data) { // push arraybuffer values onto the end - var u8 = new Uint8Array(data); + const u8 = new Uint8Array(data); if (u8.length > this._rQbufferSize - this._rQlen) { this._expand_compact_rQ(u8.length); } this._rQ.set(u8, this._rQlen); this._rQlen += u8.length; - }, + } - _recv_message: function (e) { + _recv_message(e) { this._decode_message(e.data); - if (this.rQlen() > 0) { - this._eventHandlers.message(); - // Compact the receive queue - if (this._rQlen == this._rQi) { - this._rQlen = 0; - this._rQi = 0; - } else if (this._rQlen > this._rQmax) { - this._expand_compact_rQ(); - } - } else { + if (this.rQlen() <= 0) { Log.Debug("Ignoring empty message"); + return; + } + + this._eventHandlers.message(); + // Compact the receive queue + if (this._rQlen == this._rQi) { + this._rQlen = 0; + this._rQi = 0; + } else if (this._rQlen > this._rQmax) { + this._expand_compact_rQ(); } } -}; +} diff --git a/docs/API.md b/docs/API.md index c5923e3f..4448a3ce 100644 --- a/docs/API.md +++ b/docs/API.md @@ -137,7 +137,7 @@ connection to a specified VNC server. ##### Syntax - var rfb = new RFB( target, url [, options] ); + const rfb = new RFB( target, url [, options] ); ###### Parameters diff --git a/karma.conf.js b/karma.conf.js index 10bf372a..c77b0d9a 100644 --- a/karma.conf.js +++ b/karma.conf.js @@ -1,9 +1,9 @@ // Karma configuration module.exports = function(config) { - var customLaunchers = {}; - var browsers = []; - var useSauce = false; + const customLaunchers = {}; + let browsers = []; + let useSauce = false; // use Sauce when running on Travis if (process.env.TRAVIS_JOB_NUMBER) { @@ -11,22 +11,18 @@ module.exports = function(config) { } if (useSauce && process.env.TEST_BROWSER_NAME && process.env.TEST_BROWSER_NAME != 'PhantomJS') { - var names = process.env.TEST_BROWSER_NAME.split(','); - var platforms = process.env.TEST_BROWSER_OS.split(','); - var versions = []; - if (process.env.TEST_BROWSER_VERSION) { - versions = process.env.TEST_BROWSER_VERSION.split(','); - } else { - versions = [null]; - } + const names = process.env.TEST_BROWSER_NAME.split(','); + const platforms = process.env.TEST_BROWSER_OS.split(','); + const versions = process.env.TEST_BROWSER_VERSION + ? process.env.TEST_BROWSER_VERSION.split(',') + : [null]; - for (var i = 0; i < names.length; i++) { - for (var j = 0; j < platforms.length; j++) { - for (var k = 0; k < versions.length; k++) { - var launcher_name = 'sl_' + platforms[j].replace(/[^a-zA-Z0-9]/g, '') + '_' + names[i]; - if (versions[k]) { - launcher_name += '_' + versions[k]; - } + for (let i = 0; i < names.length; i++) { + for (let j = 0; j < platforms.length; j++) { + for (let k = 0; k < versions.length; k++) { + const launcher_name = versions[k] + ? '_' + versions[k] + : 'sl_' + platforms[j].replace(/[^a-zA-Z0-9]/g, '') + '_' + names[i]; customLaunchers[launcher_name] = { base: 'SauceLabs', @@ -48,7 +44,7 @@ module.exports = function(config) { browsers = []; } - var my_conf = { + const my_conf = { // base path that will be used to resolve all patterns (eg. files, exclude) basePath: '', diff --git a/package-lock.json b/package-lock.json new file mode 100644 index 00000000..ef56a931 --- /dev/null +++ b/package-lock.json @@ -0,0 +1,6634 @@ +{ + "name": "@novnc/novnc", + "version": "1.0.0-testing.2", + "lockfileVersion": 1, + "requires": true, + "dependencies": { + "JSONStream": { + "version": "1.3.2", + "resolved": "https://registry.npmjs.org/JSONStream/-/JSONStream-1.3.2.tgz", + "integrity": "sha1-wQI3G27Dp887hHygDCC7D85Mbeo=", + "dev": true, + "requires": { + "jsonparse": "1.3.1", + "through": "2.3.8" + } + }, + "abab": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/abab/-/abab-1.0.4.tgz", + "integrity": "sha1-X6rZwsB/YN12dw9xzwJbYqY8/U4=", + "dev": true + }, + "accepts": { + "version": "1.3.3", + "resolved": "https://registry.npmjs.org/accepts/-/accepts-1.3.3.tgz", + "integrity": "sha1-w8p0NJOGSMPg2cHjKN1otiLChMo=", + "dev": true, + "requires": { + "mime-types": "2.1.17", + "negotiator": "0.6.1" + } + }, + "acorn": { + "version": "4.0.13", + "resolved": "https://registry.npmjs.org/acorn/-/acorn-4.0.13.tgz", + "integrity": "sha1-EFSVrlNh1pe9GVyCUZLhrX8lN4c=", + "dev": true + }, + "acorn-globals": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/acorn-globals/-/acorn-globals-4.1.0.tgz", + "integrity": "sha512-KjZwU26uG3u6eZcfGbTULzFcsoz6pegNKtHPksZPOUsiKo5bUmiBPa38FuHZ/Eun+XYh/JCCkS9AS3Lu4McQOQ==", + "dev": true, + "requires": { + "acorn": "5.3.0" + }, + "dependencies": { + "acorn": { + "version": "5.3.0", + "resolved": "https://registry.npmjs.org/acorn/-/acorn-5.3.0.tgz", + "integrity": "sha512-Yej+zOJ1Dm/IMZzzj78OntP/r3zHEaKcyNoU2lAaxPtrseM6rF0xwqoz5Q5ysAiED9hTjI2hgtvLXitlCN1/Ug==", + "dev": 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, + "requires": { + "acorn": "3.3.0" + }, + "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 + } + } + }, + "adm-zip": { + "version": "0.4.7", + "resolved": "https://registry.npmjs.org/adm-zip/-/adm-zip-0.4.7.tgz", + "integrity": "sha1-hgbCy/HEJs6MjsABdER/1Jtur8E=", + "dev": true + }, + "after": { + "version": "0.8.2", + "resolved": "https://registry.npmjs.org/after/-/after-0.8.2.tgz", + "integrity": "sha1-/ts5T58OAqqXaOcCvaI7UF+ufh8=", + "dev": true + }, + "agent-base": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/agent-base/-/agent-base-2.1.1.tgz", + "integrity": "sha1-1t4Q1a9hMtW9aSQn1G/FOFOQlMc=", + "dev": true, + "requires": { + "extend": "3.0.1", + "semver": "5.0.3" + }, + "dependencies": { + "semver": { + "version": "5.0.3", + "resolved": "https://registry.npmjs.org/semver/-/semver-5.0.3.tgz", + "integrity": "sha1-d0Zt5YnNXTyV8TiqeLxWmjy10no=", + "dev": true + } + } + }, + "ajv": { + "version": "5.5.2", + "resolved": "https://registry.npmjs.org/ajv/-/ajv-5.5.2.tgz", + "integrity": "sha1-c7Xuyj+rZT49P5Qis0GtQiBdyWU=", + "dev": true, + "requires": { + "co": "4.6.0", + "fast-deep-equal": "1.0.0", + "fast-json-stable-stringify": "2.0.0", + "json-schema-traverse": "0.3.1" + } + }, + "ajv-keywords": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/ajv-keywords/-/ajv-keywords-2.1.1.tgz", + "integrity": "sha1-YXmX/F9gV2iUxDX5QNgZ4TW4B2I=", + "dev": true + }, + "ansi-escapes": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/ansi-escapes/-/ansi-escapes-3.0.0.tgz", + "integrity": "sha512-O/klc27mWNUigtv0F8NJWbLF00OcegQalkqKURWdosW08YZKi4m6CnSUSvIZG1otNJbTWhN01Hhz389DW7mvDQ==", + "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 + }, + "anymatch": { + "version": "1.3.2", + "resolved": "https://registry.npmjs.org/anymatch/-/anymatch-1.3.2.tgz", + "integrity": "sha512-0XNayC8lTHQ2OI8aljNCN3sSx6hsr/1+rlcDAotXJR7C1oZZHCNsfpbKwMjRA3Uqb5tF1Rae2oloTr4xpq+WjA==", + "dev": true, + "requires": { + "micromatch": "2.3.11", + "normalize-path": "2.1.1" + } + }, + "archiver": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/archiver/-/archiver-1.3.0.tgz", + "integrity": "sha1-TyGU1tj5nfP1MeaIHxTxXVX6ryI=", + "dev": true, + "requires": { + "archiver-utils": "1.3.0", + "async": "2.6.0", + "buffer-crc32": "0.2.13", + "glob": "7.1.2", + "lodash": "4.17.4", + "readable-stream": "2.3.3", + "tar-stream": "1.5.5", + "walkdir": "0.0.11", + "zip-stream": "1.2.0" + } + }, + "archiver-utils": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/archiver-utils/-/archiver-utils-1.3.0.tgz", + "integrity": "sha1-5QtMCccL89aA4y/xt5lOn52JUXQ=", + "dev": true, + "requires": { + "glob": "7.1.2", + "graceful-fs": "4.1.11", + "lazystream": "1.0.0", + "lodash": "4.17.4", + "normalize-path": "2.1.1", + "readable-stream": "2.3.3" + } + }, + "argparse": { + "version": "1.0.9", + "resolved": "https://registry.npmjs.org/argparse/-/argparse-1.0.9.tgz", + "integrity": "sha1-c9g7wmP4bpf4zE9rrhsOkKfSLIY=", + "dev": true, + "requires": { + "sprintf-js": "1.0.3" + }, + "dependencies": { + "sprintf-js": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/sprintf-js/-/sprintf-js-1.0.3.tgz", + "integrity": "sha1-BOaSb2YolTVPPdAVIDYzuFcpfiw=", + "dev": true + } + } + }, + "arr-diff": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/arr-diff/-/arr-diff-2.0.0.tgz", + "integrity": "sha1-jzuCf5Vai9ZpaX5KQlasPOrjVs8=", + "dev": true, + "requires": { + "arr-flatten": "1.1.0" + } + }, + "arr-flatten": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/arr-flatten/-/arr-flatten-1.1.0.tgz", + "integrity": "sha512-L3hKV5R/p5o81R7O02IGnwpDmkp6E982XhtbuwSe3O4qOtMMMtodicASA1Cny2U+aCXcNpml+m4dPsvsJ3jatg==", + "dev": true + }, + "array-equal": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/array-equal/-/array-equal-1.0.0.tgz", + "integrity": "sha1-jCpe8kcv2ep0KwTHenUJO6J1fJM=", + "dev": true + }, + "array-filter": { + "version": "0.0.1", + "resolved": "https://registry.npmjs.org/array-filter/-/array-filter-0.0.1.tgz", + "integrity": "sha1-fajPLiZijtcygDWB/SH2fKzS7uw=", + "dev": true + }, + "array-map": { + "version": "0.0.0", + "resolved": "https://registry.npmjs.org/array-map/-/array-map-0.0.0.tgz", + "integrity": "sha1-iKK6tz0c97zVwbEYoAP2b2ZfpmI=", + "dev": true + }, + "array-reduce": { + "version": "0.0.0", + "resolved": "https://registry.npmjs.org/array-reduce/-/array-reduce-0.0.0.tgz", + "integrity": "sha1-FziZ0//Rx9k4PkR5Ul2+J4yrXys=", + "dev": true + }, + "array-slice": { + "version": "0.2.3", + "resolved": "https://registry.npmjs.org/array-slice/-/array-slice-0.2.3.tgz", + "integrity": "sha1-3Tz7gO15c6dRF82sabC5nshhhvU=", + "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, + "requires": { + "array-uniq": "1.0.3" + } + }, + "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 + }, + "array-unique": { + "version": "0.2.1", + "resolved": "https://registry.npmjs.org/array-unique/-/array-unique-0.2.1.tgz", + "integrity": "sha1-odl8yvy8JiXMcPrc6zalDFiwGlM=", + "dev": true + }, + "arraybuffer.slice": { + "version": "0.0.6", + "resolved": "https://registry.npmjs.org/arraybuffer.slice/-/arraybuffer.slice-0.0.6.tgz", + "integrity": "sha1-8zshWfBTKj8xB6JywMz70a0peco=", + "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 + }, + "asn1.js": { + "version": "4.9.2", + "resolved": "https://registry.npmjs.org/asn1.js/-/asn1.js-4.9.2.tgz", + "integrity": "sha512-b/OsSjvWEo8Pi8H0zsDd2P6Uqo2TK2pH8gNLSJtNLM2Db0v2QaAZ0pBQJXVjAn4gBuugeVDr7s63ZogpUIwWDg==", + "dev": true, + "requires": { + "bn.js": "4.11.8", + "inherits": "2.0.3", + "minimalistic-assert": "1.0.0" + } + }, + "assert": { + "version": "1.4.1", + "resolved": "https://registry.npmjs.org/assert/-/assert-1.4.1.tgz", + "integrity": "sha1-mZEtWRg2tab1s0XA8H7vwI/GXZE=", + "dev": true, + "requires": { + "util": "0.10.3" + } + }, + "assert-plus": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/assert-plus/-/assert-plus-1.0.0.tgz", + "integrity": "sha1-8S4PPF13sLHN2RRpQuTpbB5N1SU=", + "dev": true + }, + "assertion-error": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/assertion-error/-/assertion-error-1.1.0.tgz", + "integrity": "sha512-jgsaNduz+ndvGyFt3uSuWqvy4lCnIJiovtouQN5JZHOKCS2QuhEdbcQHFhVksz2N2U9hXJo8odG7ETyWlEeuDw==", + "dev": true + }, + "astw": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/astw/-/astw-2.2.0.tgz", + "integrity": "sha1-e9QXhNMkk5h66yOba04cV6hzuRc=", + "dev": true, + "requires": { + "acorn": "4.0.13" + } + }, + "async": { + "version": "2.6.0", + "resolved": "https://registry.npmjs.org/async/-/async-2.6.0.tgz", + "integrity": "sha512-xAfGg1/NTLBBKlHFmnd7PlmUW9KhVQIUuSrYem9xzFUZy13ScvtyGGejaae9iAVRiRq9+Cx7DPFaAAhCpyxyPw==", + "dev": true, + "requires": { + "lodash": "4.17.4" + } + }, + "async-each": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/async-each/-/async-each-1.0.1.tgz", + "integrity": "sha1-GdOGodntxufByF04iu28xW0zYC0=", + "dev": true + }, + "async-limiter": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/async-limiter/-/async-limiter-1.0.0.tgz", + "integrity": "sha512-jp/uFnooOiO+L211eZOoSyzpOITMXx1rBITauYykG3BRYPu8h0UcxsPNB04RR5vo4Tyz3+ay17tR6JVf9qzYWg==", + "dev": true + }, + "asynckit": { + "version": "0.4.0", + "resolved": "https://registry.npmjs.org/asynckit/-/asynckit-0.4.0.tgz", + "integrity": "sha1-x57Zf380y48robyXkLzDZkdLS3k=", + "dev": true + }, + "aws-sign2": { + "version": "0.7.0", + "resolved": "https://registry.npmjs.org/aws-sign2/-/aws-sign2-0.7.0.tgz", + "integrity": "sha1-tG6JCTSpWR8tL2+G1+ap8bP+dqg=", + "dev": true + }, + "aws4": { + "version": "1.6.0", + "resolved": "https://registry.npmjs.org/aws4/-/aws4-1.6.0.tgz", + "integrity": "sha1-g+9cqGCysy5KDe7e6MdxudtXRx4=", + "dev": true + }, + "babel-code-frame": { + "version": "6.26.0", + "resolved": "https://registry.npmjs.org/babel-code-frame/-/babel-code-frame-6.26.0.tgz", + "integrity": "sha1-Y/1D99weO7fONZR9uP42mj9Yx0s=", + "dev": true, + "requires": { + "chalk": "1.1.3", + "esutils": "2.0.2", + "js-tokens": "3.0.2" + } + }, + "babel-core": { + "version": "6.26.0", + "resolved": "https://registry.npmjs.org/babel-core/-/babel-core-6.26.0.tgz", + "integrity": "sha1-rzL3izGm/O8RnIew/Y2XU/A6C7g=", + "dev": true, + "requires": { + "babel-code-frame": "6.26.0", + "babel-generator": "6.26.0", + "babel-helpers": "6.24.1", + "babel-messages": "6.23.0", + "babel-register": "6.26.0", + "babel-runtime": "6.26.0", + "babel-template": "6.26.0", + "babel-traverse": "6.26.0", + "babel-types": "6.26.0", + "babylon": "6.18.0", + "convert-source-map": "1.5.1", + "debug": "2.6.9", + "json5": "0.5.1", + "lodash": "4.17.4", + "minimatch": "3.0.4", + "path-is-absolute": "1.0.1", + "private": "0.1.8", + "slash": "1.0.0", + "source-map": "0.5.7" + } + }, + "babel-generator": { + "version": "6.26.0", + "resolved": "https://registry.npmjs.org/babel-generator/-/babel-generator-6.26.0.tgz", + "integrity": "sha1-rBriAHC3n248odMmlhMFN3TyDcU=", + "dev": true, + "requires": { + "babel-messages": "6.23.0", + "babel-runtime": "6.26.0", + "babel-types": "6.26.0", + "detect-indent": "4.0.0", + "jsesc": "1.3.0", + "lodash": "4.17.4", + "source-map": "0.5.7", + "trim-right": "1.0.1" + } + }, + "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, + "requires": { + "babel-runtime": "6.26.0", + "babel-types": "6.26.0" + } + }, + "babel-helpers": { + "version": "6.24.1", + "resolved": "https://registry.npmjs.org/babel-helpers/-/babel-helpers-6.24.1.tgz", + "integrity": "sha1-NHHenK7DiOXIUOWX5Yom3fN2ArI=", + "dev": true, + "requires": { + "babel-runtime": "6.26.0", + "babel-template": "6.26.0" + } + }, + "babel-messages": { + "version": "6.23.0", + "resolved": "https://registry.npmjs.org/babel-messages/-/babel-messages-6.23.0.tgz", + "integrity": "sha1-8830cDhYA1sqKVHG7F7fbGLyYw4=", + "dev": true, + "requires": { + "babel-runtime": "6.26.0" + } + }, + "babel-plugin-add-module-exports": { + "version": "0.2.1", + "resolved": "https://registry.npmjs.org/babel-plugin-add-module-exports/-/babel-plugin-add-module-exports-0.2.1.tgz", + "integrity": "sha1-mumh9KjcZ/DN7E9K7aHkOl/2XiU=", + "dev": true + }, + "babel-plugin-import-redirect": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/babel-plugin-import-redirect/-/babel-plugin-import-redirect-1.1.0.tgz", + "integrity": "sha1-uDbL3r0ifgG4EfVgsZfagw4wGyY=", + "dev": true, + "requires": { + "babylon": "6.18.0", + "resolve": "1.5.0" + } + }, + "babel-plugin-syntax-dynamic-import": { + "version": "6.18.0", + "resolved": "https://registry.npmjs.org/babel-plugin-syntax-dynamic-import/-/babel-plugin-syntax-dynamic-import-6.18.0.tgz", + "integrity": "sha1-jWomIpyDdFqZgqRBBRVyyqF5sdo=", + "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, + "requires": { + "babel-plugin-transform-es2015-modules-commonjs": "6.26.0", + "babel-runtime": "6.26.0", + "babel-template": "6.26.0" + } + }, + "babel-plugin-transform-es2015-modules-commonjs": { + "version": "6.26.0", + "resolved": "https://registry.npmjs.org/babel-plugin-transform-es2015-modules-commonjs/-/babel-plugin-transform-es2015-modules-commonjs-6.26.0.tgz", + "integrity": "sha1-DYOUApt9xqvhqX7xgeAHWN0uXYo=", + "dev": true, + "requires": { + "babel-plugin-transform-strict-mode": "6.24.1", + "babel-runtime": "6.26.0", + "babel-template": "6.26.0", + "babel-types": "6.26.0" + } + }, + "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, + "requires": { + "babel-helper-hoist-variables": "6.24.1", + "babel-runtime": "6.26.0", + "babel-template": "6.26.0" + } + }, + "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, + "requires": { + "babel-plugin-transform-es2015-modules-amd": "6.24.1", + "babel-runtime": "6.26.0", + "babel-template": "6.26.0" + } + }, + "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, + "requires": { + "babel-runtime": "6.26.0", + "babel-types": "6.26.0" + } + }, + "babel-register": { + "version": "6.26.0", + "resolved": "https://registry.npmjs.org/babel-register/-/babel-register-6.26.0.tgz", + "integrity": "sha1-btAhFz4vy0htestFxgCahW9kcHE=", + "dev": true, + "requires": { + "babel-core": "6.26.0", + "babel-runtime": "6.26.0", + "core-js": "2.5.3", + "home-or-tmp": "2.0.0", + "lodash": "4.17.4", + "mkdirp": "0.5.1", + "source-map-support": "0.4.18" + } + }, + "babel-runtime": { + "version": "6.26.0", + "resolved": "https://registry.npmjs.org/babel-runtime/-/babel-runtime-6.26.0.tgz", + "integrity": "sha1-llxwWGaOgrVde/4E/yM3vItWR/4=", + "dev": true, + "requires": { + "core-js": "2.5.3", + "regenerator-runtime": "0.11.1" + } + }, + "babel-template": { + "version": "6.26.0", + "resolved": "https://registry.npmjs.org/babel-template/-/babel-template-6.26.0.tgz", + "integrity": "sha1-3gPi0WOWsGn0bdn/+FIfsaDjXgI=", + "dev": true, + "requires": { + "babel-runtime": "6.26.0", + "babel-traverse": "6.26.0", + "babel-types": "6.26.0", + "babylon": "6.18.0", + "lodash": "4.17.4" + } + }, + "babel-traverse": { + "version": "6.26.0", + "resolved": "https://registry.npmjs.org/babel-traverse/-/babel-traverse-6.26.0.tgz", + "integrity": "sha1-RqnL1+3MYsjlwGTi0tjQ9ANXZu4=", + "dev": true, + "requires": { + "babel-code-frame": "6.26.0", + "babel-messages": "6.23.0", + "babel-runtime": "6.26.0", + "babel-types": "6.26.0", + "babylon": "6.18.0", + "debug": "2.6.9", + "globals": "9.18.0", + "invariant": "2.2.2", + "lodash": "4.17.4" + } + }, + "babel-types": { + "version": "6.26.0", + "resolved": "https://registry.npmjs.org/babel-types/-/babel-types-6.26.0.tgz", + "integrity": "sha1-o7Bz+Uq0nrb6Vc1lInozQ4BjJJc=", + "dev": true, + "requires": { + "babel-runtime": "6.26.0", + "esutils": "2.0.2", + "lodash": "4.17.4", + "to-fast-properties": "1.0.3" + } + }, + "babelify": { + "version": "7.3.0", + "resolved": "https://registry.npmjs.org/babelify/-/babelify-7.3.0.tgz", + "integrity": "sha1-qlau3nBn/XvVSWZu4W3ChQh+iOU=", + "dev": true, + "requires": { + "babel-core": "6.26.0", + "object-assign": "4.1.1" + } + }, + "babylon": { + "version": "6.18.0", + "resolved": "https://registry.npmjs.org/babylon/-/babylon-6.18.0.tgz", + "integrity": "sha512-q/UEjfGJ2Cm3oKV71DJz9d25TPnq5rhBVL2Q4fA5wcC3jcrdn7+SssEybFIxwAvvP+YCsCYNKughoF33GxgycQ==", + "dev": true + }, + "backo2": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/backo2/-/backo2-1.0.2.tgz", + "integrity": "sha1-MasayLEpNjRj41s+u2n038+6eUc=", + "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 + }, + "base64-arraybuffer": { + "version": "0.1.5", + "resolved": "https://registry.npmjs.org/base64-arraybuffer/-/base64-arraybuffer-0.1.5.tgz", + "integrity": "sha1-c5JncZI7Whl0etZmqlzUv5xunOg=", + "dev": true + }, + "base64-js": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/base64-js/-/base64-js-1.2.1.tgz", + "integrity": "sha512-dwVUVIXsBZXwTuwnXI9RK8sBmgq09NDHzyR9SAph9eqk76gKK2JSQmZARC2zRC81JC2QTtxD0ARU5qTS25gIGw==", + "dev": true + }, + "base64id": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/base64id/-/base64id-1.0.0.tgz", + "integrity": "sha1-R2iMuZu2gE8OBtPnY7HDLlfY5rY=", + "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, + "requires": { + "tweetnacl": "0.14.5" + } + }, + "better-assert": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/better-assert/-/better-assert-1.0.2.tgz", + "integrity": "sha1-QIZrnhueC1W0gYlDEeaPr/rrxSI=", + "dev": true, + "requires": { + "callsite": "1.0.0" + } + }, + "binary-extensions": { + "version": "1.11.0", + "resolved": "https://registry.npmjs.org/binary-extensions/-/binary-extensions-1.11.0.tgz", + "integrity": "sha1-RqoXUftqL5PuXmibsQh9SxTGwgU=", + "dev": true + }, + "bl": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/bl/-/bl-1.2.1.tgz", + "integrity": "sha1-ysMo977kVzDUBLaSID/LWQ4XLV4=", + "dev": true, + "requires": { + "readable-stream": "2.3.3" + } + }, + "blob": { + "version": "0.0.4", + "resolved": "https://registry.npmjs.org/blob/-/blob-0.0.4.tgz", + "integrity": "sha1-vPEwUspURj8w+fx+lbmkdjCpSSE=", + "dev": true + }, + "bluebird": { + "version": "3.5.1", + "resolved": "https://registry.npmjs.org/bluebird/-/bluebird-3.5.1.tgz", + "integrity": "sha512-MKiLiV+I1AA596t9w1sQJ8jkiSr5+ZKi0WKrYGUn6d1Fx+Ij4tIj+m2WMQSGczs5jZVxV339chE8iwk6F64wjA==", + "dev": true + }, + "bn.js": { + "version": "4.11.8", + "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-4.11.8.tgz", + "integrity": "sha512-ItfYfPLkWHUjckQCk8xC+LwxgK8NYcXywGigJgSwOP8Y2iyWT4f2vsZnoOXTTbo+o5yXmIUJ4gn5538SO5S3gA==", + "dev": true + }, + "body-parser": { + "version": "1.18.2", + "resolved": "https://registry.npmjs.org/body-parser/-/body-parser-1.18.2.tgz", + "integrity": "sha1-h2eKGdhLR9hZuDGZvVm84iKxBFQ=", + "dev": true, + "requires": { + "bytes": "3.0.0", + "content-type": "1.0.4", + "debug": "2.6.9", + "depd": "1.1.2", + "http-errors": "1.6.2", + "iconv-lite": "0.4.19", + "on-finished": "2.3.0", + "qs": "6.5.1", + "raw-body": "2.3.2", + "type-is": "1.6.15" + } + }, + "boom": { + "version": "4.3.1", + "resolved": "https://registry.npmjs.org/boom/-/boom-4.3.1.tgz", + "integrity": "sha1-T4owBctKfjiJ90kDD9JbluAdLjE=", + "dev": true, + "requires": { + "hoek": "4.2.0" + } + }, + "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, + "requires": { + "balanced-match": "1.0.0", + "concat-map": "0.0.1" + } + }, + "braces": { + "version": "1.8.5", + "resolved": "https://registry.npmjs.org/braces/-/braces-1.8.5.tgz", + "integrity": "sha1-uneWLhLf+WnWt2cR6RS3N4V79qc=", + "dev": true, + "requires": { + "expand-range": "1.8.2", + "preserve": "0.2.0", + "repeat-element": "1.1.2" + } + }, + "brorand": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/brorand/-/brorand-1.1.0.tgz", + "integrity": "sha1-EsJe/kCkXjwyPrhnWgoM5XsiNx8=", + "dev": true + }, + "browser-pack": { + "version": "6.0.3", + "resolved": "https://registry.npmjs.org/browser-pack/-/browser-pack-6.0.3.tgz", + "integrity": "sha512-Jo+RYsn8X8OhyP9tMXXg0ueR2fW696HUu1Hf3/DeiwNean1oGiPtdgGRNuUHBpPHzBH3x4n1kzAlgOgHSIq88g==", + "dev": true, + "requires": { + "JSONStream": "1.3.2", + "combine-source-map": "0.8.0", + "defined": "1.0.0", + "safe-buffer": "5.1.1", + "through2": "2.0.3", + "umd": "3.0.1" + } + }, + "browser-process-hrtime": { + "version": "0.1.2", + "resolved": "https://registry.npmjs.org/browser-process-hrtime/-/browser-process-hrtime-0.1.2.tgz", + "integrity": "sha1-Ql1opY00R/AqBKqJQYf86K+Le44=", + "dev": true + }, + "browser-resolve": { + "version": "1.11.2", + "resolved": "https://registry.npmjs.org/browser-resolve/-/browser-resolve-1.11.2.tgz", + "integrity": "sha1-j/CbCixCFxihBRwmCzLkj0QpOM4=", + "dev": true, + "requires": { + "resolve": "1.1.7" + }, + "dependencies": { + "resolve": { + "version": "1.1.7", + "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.1.7.tgz", + "integrity": "sha1-IDEU2CrSxe2ejgQRs5ModeiJ6Xs=", + "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 + }, + "browserify": { + "version": "13.3.0", + "resolved": "https://registry.npmjs.org/browserify/-/browserify-13.3.0.tgz", + "integrity": "sha1-tanJAgJD8McORnW+yCI7xifkFc4=", + "dev": true, + "requires": { + "JSONStream": "1.3.2", + "assert": "1.4.1", + "browser-pack": "6.0.3", + "browser-resolve": "1.11.2", + "browserify-zlib": "0.1.4", + "buffer": "4.9.1", + "cached-path-relative": "1.0.1", + "concat-stream": "1.5.2", + "console-browserify": "1.1.0", + "constants-browserify": "1.0.0", + "crypto-browserify": "3.12.0", + "defined": "1.0.0", + "deps-sort": "2.0.0", + "domain-browser": "1.1.7", + "duplexer2": "0.1.4", + "events": "1.1.1", + "glob": "7.1.2", + "has": "1.0.1", + "htmlescape": "1.1.1", + "https-browserify": "0.0.1", + "inherits": "2.0.3", + "insert-module-globals": "7.0.1", + "labeled-stream-splicer": "2.0.0", + "module-deps": "4.1.1", + "os-browserify": "0.1.2", + "parents": "1.0.1", + "path-browserify": "0.0.0", + "process": "0.11.10", + "punycode": "1.4.1", + "querystring-es3": "0.2.1", + "read-only-stream": "2.0.0", + "readable-stream": "2.3.3", + "resolve": "1.5.0", + "shasum": "1.0.2", + "shell-quote": "1.6.1", + "stream-browserify": "2.0.1", + "stream-http": "2.8.0", + "string_decoder": "0.10.31", + "subarg": "1.0.0", + "syntax-error": "1.3.0", + "through2": "2.0.3", + "timers-browserify": "1.4.2", + "tty-browserify": "0.0.0", + "url": "0.11.0", + "util": "0.10.3", + "vm-browserify": "0.0.4", + "xtend": "4.0.1" + } + }, + "browserify-aes": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/browserify-aes/-/browserify-aes-1.1.1.tgz", + "integrity": "sha512-UGnTYAnB2a3YuYKIRy1/4FB2HdM866E0qC46JXvVTYKlBlZlnvfpSfY6OKfXZAkv70eJ2a1SqzpAo5CRhZGDFg==", + "dev": true, + "requires": { + "buffer-xor": "1.0.3", + "cipher-base": "1.0.4", + "create-hash": "1.1.3", + "evp_bytestokey": "1.0.3", + "inherits": "2.0.3", + "safe-buffer": "5.1.1" + } + }, + "browserify-cipher": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/browserify-cipher/-/browserify-cipher-1.0.0.tgz", + "integrity": "sha1-mYgkSHS/XtTijalWZtzWasj8Njo=", + "dev": true, + "requires": { + "browserify-aes": "1.1.1", + "browserify-des": "1.0.0", + "evp_bytestokey": "1.0.3" + } + }, + "browserify-des": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/browserify-des/-/browserify-des-1.0.0.tgz", + "integrity": "sha1-2qJ3cXRwki7S/hhZQRihdUOXId0=", + "dev": true, + "requires": { + "cipher-base": "1.0.4", + "des.js": "1.0.0", + "inherits": "2.0.3" + } + }, + "browserify-rsa": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/browserify-rsa/-/browserify-rsa-4.0.1.tgz", + "integrity": "sha1-IeCr+vbyApzy+vsTNWenAdQTVSQ=", + "dev": true, + "requires": { + "bn.js": "4.11.8", + "randombytes": "2.0.6" + } + }, + "browserify-sign": { + "version": "4.0.4", + "resolved": "https://registry.npmjs.org/browserify-sign/-/browserify-sign-4.0.4.tgz", + "integrity": "sha1-qk62jl17ZYuqa/alfmMMvXqT0pg=", + "dev": true, + "requires": { + "bn.js": "4.11.8", + "browserify-rsa": "4.0.1", + "create-hash": "1.1.3", + "create-hmac": "1.1.6", + "elliptic": "6.4.0", + "inherits": "2.0.3", + "parse-asn1": "5.1.0" + } + }, + "browserify-zlib": { + "version": "0.1.4", + "resolved": "https://registry.npmjs.org/browserify-zlib/-/browserify-zlib-0.1.4.tgz", + "integrity": "sha1-uzX4pRn2AOD6a4SFJByXnQFB+y0=", + "dev": true, + "requires": { + "pako": "0.2.9" + } + }, + "buffer": { + "version": "4.9.1", + "resolved": "https://registry.npmjs.org/buffer/-/buffer-4.9.1.tgz", + "integrity": "sha1-bRu2AbB6TvztlwlBMgkwJ8lbwpg=", + "dev": true, + "requires": { + "base64-js": "1.2.1", + "ieee754": "1.1.8", + "isarray": "1.0.0" + } + }, + "buffer-crc32": { + "version": "0.2.13", + "resolved": "https://registry.npmjs.org/buffer-crc32/-/buffer-crc32-0.2.13.tgz", + "integrity": "sha1-DTM+PwDqxQqhRUq9MO+MKl2ackI=", + "dev": true + }, + "buffer-xor": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/buffer-xor/-/buffer-xor-1.0.3.tgz", + "integrity": "sha1-JuYe0UIvtw3ULm42cp7VHYVf6Nk=", + "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 + }, + "builtin-status-codes": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/builtin-status-codes/-/builtin-status-codes-3.0.0.tgz", + "integrity": "sha1-hZgoeOIbmOHGZCXgPQF0eI9Wnug=", + "dev": true + }, + "bytes": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/bytes/-/bytes-3.0.0.tgz", + "integrity": "sha1-0ygVQE1olpn4Wk6k+odV3ROpYEg=", + "dev": true + }, + "cached-path-relative": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/cached-path-relative/-/cached-path-relative-1.0.1.tgz", + "integrity": "sha1-0JxLUoAKpMB44t2BqGmqyQ0uVOc=", + "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, + "requires": { + "callsites": "0.2.0" + } + }, + "callsite": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/callsite/-/callsite-1.0.0.tgz", + "integrity": "sha1-KAOY5dZkvXQDi28JBRU+borxvCA=", + "dev": true + }, + "callsites": { + "version": "0.2.0", + "resolved": "https://registry.npmjs.org/callsites/-/callsites-0.2.0.tgz", + "integrity": "sha1-r6uWJikQp/M8GaV3WCXGnzTjUMo=", + "dev": true + }, + "caseless": { + "version": "0.12.0", + "resolved": "https://registry.npmjs.org/caseless/-/caseless-0.12.0.tgz", + "integrity": "sha1-G2gcIf+EAzyCZUMJBolCDRhxUdw=", + "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, + "requires": { + "assertion-error": "1.1.0", + "deep-eql": "0.1.3", + "type-detect": "1.0.0" + } + }, + "chalk": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-1.1.3.tgz", + "integrity": "sha1-qBFcVeSnAv5NFQq9OHKCKn4J/Jg=", + "dev": true, + "requires": { + "ansi-styles": "2.2.1", + "escape-string-regexp": "1.0.5", + "has-ansi": "2.0.0", + "strip-ansi": "3.0.1", + "supports-color": "2.0.0" + } + }, + "chardet": { + "version": "0.4.2", + "resolved": "https://registry.npmjs.org/chardet/-/chardet-0.4.2.tgz", + "integrity": "sha1-tUc7M9yXxCTl2Y3IfVXU2KKci/I=", + "dev": true + }, + "chokidar": { + "version": "1.7.0", + "resolved": "https://registry.npmjs.org/chokidar/-/chokidar-1.7.0.tgz", + "integrity": "sha1-eY5ol3gVHIB2tLNg5e3SjNortGg=", + "dev": true, + "requires": { + "anymatch": "1.3.2", + "async-each": "1.0.1", + "fsevents": "1.1.3", + "glob-parent": "2.0.0", + "inherits": "2.0.3", + "is-binary-path": "1.0.1", + "is-glob": "2.0.1", + "path-is-absolute": "1.0.1", + "readdirp": "2.1.0" + } + }, + "cipher-base": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/cipher-base/-/cipher-base-1.0.4.tgz", + "integrity": "sha512-Kkht5ye6ZGmwv40uUDZztayT2ThLQGfnj/T71N/XzeZeo3nf8foyW7zGTsPYkEya3m5f3cAypH+qe7YOrM1U2Q==", + "dev": true, + "requires": { + "inherits": "2.0.3", + "safe-buffer": "5.1.1" + } + }, + "circular-json": { + "version": "0.3.3", + "resolved": "https://registry.npmjs.org/circular-json/-/circular-json-0.3.3.tgz", + "integrity": "sha512-UZK3NBx2Mca+b5LsG7bY183pHWt5Y1xts4P3Pz7ENTwGVnJOUWbRb3ocjvX7hx9tq/yTAdclXm9sZ38gNuem4A==", + "dev": true + }, + "cli-cursor": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/cli-cursor/-/cli-cursor-2.1.0.tgz", + "integrity": "sha1-s12sN2R5+sw+lHR9QdDQ9SOP/LU=", + "dev": true, + "requires": { + "restore-cursor": "2.0.0" + } + }, + "cli-width": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/cli-width/-/cli-width-2.2.0.tgz", + "integrity": "sha1-/xnt6Kml5XkyQUewwR8PvLq+1jk=", + "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 + }, + "color-convert": { + "version": "1.9.1", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-1.9.1.tgz", + "integrity": "sha512-mjGanIiwQJskCC18rPR6OmrZ6fm2Lc7PeGFYwCmy5J34wC6F1PzdGL6xeMfmgicfYcNLGuVFA3WzXtIDCQSZxQ==", + "dev": true, + "requires": { + "color-name": "1.1.3" + } + }, + "color-name": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.3.tgz", + "integrity": "sha1-p9BVi9icQveV3UIyj3QIMcpTvCU=", + "dev": true + }, + "colors": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/colors/-/colors-1.1.2.tgz", + "integrity": "sha1-FopHAXVran9RoSzgyXv6KMCE7WM=", + "dev": true + }, + "combine-lists": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/combine-lists/-/combine-lists-1.0.1.tgz", + "integrity": "sha1-RYwH4J4NkA/Ci3Cj/sLazR0st/Y=", + "dev": true, + "requires": { + "lodash": "4.17.4" + } + }, + "combine-source-map": { + "version": "0.8.0", + "resolved": "https://registry.npmjs.org/combine-source-map/-/combine-source-map-0.8.0.tgz", + "integrity": "sha1-pY0N8ELBhvz4IqjoAV9UUNLXmos=", + "dev": true, + "requires": { + "convert-source-map": "1.1.3", + "inline-source-map": "0.6.2", + "lodash.memoize": "3.0.4", + "source-map": "0.5.7" + }, + "dependencies": { + "convert-source-map": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/convert-source-map/-/convert-source-map-1.1.3.tgz", + "integrity": "sha1-SCnId+n+SbMWHzvzZziI4gRpmGA=", + "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, + "requires": { + "delayed-stream": "1.0.0" + } + }, + "commander": { + "version": "2.13.0", + "resolved": "https://registry.npmjs.org/commander/-/commander-2.13.0.tgz", + "integrity": "sha512-MVuS359B+YzaWqjCL/c+22gfryv+mCBPHAv3zyVI2GN8EY6IRP8VwtasXn8jyyhvvq84R4ImN1OKRtcbIasjYA==", + "dev": true + }, + "component-bind": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/component-bind/-/component-bind-1.0.0.tgz", + "integrity": "sha1-AMYIq33Nk4l8AAllGx06jh5zu9E=", + "dev": true + }, + "component-emitter": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/component-emitter/-/component-emitter-1.1.2.tgz", + "integrity": "sha1-KWWU8nU9qmOZbSrwjRWpURbJrsM=", + "dev": true + }, + "component-inherit": { + "version": "0.0.3", + "resolved": "https://registry.npmjs.org/component-inherit/-/component-inherit-0.0.3.tgz", + "integrity": "sha1-ZF/ErfWLcrZJ1crmUTVhnbJv8UM=", + "dev": true + }, + "compress-commons": { + "version": "1.2.2", + "resolved": "https://registry.npmjs.org/compress-commons/-/compress-commons-1.2.2.tgz", + "integrity": "sha1-UkqfEJA/OoEzibAiXSfEi7dRiQ8=", + "dev": true, + "requires": { + "buffer-crc32": "0.2.13", + "crc32-stream": "2.0.0", + "normalize-path": "2.1.1", + "readable-stream": "2.3.3" + } + }, + "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.5.2", + "resolved": "https://registry.npmjs.org/concat-stream/-/concat-stream-1.5.2.tgz", + "integrity": "sha1-cIl4Yk2FavQaWnQd790mHadSwmY=", + "dev": true, + "requires": { + "inherits": "2.0.3", + "readable-stream": "2.0.6", + "typedarray": "0.0.6" + }, + "dependencies": { + "readable-stream": { + "version": "2.0.6", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.0.6.tgz", + "integrity": "sha1-j5A0HmilPMySh4jaz80Rs265t44=", + "dev": true, + "requires": { + "core-util-is": "1.0.2", + "inherits": "2.0.3", + "isarray": "1.0.0", + "process-nextick-args": "1.0.7", + "string_decoder": "0.10.31", + "util-deprecate": "1.0.2" + } + } + } + }, + "connect": { + "version": "3.6.5", + "resolved": "https://registry.npmjs.org/connect/-/connect-3.6.5.tgz", + "integrity": "sha1-+43ee6B2OHfQ7J352sC0tA5yx9o=", + "dev": true, + "requires": { + "debug": "2.6.9", + "finalhandler": "1.0.6", + "parseurl": "1.3.2", + "utils-merge": "1.0.1" + } + }, + "console-browserify": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/console-browserify/-/console-browserify-1.1.0.tgz", + "integrity": "sha1-8CQcRXMKn8YyOyBtvzjtx0HQuxA=", + "dev": true, + "requires": { + "date-now": "0.1.4" + } + }, + "constants-browserify": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/constants-browserify/-/constants-browserify-1.0.0.tgz", + "integrity": "sha1-wguW2MYXdIqvHBYCF2DNJ/y4y3U=", + "dev": true + }, + "content-type": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/content-type/-/content-type-1.0.4.tgz", + "integrity": "sha512-hIP3EEPs8tB9AT1L+NUqtwOAps4mk2Zob89MWXMHjHWg9milF/j4osnnQLXBCBFBk/tvIG/tUc9mOUJiPBhPXA==", + "dev": true + }, + "content-type-parser": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/content-type-parser/-/content-type-parser-1.0.2.tgz", + "integrity": "sha512-lM4l4CnMEwOLHAHr/P6MEZwZFPJFtAAKgL6pogbXmVZggIqXhdB6RbBtPOTsw2FcXwYhehRGERJmRrjOiIB8pQ==", + "dev": true + }, + "convert-source-map": { + "version": "1.5.1", + "resolved": "https://registry.npmjs.org/convert-source-map/-/convert-source-map-1.5.1.tgz", + "integrity": "sha1-uCeAl7m8IpNl3lxiz1/K7YtVmeU=", + "dev": true + }, + "cookie": { + "version": "0.3.1", + "resolved": "https://registry.npmjs.org/cookie/-/cookie-0.3.1.tgz", + "integrity": "sha1-5+Ch+e9DtMi6klxcWpboBtFoc7s=", + "dev": true + }, + "core-js": { + "version": "2.5.3", + "resolved": "https://registry.npmjs.org/core-js/-/core-js-2.5.3.tgz", + "integrity": "sha1-isw4NFgk8W2DZbfJtCWRaOjtYD4=", + "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 + }, + "crc": { + "version": "3.5.0", + "resolved": "https://registry.npmjs.org/crc/-/crc-3.5.0.tgz", + "integrity": "sha1-mLi6fUiWZbo5efWbITgTdBAaGWQ=", + "dev": true + }, + "crc32-stream": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/crc32-stream/-/crc32-stream-2.0.0.tgz", + "integrity": "sha1-483TtN8xaN10494/u8t7KX/pCPQ=", + "dev": true, + "requires": { + "crc": "3.5.0", + "readable-stream": "2.3.3" + } + }, + "create-ecdh": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/create-ecdh/-/create-ecdh-4.0.0.tgz", + "integrity": "sha1-iIxyNZbN92EvZJgjPuvXo1MBc30=", + "dev": true, + "requires": { + "bn.js": "4.11.8", + "elliptic": "6.4.0" + } + }, + "create-hash": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/create-hash/-/create-hash-1.1.3.tgz", + "integrity": "sha1-YGBCrIuSYnUPSDyt2rD1gZFy2P0=", + "dev": true, + "requires": { + "cipher-base": "1.0.4", + "inherits": "2.0.3", + "ripemd160": "2.0.1", + "sha.js": "2.4.10" + } + }, + "create-hmac": { + "version": "1.1.6", + "resolved": "https://registry.npmjs.org/create-hmac/-/create-hmac-1.1.6.tgz", + "integrity": "sha1-rLniIaThe9sHbpBlfEK5PjcmzwY=", + "dev": true, + "requires": { + "cipher-base": "1.0.4", + "create-hash": "1.1.3", + "inherits": "2.0.3", + "ripemd160": "2.0.1", + "safe-buffer": "5.1.1", + "sha.js": "2.4.10" + } + }, + "cross-spawn": { + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-5.1.0.tgz", + "integrity": "sha1-6L0O/uWPz/b4+UUQoKVUu/ojVEk=", + "dev": true, + "requires": { + "lru-cache": "4.1.1", + "shebang-command": "1.2.0", + "which": "1.3.0" + }, + "dependencies": { + "lru-cache": { + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-4.1.1.tgz", + "integrity": "sha512-q4spe4KTfsAS1SUHLO0wz8Qiyf1+vMIAgpRYioFYDMNqKfHQbg+AVDH3i4fvpl71/P1L0dBl+fQi+P37UYf0ew==", + "dev": true, + "requires": { + "pseudomap": "1.0.2", + "yallist": "2.1.2" + } + } + } + }, + "cryptiles": { + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/cryptiles/-/cryptiles-3.1.2.tgz", + "integrity": "sha1-qJ+7Ig9c4l7FboxKqKT9e1sNKf4=", + "dev": true, + "requires": { + "boom": "5.2.0" + }, + "dependencies": { + "boom": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/boom/-/boom-5.2.0.tgz", + "integrity": "sha512-Z5BTk6ZRe4tXXQlkqftmsAUANpXmuwlsF5Oov8ThoMbQRzdGTA1ngYRW160GexgOgjsFOKJz0LYhoNi+2AMBUw==", + "dev": true, + "requires": { + "hoek": "4.2.0" + } + } + } + }, + "crypto-browserify": { + "version": "3.12.0", + "resolved": "https://registry.npmjs.org/crypto-browserify/-/crypto-browserify-3.12.0.tgz", + "integrity": "sha512-fz4spIh+znjO2VjL+IdhEpRJ3YN6sMzITSBijk6FK2UvTqruSQW+/cCZTSNsMiZNvUeq0CqurF+dAbyiGOY6Wg==", + "dev": true, + "requires": { + "browserify-cipher": "1.0.0", + "browserify-sign": "4.0.4", + "create-ecdh": "4.0.0", + "create-hash": "1.1.3", + "create-hmac": "1.1.6", + "diffie-hellman": "5.0.2", + "inherits": "2.0.3", + "pbkdf2": "3.0.14", + "public-encrypt": "4.0.0", + "randombytes": "2.0.6", + "randomfill": "1.0.3" + } + }, + "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, + "requires": { + "cssom": "0.3.2" + } + }, + "custom-event": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/custom-event/-/custom-event-1.0.1.tgz", + "integrity": "sha1-XQKkaFCt8bSjF5RqOSj8y1v9BCU=", + "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, + "requires": { + "assert-plus": "1.0.0" + } + }, + "date-now": { + "version": "0.1.4", + "resolved": "https://registry.npmjs.org/date-now/-/date-now-0.1.4.tgz", + "integrity": "sha1-6vQ5/U1ISK105cx9vvIAZyueNFs=", + "dev": true + }, + "debug": { + "version": "2.6.9", + "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", + "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", + "dev": true, + "requires": { + "ms": "2.0.0" + } + }, + "deep-eql": { + "version": "0.1.3", + "resolved": "https://registry.npmjs.org/deep-eql/-/deep-eql-0.1.3.tgz", + "integrity": "sha1-71WKyrjeJSBs1xOQbXTlaTDrafI=", + "dev": true, + "requires": { + "type-detect": "0.1.1" + }, + "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 + }, + "defined": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/defined/-/defined-1.0.0.tgz", + "integrity": "sha1-yY2bzvdWdBiOEQlpFRGZ45sfppM=", + "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, + "requires": { + "globby": "5.0.0", + "is-path-cwd": "1.0.0", + "is-path-in-cwd": "1.0.0", + "object-assign": "4.1.1", + "pify": "2.3.0", + "pinkie-promise": "2.0.1", + "rimraf": "2.6.2" + } + }, + "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 + }, + "depd": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/depd/-/depd-1.1.2.tgz", + "integrity": "sha1-m81S4UwJd2PnSbJ0xDRu0uVgtak=", + "dev": true + }, + "deps-sort": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/deps-sort/-/deps-sort-2.0.0.tgz", + "integrity": "sha1-CRckkC6EZYJg65EHSMzNGvbiH7U=", + "dev": true, + "requires": { + "JSONStream": "1.3.2", + "shasum": "1.0.2", + "subarg": "1.0.0", + "through2": "2.0.3" + } + }, + "des.js": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/des.js/-/des.js-1.0.0.tgz", + "integrity": "sha1-wHTS4qpqipoH29YfmhXCzYPsjsw=", + "dev": true, + "requires": { + "inherits": "2.0.3", + "minimalistic-assert": "1.0.0" + } + }, + "detect-indent": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/detect-indent/-/detect-indent-4.0.0.tgz", + "integrity": "sha1-920GQ1LN9Docts5hnE7jqUdd4gg=", + "dev": true, + "requires": { + "repeating": "2.0.1" + } + }, + "detective": { + "version": "4.7.1", + "resolved": "https://registry.npmjs.org/detective/-/detective-4.7.1.tgz", + "integrity": "sha512-H6PmeeUcZloWtdt4DAkFyzFL94arpHr3NOwwmVILFiy+9Qd4JTxxXrzfyGk/lmct2qVGBwTSwSXagqu2BxmWig==", + "dev": true, + "requires": { + "acorn": "5.3.0", + "defined": "1.0.0" + }, + "dependencies": { + "acorn": { + "version": "5.3.0", + "resolved": "https://registry.npmjs.org/acorn/-/acorn-5.3.0.tgz", + "integrity": "sha512-Yej+zOJ1Dm/IMZzzj78OntP/r3zHEaKcyNoU2lAaxPtrseM6rF0xwqoz5Q5ysAiED9hTjI2hgtvLXitlCN1/Ug==", + "dev": true + } + } + }, + "di": { + "version": "0.0.1", + "resolved": "https://registry.npmjs.org/di/-/di-0.0.1.tgz", + "integrity": "sha1-gGZJMmzqp8qjMG112YXqJ0i6kTw=", + "dev": true + }, + "diff": { + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/diff/-/diff-3.2.0.tgz", + "integrity": "sha1-yc45Okt8vQsFinJck98pkCeGj/k=", + "dev": true + }, + "diffie-hellman": { + "version": "5.0.2", + "resolved": "https://registry.npmjs.org/diffie-hellman/-/diffie-hellman-5.0.2.tgz", + "integrity": "sha1-tYNXOScM/ias9jIJn97SoH8gnl4=", + "dev": true, + "requires": { + "bn.js": "4.11.8", + "miller-rabin": "4.0.1", + "randombytes": "2.0.6" + } + }, + "doctrine": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/doctrine/-/doctrine-2.1.0.tgz", + "integrity": "sha512-35mSku4ZXK0vfCuHEDAwt55dg2jNajHZ1odvF+8SSr82EsZY4QmXfuWso8oEd8zRhVObSN18aM0CjSdoBX7zIw==", + "dev": true, + "requires": { + "esutils": "2.0.2" + } + }, + "dom-serialize": { + "version": "2.2.1", + "resolved": "https://registry.npmjs.org/dom-serialize/-/dom-serialize-2.2.1.tgz", + "integrity": "sha1-ViromZ9Evl6jB29UGdzVnrQ6yVs=", + "dev": true, + "requires": { + "custom-event": "1.0.1", + "ent": "2.2.0", + "extend": "3.0.1", + "void-elements": "2.0.1" + } + }, + "domain-browser": { + "version": "1.1.7", + "resolved": "https://registry.npmjs.org/domain-browser/-/domain-browser-1.1.7.tgz", + "integrity": "sha1-hnqksJP6oF8d4IwG9NeyH9+GmLw=", + "dev": true + }, + "domexception": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/domexception/-/domexception-1.0.1.tgz", + "integrity": "sha512-raigMkn7CJNNo6Ihro1fzG7wr3fHuYVytzquZKX5n0yizGsTcYgzdIUwj1X9pK0VvjeihV+XiclP+DjwbsSKug==", + "dev": true, + "requires": { + "webidl-conversions": "4.0.2" + } + }, + "duplexer2": { + "version": "0.1.4", + "resolved": "https://registry.npmjs.org/duplexer2/-/duplexer2-0.1.4.tgz", + "integrity": "sha1-ixLauHjA1p4+eJEFFmKjL8a93ME=", + "dev": true, + "requires": { + "readable-stream": "2.3.3" + } + }, + "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, + "requires": { + "jsbn": "0.1.1" + } + }, + "ee-first": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/ee-first/-/ee-first-1.1.1.tgz", + "integrity": "sha1-WQxhFWsK4vTwJVcyoViyZrxWsh0=", + "dev": true + }, + "elliptic": { + "version": "6.4.0", + "resolved": "https://registry.npmjs.org/elliptic/-/elliptic-6.4.0.tgz", + "integrity": "sha1-ysmvh2LIWDYYcAPI3+GT5eLq5d8=", + "dev": true, + "requires": { + "bn.js": "4.11.8", + "brorand": "1.1.0", + "hash.js": "1.1.3", + "hmac-drbg": "1.0.1", + "inherits": "2.0.3", + "minimalistic-assert": "1.0.0", + "minimalistic-crypto-utils": "1.0.1" + } + }, + "encodeurl": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/encodeurl/-/encodeurl-1.0.2.tgz", + "integrity": "sha1-rT/0yG7C0CkyL1oCw6mmBslbP1k=", + "dev": true + }, + "encoding": { + "version": "0.1.12", + "resolved": "https://registry.npmjs.org/encoding/-/encoding-0.1.12.tgz", + "integrity": "sha1-U4tm8+5izRq1HsMjgp0flIDHS+s=", + "dev": true, + "requires": { + "iconv-lite": "0.4.19" + } + }, + "end-of-stream": { + "version": "1.4.1", + "resolved": "https://registry.npmjs.org/end-of-stream/-/end-of-stream-1.4.1.tgz", + "integrity": "sha512-1MkrZNvWTKCaigbn+W15elq2BB/L22nqrSY5DKlo3X6+vclJm8Bb5djXJBmEX6fS3+zCh/F4VBK5Z2KxJt4s2Q==", + "dev": true, + "requires": { + "once": "1.4.0" + } + }, + "engine.io": { + "version": "1.8.3", + "resolved": "https://registry.npmjs.org/engine.io/-/engine.io-1.8.3.tgz", + "integrity": "sha1-jef5eJXSDTm4X4ju7nd7K9QrE9Q=", + "dev": true, + "requires": { + "accepts": "1.3.3", + "base64id": "1.0.0", + "cookie": "0.3.1", + "debug": "2.3.3", + "engine.io-parser": "1.3.2", + "ws": "1.1.2" + }, + "dependencies": { + "debug": { + "version": "2.3.3", + "resolved": "https://registry.npmjs.org/debug/-/debug-2.3.3.tgz", + "integrity": "sha1-QMRT5n5uE8kB3ewxeviYbNqe/4w=", + "dev": true, + "requires": { + "ms": "0.7.2" + } + }, + "ms": { + "version": "0.7.2", + "resolved": "https://registry.npmjs.org/ms/-/ms-0.7.2.tgz", + "integrity": "sha1-riXPJRKziFodldfwN4aNhDESR2U=", + "dev": true + }, + "ultron": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/ultron/-/ultron-1.0.2.tgz", + "integrity": "sha1-rOEWq1V80Zc4ak6I9GhTeMiy5Po=", + "dev": true + }, + "ws": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/ws/-/ws-1.1.2.tgz", + "integrity": "sha1-iiRPoFJAHgjJiGz0SoUYnh/UBn8=", + "dev": true, + "requires": { + "options": "0.0.6", + "ultron": "1.0.2" + } + } + } + }, + "engine.io-client": { + "version": "1.8.3", + "resolved": "https://registry.npmjs.org/engine.io-client/-/engine.io-client-1.8.3.tgz", + "integrity": "sha1-F5jtk0USRkU9TG9jXXogH+lA1as=", + "dev": true, + "requires": { + "component-emitter": "1.2.1", + "component-inherit": "0.0.3", + "debug": "2.3.3", + "engine.io-parser": "1.3.2", + "has-cors": "1.1.0", + "indexof": "0.0.1", + "parsejson": "0.0.3", + "parseqs": "0.0.5", + "parseuri": "0.0.5", + "ws": "1.1.2", + "xmlhttprequest-ssl": "1.5.3", + "yeast": "0.1.2" + }, + "dependencies": { + "component-emitter": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/component-emitter/-/component-emitter-1.2.1.tgz", + "integrity": "sha1-E3kY1teCg/ffemt8WmPhQOaUJeY=", + "dev": true + }, + "debug": { + "version": "2.3.3", + "resolved": "https://registry.npmjs.org/debug/-/debug-2.3.3.tgz", + "integrity": "sha1-QMRT5n5uE8kB3ewxeviYbNqe/4w=", + "dev": true, + "requires": { + "ms": "0.7.2" + } + }, + "ms": { + "version": "0.7.2", + "resolved": "https://registry.npmjs.org/ms/-/ms-0.7.2.tgz", + "integrity": "sha1-riXPJRKziFodldfwN4aNhDESR2U=", + "dev": true + }, + "ultron": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/ultron/-/ultron-1.0.2.tgz", + "integrity": "sha1-rOEWq1V80Zc4ak6I9GhTeMiy5Po=", + "dev": true + }, + "ws": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/ws/-/ws-1.1.2.tgz", + "integrity": "sha1-iiRPoFJAHgjJiGz0SoUYnh/UBn8=", + "dev": true, + "requires": { + "options": "0.0.6", + "ultron": "1.0.2" + } + } + } + }, + "engine.io-parser": { + "version": "1.3.2", + "resolved": "https://registry.npmjs.org/engine.io-parser/-/engine.io-parser-1.3.2.tgz", + "integrity": "sha1-k3sHnwAH0Ik+xW1GyyILjLQ1Igo=", + "dev": true, + "requires": { + "after": "0.8.2", + "arraybuffer.slice": "0.0.6", + "base64-arraybuffer": "0.1.5", + "blob": "0.0.4", + "has-binary": "0.1.7", + "wtf-8": "1.0.0" + } + }, + "ent": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/ent/-/ent-2.2.0.tgz", + "integrity": "sha1-6WQhkyWiHQX0RGai9obtbOX13R0=", + "dev": true + }, + "es-module-loader": { + "version": "2.2.8", + "resolved": "https://registry.npmjs.org/es-module-loader/-/es-module-loader-2.2.8.tgz", + "integrity": "sha512-EdTWmI4b/Y4kHEgnucMsArn/j8XzBBqLA8VX3S29owVxfd4+TCETnc31xQvQPp0hRSgpfy1N6KWQghRjxqhFlA==", + "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.9.0", + "resolved": "https://registry.npmjs.org/escodegen/-/escodegen-1.9.0.tgz", + "integrity": "sha512-v0MYvNQ32bzwoG2OSFzWAkuahDQHK92JBN0pTAALJ4RIxEZe766QJPDR8Hqy7XNUy5K3fnVL76OqYAdc4TZEIw==", + "dev": true, + "requires": { + "esprima": "3.1.3", + "estraverse": "4.2.0", + "esutils": "2.0.2", + "optionator": "0.8.2", + "source-map": "0.5.7" + } + }, + "eslint": { + "version": "4.16.0", + "resolved": "https://registry.npmjs.org/eslint/-/eslint-4.16.0.tgz", + "integrity": "sha512-YVXV4bDhNoHHcv0qzU4Meof7/P26B4EuaktMi5L1Tnt52Aov85KmYA8c5D+xyZr/BkhvwUqr011jDSD/QTULxg==", + "dev": true, + "requires": { + "ajv": "5.5.2", + "babel-code-frame": "6.26.0", + "chalk": "2.3.0", + "concat-stream": "1.6.0", + "cross-spawn": "5.1.0", + "debug": "3.1.0", + "doctrine": "2.1.0", + "eslint-scope": "3.7.1", + "eslint-visitor-keys": "1.0.0", + "espree": "3.5.2", + "esquery": "1.0.0", + "esutils": "2.0.2", + "file-entry-cache": "2.0.0", + "functional-red-black-tree": "1.0.1", + "glob": "7.1.2", + "globals": "11.2.0", + "ignore": "3.3.7", + "imurmurhash": "0.1.4", + "inquirer": "3.3.0", + "is-resolvable": "1.1.0", + "js-yaml": "3.10.0", + "json-stable-stringify-without-jsonify": "1.0.1", + "levn": "0.3.0", + "lodash": "4.17.4", + "minimatch": "3.0.4", + "mkdirp": "0.5.1", + "natural-compare": "1.4.0", + "optionator": "0.8.2", + "path-is-inside": "1.0.2", + "pluralize": "7.0.0", + "progress": "2.0.0", + "require-uncached": "1.0.3", + "semver": "5.5.0", + "strip-ansi": "4.0.0", + "strip-json-comments": "2.0.1", + "table": "4.0.2", + "text-table": "0.2.0" + }, + "dependencies": { + "ansi-regex": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-3.0.0.tgz", + "integrity": "sha1-7QMXwyIGT3lGbAKWa922Bas32Zg=", + "dev": true + }, + "ansi-styles": { + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.0.tgz", + "integrity": "sha512-NnSOmMEYtVR2JVMIGTzynRkkaxtiq1xnFBcdQD/DnNCYPoEPsVJhM98BDyaoNOQIi7p4okdi3E27eN7GQbsUug==", + "dev": true, + "requires": { + "color-convert": "1.9.1" + } + }, + "chalk": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.3.0.tgz", + "integrity": "sha512-Az5zJR2CBujap2rqXGaJKaPHyJ0IrUimvYNX+ncCy8PJP4ltOGTrHUIo097ZaL2zMeKYpiCdqDvS6zdrTFok3Q==", + "dev": true, + "requires": { + "ansi-styles": "3.2.0", + "escape-string-regexp": "1.0.5", + "supports-color": "4.5.0" + } + }, + "concat-stream": { + "version": "1.6.0", + "resolved": "https://registry.npmjs.org/concat-stream/-/concat-stream-1.6.0.tgz", + "integrity": "sha1-CqxmL9Ur54lk1VMvaUeE5wEQrPc=", + "dev": true, + "requires": { + "inherits": "2.0.3", + "readable-stream": "2.3.3", + "typedarray": "0.0.6" + } + }, + "debug": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/debug/-/debug-3.1.0.tgz", + "integrity": "sha512-OX8XqP7/1a9cqkxYw2yXss15f26NKWBpDXQd0/uK/KPqdQhxbPa994hnzjcE2VqQpDslf55723cKPUOGSmMY3g==", + "dev": true, + "requires": { + "ms": "2.0.0" + } + }, + "globals": { + "version": "11.2.0", + "resolved": "https://registry.npmjs.org/globals/-/globals-11.2.0.tgz", + "integrity": "sha512-RDC7Tj17I/56wpVvCVLSXtnn2Fo6CQZ9vaj+ARn+qlzm/ozbKQZe+j9fvHZCbSq+4JSGjTpKEt7p/AA1IKXRFA==", + "dev": true + }, + "semver": { + "version": "5.5.0", + "resolved": "https://registry.npmjs.org/semver/-/semver-5.5.0.tgz", + "integrity": "sha512-4SJ3dm0WAwWy/NVeioZh5AntkdJoWKxHxcmyP622fOkgHa4z3R0TdBJICINyaSDE6uNwVc8gZr+ZinwZAH4xIA==", + "dev": true + }, + "strip-ansi": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-4.0.0.tgz", + "integrity": "sha1-qEeQIusaw2iocTibY1JixQXuNo8=", + "dev": true, + "requires": { + "ansi-regex": "3.0.0" + } + }, + "supports-color": { + "version": "4.5.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-4.5.0.tgz", + "integrity": "sha1-vnoN5ITexcXN34s9WRJQRJEvY1s=", + "dev": true, + "requires": { + "has-flag": "2.0.0" + } + } + } + }, + "eslint-scope": { + "version": "3.7.1", + "resolved": "https://registry.npmjs.org/eslint-scope/-/eslint-scope-3.7.1.tgz", + "integrity": "sha1-PWPD7f2gLgbgGkUq2IyqzHzctug=", + "dev": true, + "requires": { + "esrecurse": "4.2.0", + "estraverse": "4.2.0" + } + }, + "eslint-visitor-keys": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-1.0.0.tgz", + "integrity": "sha512-qzm/XxIbxm/FHyH341ZrbnMUpe+5Bocte9xkmFMzPMjRaZMcXww+MpBptFvtU+79L362nqiLhekCxCxDPaUMBQ==", + "dev": true + }, + "espree": { + "version": "3.5.2", + "resolved": "https://registry.npmjs.org/espree/-/espree-3.5.2.tgz", + "integrity": "sha512-sadKeYwaR/aJ3stC2CdvgXu1T16TdYN+qwCpcWbMnGJ8s0zNWemzrvb2GbD4OhmJ/fwpJjudThAlLobGbWZbCQ==", + "dev": true, + "requires": { + "acorn": "5.3.0", + "acorn-jsx": "3.0.1" + }, + "dependencies": { + "acorn": { + "version": "5.3.0", + "resolved": "https://registry.npmjs.org/acorn/-/acorn-5.3.0.tgz", + "integrity": "sha512-Yej+zOJ1Dm/IMZzzj78OntP/r3zHEaKcyNoU2lAaxPtrseM6rF0xwqoz5Q5ysAiED9hTjI2hgtvLXitlCN1/Ug==", + "dev": true + } + } + }, + "esprima": { + "version": "3.1.3", + "resolved": "https://registry.npmjs.org/esprima/-/esprima-3.1.3.tgz", + "integrity": "sha1-/cpRzuYTOJXjyI1TXOSdv/YqRjM=", + "dev": true + }, + "esquery": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/esquery/-/esquery-1.0.0.tgz", + "integrity": "sha1-z7qLV9f7qT8XKYqKAGoEzaE9gPo=", + "dev": true, + "requires": { + "estraverse": "4.2.0" + } + }, + "esrecurse": { + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/esrecurse/-/esrecurse-4.2.0.tgz", + "integrity": "sha1-+pVo2Y04I/mkHZHpAtyrnqblsWM=", + "dev": true, + "requires": { + "estraverse": "4.2.0", + "object-assign": "4.1.1" + } + }, + "estraverse": { + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-4.2.0.tgz", + "integrity": "sha1-De4/7TH81GlhjOc0IJn8GvoL2xM=", + "dev": true + }, + "esutils": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/esutils/-/esutils-2.0.2.tgz", + "integrity": "sha1-Cr9PHKpbyx96nYrMbepPqqBLrJs=", + "dev": true + }, + "eventemitter3": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/eventemitter3/-/eventemitter3-1.2.0.tgz", + "integrity": "sha1-HIaZHYFq0eUEdQ5zh0Ik7PO+xQg=", + "dev": true + }, + "events": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/events/-/events-1.1.1.tgz", + "integrity": "sha1-nr23Y1rQmccNzEwqH1AEKI6L2SQ=", + "dev": true + }, + "evp_bytestokey": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/evp_bytestokey/-/evp_bytestokey-1.0.3.tgz", + "integrity": "sha512-/f2Go4TognH/KvCISP7OUsHn85hT9nUkxxA9BEWxFn+Oj9o8ZNLm/40hdlgSLyuOimsrTKLUMEorQexp/aPQeA==", + "dev": true, + "requires": { + "md5.js": "1.3.4", + "safe-buffer": "5.1.1" + } + }, + "expand-braces": { + "version": "0.1.2", + "resolved": "https://registry.npmjs.org/expand-braces/-/expand-braces-0.1.2.tgz", + "integrity": "sha1-SIsdHSRRyz06axks/AMPRMWFX+o=", + "dev": true, + "requires": { + "array-slice": "0.2.3", + "array-unique": "0.2.1", + "braces": "0.1.5" + }, + "dependencies": { + "braces": { + "version": "0.1.5", + "resolved": "https://registry.npmjs.org/braces/-/braces-0.1.5.tgz", + "integrity": "sha1-wIVxEIUpHYt1/ddOqw+FlygHEeY=", + "dev": true, + "requires": { + "expand-range": "0.1.1" + } + }, + "expand-range": { + "version": "0.1.1", + "resolved": "https://registry.npmjs.org/expand-range/-/expand-range-0.1.1.tgz", + "integrity": "sha1-TLjtoJk8pW+k9B/ELzy7TMrf8EQ=", + "dev": true, + "requires": { + "is-number": "0.1.1", + "repeat-string": "0.2.2" + } + }, + "is-number": { + "version": "0.1.1", + "resolved": "https://registry.npmjs.org/is-number/-/is-number-0.1.1.tgz", + "integrity": "sha1-aaevEWlj1HIG7JvZtIoUIW8eOAY=", + "dev": true + }, + "repeat-string": { + "version": "0.2.2", + "resolved": "https://registry.npmjs.org/repeat-string/-/repeat-string-0.2.2.tgz", + "integrity": "sha1-x6jTI2BoNiBZp+RlH8aITosftK4=", + "dev": true + } + } + }, + "expand-brackets": { + "version": "0.1.5", + "resolved": "https://registry.npmjs.org/expand-brackets/-/expand-brackets-0.1.5.tgz", + "integrity": "sha1-3wcoTjQqgHzXM6xa9yQR5YHRF3s=", + "dev": true, + "requires": { + "is-posix-bracket": "0.1.1" + } + }, + "expand-range": { + "version": "1.8.2", + "resolved": "https://registry.npmjs.org/expand-range/-/expand-range-1.8.2.tgz", + "integrity": "sha1-opnv/TNf4nIeuujiV+x5ZE/IUzc=", + "dev": true, + "requires": { + "fill-range": "2.2.3" + } + }, + "extend": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/extend/-/extend-3.0.1.tgz", + "integrity": "sha1-p1Xqe8Gt/MWjHOfnYtuq3F5jZEQ=", + "dev": true + }, + "external-editor": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/external-editor/-/external-editor-2.1.0.tgz", + "integrity": "sha512-E44iT5QVOUJBKij4IIV3uvxuNlbKS38Tw1HiupxEIHPv9qtC2PrDYohbXV5U+1jnfIXttny8gUhj+oZvflFlzA==", + "dev": true, + "requires": { + "chardet": "0.4.2", + "iconv-lite": "0.4.19", + "tmp": "0.0.33" + }, + "dependencies": { + "tmp": { + "version": "0.0.33", + "resolved": "https://registry.npmjs.org/tmp/-/tmp-0.0.33.tgz", + "integrity": "sha512-jRCJlojKnZ3addtTOjdIqoRuPEKBvNXcGYqzO6zWZX8KfKEpnGY5jfggJQ3EjKuu8D4bJRr0y+cYJFmYbImXGw==", + "dev": true, + "requires": { + "os-tmpdir": "1.0.2" + } + } + } + }, + "extglob": { + "version": "0.3.2", + "resolved": "https://registry.npmjs.org/extglob/-/extglob-0.3.2.tgz", + "integrity": "sha1-Lhj/PS9JqydlzskCPwEdqo2DSaE=", + "dev": true, + "requires": { + "is-extglob": "1.0.0" + } + }, + "extsprintf": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/extsprintf/-/extsprintf-1.3.0.tgz", + "integrity": "sha1-lpGEQOMEGnpBT4xS48V06zw+HgU=", + "dev": true + }, + "fast-deep-equal": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-1.0.0.tgz", + "integrity": "sha1-liVqO8l1WV6zbYLpkp0GDYk0Of8=", + "dev": true + }, + "fast-json-stable-stringify": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/fast-json-stable-stringify/-/fast-json-stable-stringify-2.0.0.tgz", + "integrity": "sha1-1RQsDK7msRifh9OnYREGT4bIu/I=", + "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": "2.0.0", + "resolved": "https://registry.npmjs.org/figures/-/figures-2.0.0.tgz", + "integrity": "sha1-OrGi0qYsi/tDGgyUy3l6L84nyWI=", + "dev": true, + "requires": { + "escape-string-regexp": "1.0.5" + } + }, + "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, + "requires": { + "flat-cache": "1.3.0", + "object-assign": "4.1.1" + } + }, + "filename-regex": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/filename-regex/-/filename-regex-2.0.1.tgz", + "integrity": "sha1-wcS5vuPglyXdsQa3XB4wH+LxiyY=", + "dev": true + }, + "fill-range": { + "version": "2.2.3", + "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-2.2.3.tgz", + "integrity": "sha1-ULd9/X5Gm8dJJHCWNpn+eoSFpyM=", + "dev": true, + "requires": { + "is-number": "2.1.0", + "isobject": "2.1.0", + "randomatic": "1.1.7", + "repeat-element": "1.1.2", + "repeat-string": "1.6.1" + } + }, + "finalhandler": { + "version": "1.0.6", + "resolved": "https://registry.npmjs.org/finalhandler/-/finalhandler-1.0.6.tgz", + "integrity": "sha1-AHrqM9Gk0+QgF/YkhIrVjSEvgU8=", + "dev": true, + "requires": { + "debug": "2.6.9", + "encodeurl": "1.0.2", + "escape-html": "1.0.3", + "on-finished": "2.3.0", + "parseurl": "1.3.2", + "statuses": "1.3.1", + "unpipe": "1.0.0" + }, + "dependencies": { + "statuses": { + "version": "1.3.1", + "resolved": "https://registry.npmjs.org/statuses/-/statuses-1.3.1.tgz", + "integrity": "sha1-+vUbnrdKrvOzrPStX2Gr8ky3uT4=", + "dev": true + } + } + }, + "flat-cache": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/flat-cache/-/flat-cache-1.3.0.tgz", + "integrity": "sha1-0wMLMrOBVPTjt+nHCfSQ9++XxIE=", + "dev": true, + "requires": { + "circular-json": "0.3.3", + "del": "2.2.2", + "graceful-fs": "4.1.11", + "write": "0.2.1" + } + }, + "for-in": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/for-in/-/for-in-1.0.2.tgz", + "integrity": "sha1-gQaNKVqBQuwKxybG4iAMMPttXoA=", + "dev": true + }, + "for-own": { + "version": "0.1.5", + "resolved": "https://registry.npmjs.org/for-own/-/for-own-0.1.5.tgz", + "integrity": "sha1-UmXGgaTylNq78XyVCbZ2OqhFEM4=", + "dev": true, + "requires": { + "for-in": "1.0.2" + } + }, + "forever-agent": { + "version": "0.6.1", + "resolved": "https://registry.npmjs.org/forever-agent/-/forever-agent-0.6.1.tgz", + "integrity": "sha1-+8cfDEGt6zf5bFd60e1C2P2sypE=", + "dev": true + }, + "form-data": { + "version": "2.3.1", + "resolved": "https://registry.npmjs.org/form-data/-/form-data-2.3.1.tgz", + "integrity": "sha1-b7lPvXGIUwbXPRXMSX/kzE7NRL8=", + "dev": true, + "requires": { + "asynckit": "0.4.0", + "combined-stream": "1.0.5", + "mime-types": "2.1.17" + } + }, + "fs-access": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/fs-access/-/fs-access-1.0.1.tgz", + "integrity": "sha1-1qh/JiJxzv6+wwxVNAf7mV2od3o=", + "dev": true, + "requires": { + "null-check": "1.0.0" + } + }, + "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, + "requires": { + "graceful-fs": "4.1.11", + "jsonfile": "2.4.0", + "klaw": "1.3.1" + } + }, + "fs.realpath": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz", + "integrity": "sha1-FQStJSMVjKpA20onh8sBQRmU6k8=", + "dev": true + }, + "fsevents": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-1.1.3.tgz", + "integrity": "sha512-WIr7iDkdmdbxu/Gh6eKEZJL6KPE74/5MEsf2whTOFNxbIoIixogroLdKYqB6FDav4Wavh/lZdzzd3b2KxIXC5Q==", + "dev": true, + "optional": true, + "requires": { + "nan": "2.8.0", + "node-pre-gyp": "0.6.39" + }, + "dependencies": { + "abbrev": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/abbrev/-/abbrev-1.1.0.tgz", + "integrity": "sha1-0FVMIlZjbi9W58LlrRg/hZQo2B8=", + "dev": true, + "optional": true + }, + "ajv": { + "version": "4.11.8", + "resolved": "https://registry.npmjs.org/ajv/-/ajv-4.11.8.tgz", + "integrity": "sha1-gv+wKynmYq5TvcIK8VlHcGc5xTY=", + "dev": true, + "optional": true, + "requires": { + "co": "4.6.0", + "json-stable-stringify": "1.0.1" + } + }, + "ansi-regex": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-2.1.1.tgz", + "integrity": "sha1-w7M6te42DYbg5ijwRorn7yfWVN8=", + "dev": true + }, + "aproba": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/aproba/-/aproba-1.1.1.tgz", + "integrity": "sha1-ldNgDwdxCqDpKYxyatXs8urLq6s=", + "dev": true, + "optional": true + }, + "are-we-there-yet": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/are-we-there-yet/-/are-we-there-yet-1.1.4.tgz", + "integrity": "sha1-u13KOCu5TwXhUZQ3PRb9O6HKEQ0=", + "dev": true, + "optional": true, + "requires": { + "delegates": "1.0.0", + "readable-stream": "2.2.9" + } + }, + "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 + }, + "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 + }, + "balanced-match": { + "version": "0.4.2", + "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-0.4.2.tgz", + "integrity": "sha1-yz8+PHMtwPAe5wtAPzAuYddwmDg=", + "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, + "requires": { + "tweetnacl": "0.14.5" + } + }, + "block-stream": { + "version": "0.0.9", + "resolved": "https://registry.npmjs.org/block-stream/-/block-stream-0.0.9.tgz", + "integrity": "sha1-E+v+d4oDIFz+A3UUgeu0szAMEmo=", + "dev": true, + "requires": { + "inherits": "2.0.3" + } + }, + "boom": { + "version": "2.10.1", + "resolved": "https://registry.npmjs.org/boom/-/boom-2.10.1.tgz", + "integrity": "sha1-OciRjO/1eZ+D+UkqhI9iWt0Mdm8=", + "dev": true, + "requires": { + "hoek": "2.16.3" + } + }, + "brace-expansion": { + "version": "1.1.7", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.7.tgz", + "integrity": "sha1-Pv/DxQ4ABTH7cg6v+A8K6O8jz1k=", + "dev": true, + "requires": { + "balanced-match": "0.4.2", + "concat-map": "0.0.1" + } + }, + "buffer-shims": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/buffer-shims/-/buffer-shims-1.0.0.tgz", + "integrity": "sha1-mXjOMXOIxkmth5MCjDR37wRKi1E=", + "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 + }, + "co": { + "version": "4.6.0", + "resolved": "https://registry.npmjs.org/co/-/co-4.6.0.tgz", + "integrity": "sha1-bqa989hTrlTMuOR7+gvz+QMfsYQ=", + "dev": true, + "optional": 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 + }, + "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, + "requires": { + "delayed-stream": "1.0.0" + } + }, + "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 + }, + "console-control-strings": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/console-control-strings/-/console-control-strings-1.1.0.tgz", + "integrity": "sha1-PXz0Rk22RG6mRL9LOVB/mFEAjo4=", + "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, + "requires": { + "boom": "2.10.1" + } + }, + "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, + "requires": { + "assert-plus": "1.0.0" + }, + "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, + "optional": true, + "requires": { + "ms": "2.0.0" + } + }, + "deep-extend": { + "version": "0.4.2", + "resolved": "https://registry.npmjs.org/deep-extend/-/deep-extend-0.4.2.tgz", + "integrity": "sha1-SLaZwn4zS/ifEIkr5DL25MfTSn8=", + "dev": true, + "optional": 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 + }, + "delegates": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/delegates/-/delegates-1.0.0.tgz", + "integrity": "sha1-hMbhWbgZBP3KWaDvRM2HDTElD5o=", + "dev": true, + "optional": true + }, + "detect-libc": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/detect-libc/-/detect-libc-1.0.2.tgz", + "integrity": "sha1-ca1dIEvxempsqPRQxhRUBm70YeE=", + "dev": true, + "optional": 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, + "requires": { + "jsbn": "0.1.1" + } + }, + "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 + }, + "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, + "requires": { + "asynckit": "0.4.0", + "combined-stream": "1.0.5", + "mime-types": "2.1.15" + } + }, + "fs.realpath": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz", + "integrity": "sha1-FQStJSMVjKpA20onh8sBQRmU6k8=", + "dev": true + }, + "fstream": { + "version": "1.0.11", + "resolved": "https://registry.npmjs.org/fstream/-/fstream-1.0.11.tgz", + "integrity": "sha1-XB+x8RdHcRTwYyoOtLcbPLD9MXE=", + "dev": true, + "requires": { + "graceful-fs": "4.1.11", + "inherits": "2.0.3", + "mkdirp": "0.5.1", + "rimraf": "2.6.1" + } + }, + "fstream-ignore": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/fstream-ignore/-/fstream-ignore-1.0.5.tgz", + "integrity": "sha1-nDHa40dnAY/h0kmyTa2mfQktoQU=", + "dev": true, + "optional": true, + "requires": { + "fstream": "1.0.11", + "inherits": "2.0.3", + "minimatch": "3.0.4" + } + }, + "gauge": { + "version": "2.7.4", + "resolved": "https://registry.npmjs.org/gauge/-/gauge-2.7.4.tgz", + "integrity": "sha1-LANAXHU4w51+s3sxcCLjJfsBi/c=", + "dev": true, + "optional": true, + "requires": { + "aproba": "1.1.1", + "console-control-strings": "1.1.0", + "has-unicode": "2.0.1", + "object-assign": "4.1.1", + "signal-exit": "3.0.2", + "string-width": "1.0.2", + "strip-ansi": "3.0.1", + "wide-align": "1.1.2" + } + }, + "getpass": { + "version": "0.1.7", + "resolved": "https://registry.npmjs.org/getpass/-/getpass-0.1.7.tgz", + "integrity": "sha1-Xv+OPmhNVprkyysSgmBOi6YhSfo=", + "dev": true, + "optional": true, + "requires": { + "assert-plus": "1.0.0" + }, + "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, + "requires": { + "fs.realpath": "1.0.0", + "inflight": "1.0.6", + "inherits": "2.0.3", + "minimatch": "3.0.4", + "once": "1.4.0", + "path-is-absolute": "1.0.1" + } + }, + "graceful-fs": { + "version": "4.1.11", + "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.1.11.tgz", + "integrity": "sha1-Dovf5NHduIVNZOBOp8AOKgJuVlg=", + "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, + "requires": { + "ajv": "4.11.8", + "har-schema": "1.0.5" + } + }, + "has-unicode": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/has-unicode/-/has-unicode-2.0.1.tgz", + "integrity": "sha1-4Ob+aijPUROIVeCG0Wkedx3iqLk=", + "dev": true, + "optional": true + }, + "hawk": { + "version": "3.1.3", + "resolved": "https://registry.npmjs.org/hawk/-/hawk-3.1.3.tgz", + "integrity": "sha1-B4REvXwWQLD+VA0sm3PVlnjo4cQ=", + "dev": true, + "requires": { + "boom": "2.10.1", + "cryptiles": "2.0.5", + "hoek": "2.16.3", + "sntp": "1.0.9" + } + }, + "hoek": { + "version": "2.16.3", + "resolved": "https://registry.npmjs.org/hoek/-/hoek-2.16.3.tgz", + "integrity": "sha1-ILt0A9POo5jpHcRxCo/xuCdKJe0=", + "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, + "requires": { + "assert-plus": "0.2.0", + "jsprim": "1.4.0", + "sshpk": "1.13.0" + } + }, + "inflight": { + "version": "1.0.6", + "resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz", + "integrity": "sha1-Sb1jMdfQLQwJvJEKEHW6gWW1bfk=", + "dev": true, + "requires": { + "once": "1.4.0", + "wrappy": "1.0.2" + } + }, + "inherits": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.3.tgz", + "integrity": "sha1-Yzwsg+PaQqUC9SRmAiSA9CCCYd4=", + "dev": true + }, + "ini": { + "version": "1.3.4", + "resolved": "https://registry.npmjs.org/ini/-/ini-1.3.4.tgz", + "integrity": "sha1-BTfLedr1m1mhpRff9wbIbsA5Fi4=", + "dev": true, + "optional": 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, + "requires": { + "number-is-nan": "1.0.1" + } + }, + "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 + }, + "jodid25519": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/jodid25519/-/jodid25519-1.0.2.tgz", + "integrity": "sha1-BtSRIlUJNBlHfUJWM2BuDpB4KWc=", + "dev": true, + "optional": true, + "requires": { + "jsbn": "0.1.1" + } + }, + "jsbn": { + "version": "0.1.1", + "resolved": "https://registry.npmjs.org/jsbn/-/jsbn-0.1.1.tgz", + "integrity": "sha1-peZUwuWi3rXyAdls77yoDA7y9RM=", + "dev": true, + "optional": 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, + "optional": true, + "requires": { + "jsonify": "0.0.0" + } + }, + "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 + }, + "jsonify": { + "version": "0.0.0", + "resolved": "https://registry.npmjs.org/jsonify/-/jsonify-0.0.0.tgz", + "integrity": "sha1-LHS27kHZPKUbe1qu6PUDYx0lKnM=", + "dev": true, + "optional": 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, + "requires": { + "assert-plus": "1.0.0", + "extsprintf": "1.0.2", + "json-schema": "0.2.3", + "verror": "1.3.6" + }, + "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 + } + } + }, + "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, + "requires": { + "mime-db": "1.27.0" + } + }, + "minimatch": { + "version": "3.0.4", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.0.4.tgz", + "integrity": "sha512-yJHVQEhyqPLUTgt9B83PXu6W3rx4MvvHvSUvToogpwoGDOUQ+yDrR0HRot+yOCdCO7u4hX3pWft6kWBBcqh0UA==", + "dev": true, + "requires": { + "brace-expansion": "1.1.7" + } + }, + "minimist": { + "version": "0.0.8", + "resolved": "https://registry.npmjs.org/minimist/-/minimist-0.0.8.tgz", + "integrity": "sha1-hX/Kv8M5fSYluCKCYuhqp6ARsF0=", + "dev": true + }, + "mkdirp": { + "version": "0.5.1", + "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-0.5.1.tgz", + "integrity": "sha1-MAV0OOrGz3+MR2fzhkjWaX11yQM=", + "dev": true, + "requires": { + "minimist": "0.0.8" + } + }, + "ms": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", + "integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=", + "dev": true, + "optional": true + }, + "node-pre-gyp": { + "version": "0.6.39", + "resolved": "https://registry.npmjs.org/node-pre-gyp/-/node-pre-gyp-0.6.39.tgz", + "integrity": "sha512-OsJV74qxnvz/AMGgcfZoDaeDXKD3oY3QVIbBmwszTFkRisTSXbMQyn4UWzUMOtA5SVhrBZOTp0wcoSBgfMfMmQ==", + "dev": true, + "optional": true, + "requires": { + "detect-libc": "1.0.2", + "hawk": "3.1.3", + "mkdirp": "0.5.1", + "nopt": "4.0.1", + "npmlog": "4.1.0", + "rc": "1.2.1", + "request": "2.81.0", + "rimraf": "2.6.1", + "semver": "5.3.0", + "tar": "2.2.1", + "tar-pack": "3.4.0" + } + }, + "nopt": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/nopt/-/nopt-4.0.1.tgz", + "integrity": "sha1-0NRoWv1UFRk8jHUFYC0NF81kR00=", + "dev": true, + "optional": true, + "requires": { + "abbrev": "1.1.0", + "osenv": "0.1.4" + } + }, + "npmlog": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/npmlog/-/npmlog-4.1.0.tgz", + "integrity": "sha512-ocolIkZYZt8UveuiDS0yAkkIjid1o7lPG8cYm05yNYzBn8ykQtaiPMEGp8fY9tKdDgm8okpdKzkvu1y9hUYugA==", + "dev": true, + "optional": true, + "requires": { + "are-we-there-yet": "1.1.4", + "console-control-strings": "1.1.0", + "gauge": "2.7.4", + "set-blocking": "2.0.0" + } + }, + "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 + }, + "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, + "optional": true + }, + "once": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz", + "integrity": "sha1-WDsap3WWHUsROsF9nFC6753Xa9E=", + "dev": true, + "requires": { + "wrappy": "1.0.2" + } + }, + "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, + "optional": 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, + "optional": true + }, + "osenv": { + "version": "0.1.4", + "resolved": "https://registry.npmjs.org/osenv/-/osenv-0.1.4.tgz", + "integrity": "sha1-Qv5tWVPfBsgGS+bxdsPQWqqjRkQ=", + "dev": true, + "optional": true, + "requires": { + "os-homedir": "1.0.2", + "os-tmpdir": "1.0.2" + } + }, + "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 + }, + "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 + }, + "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 + }, + "punycode": { + "version": "1.4.1", + "resolved": "https://registry.npmjs.org/punycode/-/punycode-1.4.1.tgz", + "integrity": "sha1-wNWmOycYgArY4esPpSachN1BhF4=", + "dev": true, + "optional": 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 + }, + "rc": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/rc/-/rc-1.2.1.tgz", + "integrity": "sha1-LgPo5C7kULjLPc5lvhv4l04d/ZU=", + "dev": true, + "optional": true, + "requires": { + "deep-extend": "0.4.2", + "ini": "1.3.4", + "minimist": "1.2.0", + "strip-json-comments": "2.0.1" + }, + "dependencies": { + "minimist": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.0.tgz", + "integrity": "sha1-o1AIsg9BOD7sH7kU9M1d95omQoQ=", + "dev": true, + "optional": true + } + } + }, + "readable-stream": { + "version": "2.2.9", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.2.9.tgz", + "integrity": "sha1-z3jsb0ptHrQ9JkiMrJfwQudLf8g=", + "dev": true, + "requires": { + "buffer-shims": "1.0.0", + "core-util-is": "1.0.2", + "inherits": "2.0.3", + "isarray": "1.0.0", + "process-nextick-args": "1.0.7", + "string_decoder": "1.0.1", + "util-deprecate": "1.0.2" + } + }, + "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, + "requires": { + "aws-sign2": "0.6.0", + "aws4": "1.6.0", + "caseless": "0.12.0", + "combined-stream": "1.0.5", + "extend": "3.0.1", + "forever-agent": "0.6.1", + "form-data": "2.1.4", + "har-validator": "4.2.1", + "hawk": "3.1.3", + "http-signature": "1.1.1", + "is-typedarray": "1.0.0", + "isstream": "0.1.2", + "json-stringify-safe": "5.0.1", + "mime-types": "2.1.15", + "oauth-sign": "0.8.2", + "performance-now": "0.2.0", + "qs": "6.4.0", + "safe-buffer": "5.0.1", + "stringstream": "0.0.5", + "tough-cookie": "2.3.2", + "tunnel-agent": "0.6.0", + "uuid": "3.0.1" + } + }, + "rimraf": { + "version": "2.6.1", + "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-2.6.1.tgz", + "integrity": "sha1-wjOOxkPfeht/5cVPqG9XQopV8z0=", + "dev": true, + "requires": { + "glob": "7.1.2" + } + }, + "safe-buffer": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.0.1.tgz", + "integrity": "sha1-0mPKVGls2KMGtcplUekt5XkY++c=", + "dev": true + }, + "semver": { + "version": "5.3.0", + "resolved": "https://registry.npmjs.org/semver/-/semver-5.3.0.tgz", + "integrity": "sha1-myzl094C0XxgEq0yaqa00M9U+U8=", + "dev": true, + "optional": true + }, + "set-blocking": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/set-blocking/-/set-blocking-2.0.0.tgz", + "integrity": "sha1-BF+XgtARrppoA93TgrJDkrPYkPc=", + "dev": true, + "optional": true + }, + "signal-exit": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-3.0.2.tgz", + "integrity": "sha1-tf3AjxKH6hF4Yo5BXiUTK3NkbG0=", + "dev": true, + "optional": true + }, + "sntp": { + "version": "1.0.9", + "resolved": "https://registry.npmjs.org/sntp/-/sntp-1.0.9.tgz", + "integrity": "sha1-ZUEYTMkK7qbG57NeJlkIJEPGYZg=", + "dev": true, + "requires": { + "hoek": "2.16.3" + } + }, + "sshpk": { + "version": "1.13.0", + "resolved": "https://registry.npmjs.org/sshpk/-/sshpk-1.13.0.tgz", + "integrity": "sha1-/yo+T9BEl1Vf7Zezmg/YL6+zozw=", + "dev": true, + "optional": true, + "requires": { + "asn1": "0.2.3", + "assert-plus": "1.0.0", + "bcrypt-pbkdf": "1.0.1", + "dashdash": "1.14.1", + "ecc-jsbn": "0.1.1", + "getpass": "0.1.7", + "jodid25519": "1.0.2", + "jsbn": "0.1.1", + "tweetnacl": "0.14.5" + }, + "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, + "requires": { + "code-point-at": "1.1.0", + "is-fullwidth-code-point": "1.0.0", + "strip-ansi": "3.0.1" + } + }, + "string_decoder": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.0.1.tgz", + "integrity": "sha1-YuIA8DmVWmgQ2N8KM//A8BNmLZg=", + "dev": true, + "requires": { + "safe-buffer": "5.0.1" + } + }, + "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, + "requires": { + "ansi-regex": "2.1.1" + } + }, + "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, + "optional": true + }, + "tar": { + "version": "2.2.1", + "resolved": "https://registry.npmjs.org/tar/-/tar-2.2.1.tgz", + "integrity": "sha1-jk0qJWwOIYXGsYrWlK7JaLg8sdE=", + "dev": true, + "requires": { + "block-stream": "0.0.9", + "fstream": "1.0.11", + "inherits": "2.0.3" + } + }, + "tar-pack": { + "version": "3.4.0", + "resolved": "https://registry.npmjs.org/tar-pack/-/tar-pack-3.4.0.tgz", + "integrity": "sha1-I74tf2cagzk3bL2wuP4/3r8xeYQ=", + "dev": true, + "optional": true, + "requires": { + "debug": "2.6.8", + "fstream": "1.0.11", + "fstream-ignore": "1.0.5", + "once": "1.4.0", + "readable-stream": "2.2.9", + "rimraf": "2.6.1", + "tar": "2.2.1", + "uid-number": "0.0.6" + } + }, + "tough-cookie": { + "version": "2.3.2", + "resolved": "https://registry.npmjs.org/tough-cookie/-/tough-cookie-2.3.2.tgz", + "integrity": "sha1-8IH3bkyFcg5sN6X6ztc3FQ2EByo=", + "dev": true, + "optional": true, + "requires": { + "punycode": "1.4.1" + } + }, + "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, + "requires": { + "safe-buffer": "5.0.1" + } + }, + "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 + }, + "uid-number": { + "version": "0.0.6", + "resolved": "https://registry.npmjs.org/uid-number/-/uid-number-0.0.6.tgz", + "integrity": "sha1-DqEOgDXo61uOREnwbaHHMGY7qoE=", + "dev": true, + "optional": 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.0.1", + "resolved": "https://registry.npmjs.org/uuid/-/uuid-3.0.1.tgz", + "integrity": "sha1-ZUS7ot/ajBzxfmKaOjBeK7H+5sE=", + "dev": true, + "optional": 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, + "requires": { + "extsprintf": "1.0.2" + } + }, + "wide-align": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/wide-align/-/wide-align-1.1.2.tgz", + "integrity": "sha512-ijDLlyQ7s6x1JgCLur53osjm/UXUYD9+0PbYKrBsYisYXzCxN+HC3mYDNy/dWdmf3AwqwU3CXwDCvsNgGK1S0w==", + "dev": true, + "optional": true, + "requires": { + "string-width": "1.0.2" + } + }, + "wrappy": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz", + "integrity": "sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8=", + "dev": true + } + } + }, + "function-bind": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.1.tgz", + "integrity": "sha512-yIovAzMX49sF8Yl58fSCWJ5svSLuaibPxXQJFLmBObTuCr0Mf1KiPopGM9NiFjiYBCbfaa2Fh6breQ6ANVTI0A==", + "dev": true + }, + "functional-red-black-tree": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/functional-red-black-tree/-/functional-red-black-tree-1.0.1.tgz", + "integrity": "sha1-GwqzvVU7Kg1jmdKcDj6gslIHgyc=", + "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, + "requires": { + "is-property": "1.0.2" + } + }, + "getpass": { + "version": "0.1.7", + "resolved": "https://registry.npmjs.org/getpass/-/getpass-0.1.7.tgz", + "integrity": "sha1-Xv+OPmhNVprkyysSgmBOi6YhSfo=", + "dev": true, + "requires": { + "assert-plus": "1.0.0" + } + }, + "gettext-parser": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/gettext-parser/-/gettext-parser-1.1.0.tgz", + "integrity": "sha1-LFpmONiTk0ubVQN9CtgstwBLJnk=", + "dev": true, + "requires": { + "encoding": "0.1.12" + } + }, + "glob": { + "version": "7.1.2", + "resolved": "https://registry.npmjs.org/glob/-/glob-7.1.2.tgz", + "integrity": "sha512-MJTUg1kjuLeQCJ+ccE4Vpa6kKVXkPYJ2mOCQyUuKLcLQsdrMCpBPUi8qVE6+YuaJkozeA9NusTAw3hLr8Xe5EQ==", + "dev": true, + "requires": { + "fs.realpath": "1.0.0", + "inflight": "1.0.6", + "inherits": "2.0.3", + "minimatch": "3.0.4", + "once": "1.4.0", + "path-is-absolute": "1.0.1" + } + }, + "glob-base": { + "version": "0.3.0", + "resolved": "https://registry.npmjs.org/glob-base/-/glob-base-0.3.0.tgz", + "integrity": "sha1-27Fk9iIbHAscz4Kuoyi0l98Oo8Q=", + "dev": true, + "requires": { + "glob-parent": "2.0.0", + "is-glob": "2.0.1" + } + }, + "glob-parent": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-2.0.0.tgz", + "integrity": "sha1-gTg9ctsFT8zPUzbaqQLxgvbtuyg=", + "dev": true, + "requires": { + "is-glob": "2.0.1" + } + }, + "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, + "requires": { + "array-union": "1.0.2", + "arrify": "1.0.1", + "glob": "7.1.2", + "object-assign": "4.1.1", + "pify": "2.3.0", + "pinkie-promise": "2.0.1" + } + }, + "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": "2.0.0", + "resolved": "https://registry.npmjs.org/har-schema/-/har-schema-2.0.0.tgz", + "integrity": "sha1-qUwiJOvKwEeCoNkDVSHyRzW37JI=", + "dev": true + }, + "har-validator": { + "version": "5.0.3", + "resolved": "https://registry.npmjs.org/har-validator/-/har-validator-5.0.3.tgz", + "integrity": "sha1-ukAsJmGU8VlW7xXg/PJCmT9qff0=", + "dev": true, + "requires": { + "ajv": "5.5.2", + "har-schema": "2.0.0" + } + }, + "has": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/has/-/has-1.0.1.tgz", + "integrity": "sha1-hGFzP1OLCDfJNh45qauelwTcLyg=", + "dev": true, + "requires": { + "function-bind": "1.1.1" + } + }, + "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, + "requires": { + "ansi-regex": "2.1.1" + } + }, + "has-binary": { + "version": "0.1.7", + "resolved": "https://registry.npmjs.org/has-binary/-/has-binary-0.1.7.tgz", + "integrity": "sha1-aOYesWIQyVRaClzOBqhzkS/h5ow=", + "dev": true, + "requires": { + "isarray": "0.0.1" + }, + "dependencies": { + "isarray": { + "version": "0.0.1", + "resolved": "https://registry.npmjs.org/isarray/-/isarray-0.0.1.tgz", + "integrity": "sha1-ihis/Kmo9Bd+Cav8YDiTmwXR7t8=", + "dev": true + } + } + }, + "has-color": { + "version": "0.1.7", + "resolved": "https://registry.npmjs.org/has-color/-/has-color-0.1.7.tgz", + "integrity": "sha1-ZxRKUmDDT8PMpnfQQdr1L+e3iy8=", + "dev": true + }, + "has-cors": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/has-cors/-/has-cors-1.1.0.tgz", + "integrity": "sha1-XkdHk/fqmEPRu5nCPu9J/xJv/zk=", + "dev": true + }, + "has-flag": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-2.0.0.tgz", + "integrity": "sha1-6CB68cx7MNRGzHC3NLXovhj4jVE=", + "dev": true + }, + "hash-base": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/hash-base/-/hash-base-2.0.2.tgz", + "integrity": "sha1-ZuodhW206KVHDK32/OI65SRO8uE=", + "dev": true, + "requires": { + "inherits": "2.0.3" + } + }, + "hash.js": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/hash.js/-/hash.js-1.1.3.tgz", + "integrity": "sha512-/UETyP0W22QILqS+6HowevwhEFJ3MBJnwTf75Qob9Wz9t0DPuisL8kW8YZMK62dHAKE1c1p+gY1TtOLY+USEHA==", + "dev": true, + "requires": { + "inherits": "2.0.3", + "minimalistic-assert": "1.0.0" + } + }, + "hawk": { + "version": "6.0.2", + "resolved": "https://registry.npmjs.org/hawk/-/hawk-6.0.2.tgz", + "integrity": "sha512-miowhl2+U7Qle4vdLqDdPt9m09K6yZhkLDTWGoUiUzrQCn+mHHSmfJgAyGaLRZbPmTqfFFjRV1QWCW0VWUJBbQ==", + "dev": true, + "requires": { + "boom": "4.3.1", + "cryptiles": "3.1.2", + "hoek": "4.2.0", + "sntp": "2.1.0" + } + }, + "he": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/he/-/he-1.1.1.tgz", + "integrity": "sha1-k0EP0hsAlzUVH4howvJx80J+I/0=", + "dev": true + }, + "hmac-drbg": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/hmac-drbg/-/hmac-drbg-1.0.1.tgz", + "integrity": "sha1-0nRXAQJabHdabFRXk+1QL8DGSaE=", + "dev": true, + "requires": { + "hash.js": "1.1.3", + "minimalistic-assert": "1.0.0", + "minimalistic-crypto-utils": "1.0.1" + } + }, + "hoek": { + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/hoek/-/hoek-4.2.0.tgz", + "integrity": "sha512-v0XCLxICi9nPfYrS9RL8HbYnXi9obYAeLbSP00BmnZwCK9+Ih9WOjoZ8YoHCoav2csqn4FOz4Orldsy2dmDwmQ==", + "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, + "requires": { + "os-homedir": "1.0.2", + "os-tmpdir": "1.0.2" + } + }, + "html-encoding-sniffer": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/html-encoding-sniffer/-/html-encoding-sniffer-1.0.2.tgz", + "integrity": "sha512-71lZziiDnsuabfdYiUeWdCVyKuqwWi23L8YeIgV9jSSZHCtb6wB1BKWooH7L3tn4/FuZJMVWyNaIDr4RGmaSYw==", + "dev": true, + "requires": { + "whatwg-encoding": "1.0.3" + } + }, + "htmlescape": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/htmlescape/-/htmlescape-1.1.1.tgz", + "integrity": "sha1-OgPtwiFLyjtmQko+eVk0lQnLA1E=", + "dev": true + }, + "http-errors": { + "version": "1.6.2", + "resolved": "https://registry.npmjs.org/http-errors/-/http-errors-1.6.2.tgz", + "integrity": "sha1-CgAsyFcHGSp+eUbO7cERVfYOxzY=", + "dev": true, + "requires": { + "depd": "1.1.1", + "inherits": "2.0.3", + "setprototypeof": "1.0.3", + "statuses": "1.4.0" + }, + "dependencies": { + "depd": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/depd/-/depd-1.1.1.tgz", + "integrity": "sha1-V4O04cRZ8G+lyif5kfPQbnoxA1k=", + "dev": true + } + } + }, + "http-proxy": { + "version": "1.16.2", + "resolved": "https://registry.npmjs.org/http-proxy/-/http-proxy-1.16.2.tgz", + "integrity": "sha1-Bt/ykpUr9k2+hHH6nfcwZtTzd0I=", + "dev": true, + "requires": { + "eventemitter3": "1.2.0", + "requires-port": "1.0.0" + } + }, + "http-signature": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/http-signature/-/http-signature-1.2.0.tgz", + "integrity": "sha1-muzZJRFHcvPZW2WmCruPfBj7rOE=", + "dev": true, + "requires": { + "assert-plus": "1.0.0", + "jsprim": "1.4.1", + "sshpk": "1.13.1" + } + }, + "https-browserify": { + "version": "0.0.1", + "resolved": "https://registry.npmjs.org/https-browserify/-/https-browserify-0.0.1.tgz", + "integrity": "sha1-P5E2XKvmC3ftDruiS0VOPgnZWoI=", + "dev": true + }, + "https-proxy-agent": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/https-proxy-agent/-/https-proxy-agent-1.0.0.tgz", + "integrity": "sha1-NffabEjOTdv6JkiRrFk+5f+GceY=", + "dev": true, + "requires": { + "agent-base": "2.1.1", + "debug": "2.6.9", + "extend": "3.0.1" + } + }, + "iconv-lite": { + "version": "0.4.19", + "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.4.19.tgz", + "integrity": "sha512-oTZqweIP51xaGPI4uPa56/Pri/480R+mo7SeU+YETByQNhDG55ycFyNLIgta9vXhILrxXDmF7ZGhqZIcuN0gJQ==", + "dev": true + }, + "ieee754": { + "version": "1.1.8", + "resolved": "https://registry.npmjs.org/ieee754/-/ieee754-1.1.8.tgz", + "integrity": "sha1-vjPUCsEO8ZJnAfbwii2G+/0a0+Q=", + "dev": true + }, + "ignore": { + "version": "3.3.7", + "resolved": "https://registry.npmjs.org/ignore/-/ignore-3.3.7.tgz", + "integrity": "sha512-YGG3ejvBNHRqu0559EOxxNFihD0AjpvHlC/pdGKd3X3ofe+CoJkYazwNJYTNebqpPKN+VVQbh4ZFn1DivMNuHA==", + "dev": true + }, + "imurmurhash": { + "version": "0.1.4", + "resolved": "https://registry.npmjs.org/imurmurhash/-/imurmurhash-0.1.4.tgz", + "integrity": "sha1-khi5srkoojixPcT7a21XbyMUU+o=", + "dev": true + }, + "indexof": { + "version": "0.0.1", + "resolved": "https://registry.npmjs.org/indexof/-/indexof-0.0.1.tgz", + "integrity": "sha1-gtwzbSMrkGIXnQWrMpOmYFn9Q10=", + "dev": true + }, + "inflight": { + "version": "1.0.6", + "resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz", + "integrity": "sha1-Sb1jMdfQLQwJvJEKEHW6gWW1bfk=", + "dev": true, + "requires": { + "once": "1.4.0", + "wrappy": "1.0.2" + } + }, + "inherits": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.3.tgz", + "integrity": "sha1-Yzwsg+PaQqUC9SRmAiSA9CCCYd4=", + "dev": true + }, + "inline-source-map": { + "version": "0.6.2", + "resolved": "https://registry.npmjs.org/inline-source-map/-/inline-source-map-0.6.2.tgz", + "integrity": "sha1-+Tk0ccGKedFyT4Y/o4tYY3Ct4qU=", + "dev": true, + "requires": { + "source-map": "0.5.7" + } + }, + "inquirer": { + "version": "3.3.0", + "resolved": "https://registry.npmjs.org/inquirer/-/inquirer-3.3.0.tgz", + "integrity": "sha512-h+xtnyk4EwKvFWHrUYsWErEVR+igKtLdchu+o0Z1RL7VU/jVMFbYir2bp6bAj8efFNxWqHX0dIss6fJQ+/+qeQ==", + "dev": true, + "requires": { + "ansi-escapes": "3.0.0", + "chalk": "2.3.0", + "cli-cursor": "2.1.0", + "cli-width": "2.2.0", + "external-editor": "2.1.0", + "figures": "2.0.0", + "lodash": "4.17.4", + "mute-stream": "0.0.7", + "run-async": "2.3.0", + "rx-lite": "4.0.8", + "rx-lite-aggregates": "4.0.8", + "string-width": "2.1.1", + "strip-ansi": "4.0.0", + "through": "2.3.8" + }, + "dependencies": { + "ansi-regex": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-3.0.0.tgz", + "integrity": "sha1-7QMXwyIGT3lGbAKWa922Bas32Zg=", + "dev": true + }, + "ansi-styles": { + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.0.tgz", + "integrity": "sha512-NnSOmMEYtVR2JVMIGTzynRkkaxtiq1xnFBcdQD/DnNCYPoEPsVJhM98BDyaoNOQIi7p4okdi3E27eN7GQbsUug==", + "dev": true, + "requires": { + "color-convert": "1.9.1" + } + }, + "chalk": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.3.0.tgz", + "integrity": "sha512-Az5zJR2CBujap2rqXGaJKaPHyJ0IrUimvYNX+ncCy8PJP4ltOGTrHUIo097ZaL2zMeKYpiCdqDvS6zdrTFok3Q==", + "dev": true, + "requires": { + "ansi-styles": "3.2.0", + "escape-string-regexp": "1.0.5", + "supports-color": "4.5.0" + } + }, + "strip-ansi": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-4.0.0.tgz", + "integrity": "sha1-qEeQIusaw2iocTibY1JixQXuNo8=", + "dev": true, + "requires": { + "ansi-regex": "3.0.0" + } + }, + "supports-color": { + "version": "4.5.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-4.5.0.tgz", + "integrity": "sha1-vnoN5ITexcXN34s9WRJQRJEvY1s=", + "dev": true, + "requires": { + "has-flag": "2.0.0" + } + } + } + }, + "insert-module-globals": { + "version": "7.0.1", + "resolved": "https://registry.npmjs.org/insert-module-globals/-/insert-module-globals-7.0.1.tgz", + "integrity": "sha1-wDv04BywhtW15azorQr+eInWOMM=", + "dev": true, + "requires": { + "JSONStream": "1.3.2", + "combine-source-map": "0.7.2", + "concat-stream": "1.5.2", + "is-buffer": "1.1.6", + "lexical-scope": "1.2.0", + "process": "0.11.10", + "through2": "2.0.3", + "xtend": "4.0.1" + }, + "dependencies": { + "combine-source-map": { + "version": "0.7.2", + "resolved": "https://registry.npmjs.org/combine-source-map/-/combine-source-map-0.7.2.tgz", + "integrity": "sha1-CHAxKFazB6h8xKxIbzqaYq7MwJ4=", + "dev": true, + "requires": { + "convert-source-map": "1.1.3", + "inline-source-map": "0.6.2", + "lodash.memoize": "3.0.4", + "source-map": "0.5.7" + } + }, + "convert-source-map": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/convert-source-map/-/convert-source-map-1.1.3.tgz", + "integrity": "sha1-SCnId+n+SbMWHzvzZziI4gRpmGA=", + "dev": true + } + } + }, + "invariant": { + "version": "2.2.2", + "resolved": "https://registry.npmjs.org/invariant/-/invariant-2.2.2.tgz", + "integrity": "sha1-nh9WrArNtr8wMwbzOL47IErmA2A=", + "dev": true, + "requires": { + "loose-envify": "1.3.1" + } + }, + "is-binary-path": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/is-binary-path/-/is-binary-path-1.0.1.tgz", + "integrity": "sha1-dfFmQrSA8YenEcgUFh/TpKdlWJg=", + "dev": true, + "requires": { + "binary-extensions": "1.11.0" + } + }, + "is-buffer": { + "version": "1.1.6", + "resolved": "https://registry.npmjs.org/is-buffer/-/is-buffer-1.1.6.tgz", + "integrity": "sha512-NcdALwpXkTm5Zvvbk7owOUSvVvBKDgKP5/ewfXEznmQFfs4ZRmanOeKBTjRVjka3QFoN6XJ+9F3USqfHqTaU5w==", + "dev": true + }, + "is-dotfile": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/is-dotfile/-/is-dotfile-1.0.3.tgz", + "integrity": "sha1-pqLzL/0t+wT1yiXs0Pa4PPeYoeE=", + "dev": true + }, + "is-equal-shallow": { + "version": "0.1.3", + "resolved": "https://registry.npmjs.org/is-equal-shallow/-/is-equal-shallow-0.1.3.tgz", + "integrity": "sha1-IjgJj8Ih3gvPpdnqxMRdY4qhxTQ=", + "dev": true, + "requires": { + "is-primitive": "2.0.0" + } + }, + "is-extendable": { + "version": "0.1.1", + "resolved": "https://registry.npmjs.org/is-extendable/-/is-extendable-0.1.1.tgz", + "integrity": "sha1-YrEQ4omkcUGOPsNqYX1HLjAd/Ik=", + "dev": true + }, + "is-extglob": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-extglob/-/is-extglob-1.0.0.tgz", + "integrity": "sha1-rEaBd8SUNAWgkvyPKXYMb/xiBsA=", + "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, + "requires": { + "number-is-nan": "1.0.1" + } + }, + "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 + }, + "is-glob": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-2.0.1.tgz", + "integrity": "sha1-0Jb5JqPe1WAPP9/ZEZjLCIjC2GM=", + "dev": true, + "requires": { + "is-extglob": "1.0.0" + } + }, + "is-my-json-valid": { + "version": "2.17.1", + "resolved": "https://registry.npmjs.org/is-my-json-valid/-/is-my-json-valid-2.17.1.tgz", + "integrity": "sha512-Q2khNw+oBlWuaYvEEHtKSw/pCxD2L5Rc1C+UQme9X6JdRDh7m5D7HkozA0qa3DUkQ6VzCnEm8mVIQPyIRkI5sQ==", + "dev": true, + "requires": { + "generate-function": "2.0.0", + "generate-object-property": "1.2.0", + "jsonpointer": "4.0.1", + "xtend": "4.0.1" + } + }, + "is-number": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/is-number/-/is-number-2.1.0.tgz", + "integrity": "sha1-Afy7s5NGOlSPL0ZszhbezknbkI8=", + "dev": true, + "requires": { + "kind-of": "3.2.2" + } + }, + "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, + "requires": { + "is-path-inside": "1.0.1" + } + }, + "is-path-inside": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/is-path-inside/-/is-path-inside-1.0.1.tgz", + "integrity": "sha1-jvW33lBDej/cprToZe96pVy0gDY=", + "dev": true, + "requires": { + "path-is-inside": "1.0.2" + } + }, + "is-posix-bracket": { + "version": "0.1.1", + "resolved": "https://registry.npmjs.org/is-posix-bracket/-/is-posix-bracket-0.1.1.tgz", + "integrity": "sha1-MzTceXdDaOkvAW5vvAqI9c1ua8Q=", + "dev": true + }, + "is-primitive": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/is-primitive/-/is-primitive-2.0.0.tgz", + "integrity": "sha1-IHurkWOEmcB7Kt8kCkGochADRXU=", + "dev": true + }, + "is-promise": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/is-promise/-/is-promise-2.1.0.tgz", + "integrity": "sha1-eaKp7OfwlugPNtKy87wWwf9L8/o=", + "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.1.0", + "resolved": "https://registry.npmjs.org/is-resolvable/-/is-resolvable-1.1.0.tgz", + "integrity": "sha512-qgDYXFSR5WvEfuS5dMj6oTMEbrrSaM0CrFk2Yiq/gXnBvD9pMa2jGXxyhGLfvhZpuMZe18CJpFxAt3CRs42NMg==", + "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 + }, + "isarray": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz", + "integrity": "sha1-u5NdSFgsuhaMBoNJV6VKPgcSTxE=", + "dev": true + }, + "isbinaryfile": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/isbinaryfile/-/isbinaryfile-3.0.2.tgz", + "integrity": "sha1-Sj6XTsDLqQBNP8bN5yCeppNopiE=", + "dev": true + }, + "isexe": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/isexe/-/isexe-2.0.0.tgz", + "integrity": "sha1-6PvzdNxVb/iUehDcsFctYz8s+hA=", + "dev": true + }, + "isobject": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/isobject/-/isobject-2.1.0.tgz", + "integrity": "sha1-8GVWEJaj8dou9GJy+BXIQNh+DIk=", + "dev": true, + "requires": { + "isarray": "1.0.0" + } + }, + "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 + }, + "js-tokens": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/js-tokens/-/js-tokens-3.0.2.tgz", + "integrity": "sha1-mGbfOVECEw449/mWvOtlRDIJwls=", + "dev": true + }, + "js-yaml": { + "version": "3.10.0", + "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-3.10.0.tgz", + "integrity": "sha512-O2v52ffjLa9VeM43J4XocZE//WT9N0IiwDa3KSHH7Tu8CtH+1qM8SIZvnsTh6v+4yFy5KUY3BHUVwjpfAWsjIA==", + "dev": true, + "requires": { + "argparse": "1.0.9", + "esprima": "4.0.0" + }, + "dependencies": { + "esprima": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/esprima/-/esprima-4.0.0.tgz", + "integrity": "sha512-oftTcaMu/EGrEIu904mWteKIv8vMuOgGYo7EhVJJN00R/EED9DCua/xxHRdYnKtcECzVg7xOWhflvJMnqcFZjw==", + "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": "11.6.1", + "resolved": "https://registry.npmjs.org/jsdom/-/jsdom-11.6.1.tgz", + "integrity": "sha512-x1vDo5CQuwsuP0w3kuU04vQdem9Q8apRV2PXp8GeSFQpgtYvSwbcypIbNgRrXu82O4TMroGYSAbu9wyVZHcehw==", + "dev": true, + "requires": { + "abab": "1.0.4", + "acorn": "5.3.0", + "acorn-globals": "4.1.0", + "array-equal": "1.0.0", + "browser-process-hrtime": "0.1.2", + "content-type-parser": "1.0.2", + "cssom": "0.3.2", + "cssstyle": "0.2.37", + "domexception": "1.0.1", + "escodegen": "1.9.0", + "html-encoding-sniffer": "1.0.2", + "left-pad": "1.2.0", + "nwmatcher": "1.4.3", + "parse5": "4.0.0", + "pn": "1.1.0", + "request": "2.83.0", + "request-promise-native": "1.0.5", + "sax": "1.2.4", + "symbol-tree": "3.2.2", + "tough-cookie": "2.3.3", + "w3c-hr-time": "1.0.1", + "webidl-conversions": "4.0.2", + "whatwg-encoding": "1.0.3", + "whatwg-url": "6.4.0", + "ws": "4.0.0", + "xml-name-validator": "3.0.0" + }, + "dependencies": { + "acorn": { + "version": "5.3.0", + "resolved": "https://registry.npmjs.org/acorn/-/acorn-5.3.0.tgz", + "integrity": "sha512-Yej+zOJ1Dm/IMZzzj78OntP/r3zHEaKcyNoU2lAaxPtrseM6rF0xwqoz5Q5ysAiED9hTjI2hgtvLXitlCN1/Ug==", + "dev": true + } + } + }, + "jsesc": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/jsesc/-/jsesc-1.3.0.tgz", + "integrity": "sha1-RsP+yMGJKxKwgz25vHYiF226s0s=", + "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 + }, + "json-schema-traverse": { + "version": "0.3.1", + "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-0.3.1.tgz", + "integrity": "sha1-NJptRMU6Ud6JtAgFxdXlm0F9M0A=", + "dev": true + }, + "json-stable-stringify": { + "version": "0.0.1", + "resolved": "https://registry.npmjs.org/json-stable-stringify/-/json-stable-stringify-0.0.1.tgz", + "integrity": "sha1-YRwj6BTbN1Un34URk9tZ3Sryf0U=", + "dev": true, + "requires": { + "jsonify": "0.0.0" + } + }, + "json-stable-stringify-without-jsonify": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/json-stable-stringify-without-jsonify/-/json-stable-stringify-without-jsonify-1.0.1.tgz", + "integrity": "sha1-nbe1lJatPzz+8wp1FC0tkwrXJlE=", + "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 + }, + "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, + "requires": { + "graceful-fs": "4.1.11" + } + }, + "jsonify": { + "version": "0.0.0", + "resolved": "https://registry.npmjs.org/jsonify/-/jsonify-0.0.0.tgz", + "integrity": "sha1-LHS27kHZPKUbe1qu6PUDYx0lKnM=", + "dev": true + }, + "jsonparse": { + "version": "1.3.1", + "resolved": "https://registry.npmjs.org/jsonparse/-/jsonparse-1.3.1.tgz", + "integrity": "sha1-P02uSpH6wxX3EGL4UhzCOfE2YoA=", + "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.1", + "resolved": "https://registry.npmjs.org/jsprim/-/jsprim-1.4.1.tgz", + "integrity": "sha1-MT5mvB5cwG5Di8G3SZwuXFastqI=", + "dev": true, + "requires": { + "assert-plus": "1.0.0", + "extsprintf": "1.3.0", + "json-schema": "0.2.3", + "verror": "1.10.0" + } + }, + "karma": { + "version": "1.7.1", + "resolved": "https://registry.npmjs.org/karma/-/karma-1.7.1.tgz", + "integrity": "sha512-k5pBjHDhmkdaUccnC7gE3mBzZjcxyxYsYVaqiL2G5AqlfLyBO5nw2VdNK+O16cveEPd/gIOWULH7gkiYYwVNHg==", + "dev": true, + "requires": { + "bluebird": "3.5.1", + "body-parser": "1.18.2", + "chokidar": "1.7.0", + "colors": "1.1.2", + "combine-lists": "1.0.1", + "connect": "3.6.5", + "core-js": "2.5.3", + "di": "0.0.1", + "dom-serialize": "2.2.1", + "expand-braces": "0.1.2", + "glob": "7.1.2", + "graceful-fs": "4.1.11", + "http-proxy": "1.16.2", + "isbinaryfile": "3.0.2", + "lodash": "3.10.1", + "log4js": "0.6.38", + "mime": "1.6.0", + "minimatch": "3.0.4", + "optimist": "0.6.1", + "qjobs": "1.1.5", + "range-parser": "1.2.0", + "rimraf": "2.6.2", + "safe-buffer": "5.1.1", + "socket.io": "1.7.3", + "source-map": "0.5.7", + "tmp": "0.0.31", + "useragent": "2.2.1" + }, + "dependencies": { + "lodash": { + "version": "3.10.1", + "resolved": "https://registry.npmjs.org/lodash/-/lodash-3.10.1.tgz", + "integrity": "sha1-W/Rejkm6QYnhfUgnid/RW9FAt7Y=", + "dev": true + } + } + }, + "karma-babel-preprocessor": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/karma-babel-preprocessor/-/karma-babel-preprocessor-6.0.1.tgz", + "integrity": "sha1-euHT5klQ2+EfQht0BAqwj7WmbCE=", + "dev": true, + "requires": { + "babel-core": "6.26.0" + } + }, + "karma-chai": { + "version": "0.1.0", + "resolved": "https://registry.npmjs.org/karma-chai/-/karma-chai-0.1.0.tgz", + "integrity": "sha1-vuWtQEAFF4Ea40u5RfdikJEIt5o=", + "dev": true + }, + "karma-chrome-launcher": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/karma-chrome-launcher/-/karma-chrome-launcher-2.2.0.tgz", + "integrity": "sha512-uf/ZVpAabDBPvdPdveyk1EPgbnloPvFFGgmRhYLTDH7gEB4nZdSBk8yTU47w1g/drLSx5uMOkjKk7IWKfWg/+w==", + "dev": true, + "requires": { + "fs-access": "1.0.1", + "which": "1.3.0" + } + }, + "karma-mocha": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/karma-mocha/-/karma-mocha-1.3.0.tgz", + "integrity": "sha1-7qrH/8DiAetjxGdEDStpx883eL8=", + "dev": true, + "requires": { + "minimist": "1.2.0" + }, + "dependencies": { + "minimist": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.0.tgz", + "integrity": "sha1-o1AIsg9BOD7sH7kU9M1d95omQoQ=", + "dev": true + } + } + }, + "karma-mocha-reporter": { + "version": "2.2.5", + "resolved": "https://registry.npmjs.org/karma-mocha-reporter/-/karma-mocha-reporter-2.2.5.tgz", + "integrity": "sha1-FRIAlejtgZGG5HoLAS8810GJVWA=", + "dev": true, + "requires": { + "chalk": "2.3.0", + "log-symbols": "2.2.0", + "strip-ansi": "4.0.0" + }, + "dependencies": { + "ansi-regex": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-3.0.0.tgz", + "integrity": "sha1-7QMXwyIGT3lGbAKWa922Bas32Zg=", + "dev": true + }, + "ansi-styles": { + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.0.tgz", + "integrity": "sha512-NnSOmMEYtVR2JVMIGTzynRkkaxtiq1xnFBcdQD/DnNCYPoEPsVJhM98BDyaoNOQIi7p4okdi3E27eN7GQbsUug==", + "dev": true, + "requires": { + "color-convert": "1.9.1" + } + }, + "chalk": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.3.0.tgz", + "integrity": "sha512-Az5zJR2CBujap2rqXGaJKaPHyJ0IrUimvYNX+ncCy8PJP4ltOGTrHUIo097ZaL2zMeKYpiCdqDvS6zdrTFok3Q==", + "dev": true, + "requires": { + "ansi-styles": "3.2.0", + "escape-string-regexp": "1.0.5", + "supports-color": "4.5.0" + } + }, + "strip-ansi": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-4.0.0.tgz", + "integrity": "sha1-qEeQIusaw2iocTibY1JixQXuNo8=", + "dev": true, + "requires": { + "ansi-regex": "3.0.0" + } + }, + "supports-color": { + "version": "4.5.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-4.5.0.tgz", + "integrity": "sha1-vnoN5ITexcXN34s9WRJQRJEvY1s=", + "dev": true, + "requires": { + "has-flag": "2.0.0" + } + } + } + }, + "karma-requirejs": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/karma-requirejs/-/karma-requirejs-1.1.0.tgz", + "integrity": "sha1-/driy4fX68FvsCIok1ZNf+5Xh5g=", + "dev": true + }, + "karma-sauce-launcher": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/karma-sauce-launcher/-/karma-sauce-launcher-1.2.0.tgz", + "integrity": "sha512-lEhtGRGS+3Yw6JSx/vJY9iQyHNtTjcojrSwNzqNUOaDceKDu9dPZqA/kr69bUO9G2T6GKbu8AZgXqy94qo31Jg==", + "dev": true, + "requires": { + "q": "1.5.1", + "sauce-connect-launcher": "1.2.3", + "saucelabs": "1.4.0", + "wd": "1.5.0" + } + }, + "kind-of": { + "version": "3.2.2", + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", + "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=", + "dev": true, + "requires": { + "is-buffer": "1.1.6" + } + }, + "klaw": { + "version": "1.3.1", + "resolved": "https://registry.npmjs.org/klaw/-/klaw-1.3.1.tgz", + "integrity": "sha1-QIhDO0azsbolnXh4XY6W9zugJDk=", + "dev": true, + "requires": { + "graceful-fs": "4.1.11" + } + }, + "labeled-stream-splicer": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/labeled-stream-splicer/-/labeled-stream-splicer-2.0.0.tgz", + "integrity": "sha1-pS4dE4AkwAuGscDJH2d5GLiuClk=", + "dev": true, + "requires": { + "inherits": "2.0.3", + "isarray": "0.0.1", + "stream-splicer": "2.0.0" + }, + "dependencies": { + "isarray": { + "version": "0.0.1", + "resolved": "https://registry.npmjs.org/isarray/-/isarray-0.0.1.tgz", + "integrity": "sha1-ihis/Kmo9Bd+Cav8YDiTmwXR7t8=", + "dev": true + } + } + }, + "lazystream": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/lazystream/-/lazystream-1.0.0.tgz", + "integrity": "sha1-9plf4PggOS9hOWvolGJAe7dxaOQ=", + "dev": true, + "requires": { + "readable-stream": "2.3.3" + } + }, + "left-pad": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/left-pad/-/left-pad-1.2.0.tgz", + "integrity": "sha1-0wpzxrggHY99jnlWupYWCHpo4O4=", + "dev": true + }, + "levn": { + "version": "0.3.0", + "resolved": "https://registry.npmjs.org/levn/-/levn-0.3.0.tgz", + "integrity": "sha1-OwmSTt+fCDwEkP3UwLxEIeBHZO4=", + "dev": true, + "requires": { + "prelude-ls": "1.1.2", + "type-check": "0.3.2" + } + }, + "lexical-scope": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/lexical-scope/-/lexical-scope-1.2.0.tgz", + "integrity": "sha1-/Ope3HBKSzqHls3KQZw6CvryLfQ=", + "dev": true, + "requires": { + "astw": "2.2.0" + } + }, + "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, + "requires": { + "lodash._basecopy": "3.0.1", + "lodash.keys": "3.1.2" + } + }, + "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.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, + "requires": { + "lodash._baseassign": "3.2.0", + "lodash._basecreate": "3.0.3", + "lodash._isiterateecall": "3.0.9" + } + }, + "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, + "requires": { + "lodash._getnative": "3.9.1", + "lodash.isarguments": "3.1.0", + "lodash.isarray": "3.0.4" + } + }, + "lodash.memoize": { + "version": "3.0.4", + "resolved": "https://registry.npmjs.org/lodash.memoize/-/lodash.memoize-3.0.4.tgz", + "integrity": "sha1-LcvSwofLwKVcxCMovQxzYVDVPj8=", + "dev": true + }, + "lodash.sortby": { + "version": "4.7.0", + "resolved": "https://registry.npmjs.org/lodash.sortby/-/lodash.sortby-4.7.0.tgz", + "integrity": "sha1-7dFMgk4sycHgsKG0K7UhBRakJDg=", + "dev": true + }, + "log-symbols": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/log-symbols/-/log-symbols-2.2.0.tgz", + "integrity": "sha512-VeIAFslyIerEJLXHziedo2basKbMKtTw3vfn5IzG0XTjhAVEJyNHnL2p7vc+wBDSdQuUpNw3M2u6xb9QsAY5Eg==", + "dev": true, + "requires": { + "chalk": "2.3.0" + }, + "dependencies": { + "ansi-styles": { + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.0.tgz", + "integrity": "sha512-NnSOmMEYtVR2JVMIGTzynRkkaxtiq1xnFBcdQD/DnNCYPoEPsVJhM98BDyaoNOQIi7p4okdi3E27eN7GQbsUug==", + "dev": true, + "requires": { + "color-convert": "1.9.1" + } + }, + "chalk": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.3.0.tgz", + "integrity": "sha512-Az5zJR2CBujap2rqXGaJKaPHyJ0IrUimvYNX+ncCy8PJP4ltOGTrHUIo097ZaL2zMeKYpiCdqDvS6zdrTFok3Q==", + "dev": true, + "requires": { + "ansi-styles": "3.2.0", + "escape-string-regexp": "1.0.5", + "supports-color": "4.5.0" + } + }, + "supports-color": { + "version": "4.5.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-4.5.0.tgz", + "integrity": "sha1-vnoN5ITexcXN34s9WRJQRJEvY1s=", + "dev": true, + "requires": { + "has-flag": "2.0.0" + } + } + } + }, + "log4js": { + "version": "0.6.38", + "resolved": "https://registry.npmjs.org/log4js/-/log4js-0.6.38.tgz", + "integrity": "sha1-LElBFmldb7JUgJQ9P8hy5mKlIv0=", + "dev": true, + "requires": { + "readable-stream": "1.0.34", + "semver": "4.3.6" + }, + "dependencies": { + "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.0.34", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-1.0.34.tgz", + "integrity": "sha1-Elgg40vIQtLyqq+v5MKRbuMsFXw=", + "dev": true, + "requires": { + "core-util-is": "1.0.2", + "inherits": "2.0.3", + "isarray": "0.0.1", + "string_decoder": "0.10.31" + } + } + } + }, + "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, + "requires": { + "js-tokens": "3.0.2" + } + }, + "lru-cache": { + "version": "2.2.4", + "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-2.2.4.tgz", + "integrity": "sha1-bGWGGb7PFAMdDQtZSxYELOTcBj0=", + "dev": true + }, + "md5.js": { + "version": "1.3.4", + "resolved": "https://registry.npmjs.org/md5.js/-/md5.js-1.3.4.tgz", + "integrity": "sha1-6b296UogpawYsENA/Fdk1bCdkB0=", + "dev": true, + "requires": { + "hash-base": "3.0.4", + "inherits": "2.0.3" + }, + "dependencies": { + "hash-base": { + "version": "3.0.4", + "resolved": "https://registry.npmjs.org/hash-base/-/hash-base-3.0.4.tgz", + "integrity": "sha1-X8hoaEfs1zSZQDMZprCj8/auSRg=", + "dev": true, + "requires": { + "inherits": "2.0.3", + "safe-buffer": "5.1.1" + } + } + } + }, + "media-typer": { + "version": "0.3.0", + "resolved": "https://registry.npmjs.org/media-typer/-/media-typer-0.3.0.tgz", + "integrity": "sha1-hxDXrwqmJvj/+hzgAWhUUmMlV0g=", + "dev": true + }, + "micromatch": { + "version": "2.3.11", + "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-2.3.11.tgz", + "integrity": "sha1-hmd8l9FyCzY0MdBNDRUpO9OMFWU=", + "dev": true, + "requires": { + "arr-diff": "2.0.0", + "array-unique": "0.2.1", + "braces": "1.8.5", + "expand-brackets": "0.1.5", + "extglob": "0.3.2", + "filename-regex": "2.0.1", + "is-extglob": "1.0.0", + "is-glob": "2.0.1", + "kind-of": "3.2.2", + "normalize-path": "2.1.1", + "object.omit": "2.0.1", + "parse-glob": "3.0.4", + "regex-cache": "0.4.4" + } + }, + "miller-rabin": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/miller-rabin/-/miller-rabin-4.0.1.tgz", + "integrity": "sha512-115fLhvZVqWwHPbClyntxEVfVDfl9DLLTuJvq3g2O/Oxi8AiNouAHvDSzHS0viUJc+V5vm3eq91Xwqn9dp4jRA==", + "dev": true, + "requires": { + "bn.js": "4.11.8", + "brorand": "1.1.0" + } + }, + "mime": { + "version": "1.6.0", + "resolved": "https://registry.npmjs.org/mime/-/mime-1.6.0.tgz", + "integrity": "sha512-x0Vn8spI+wuJ1O6S7gnbaQg8Pxh4NNHb7KSINmEWKiPE4RKOplvijn+NkmYmmRgP68mc70j2EbeTFRsrswaQeg==", + "dev": true + }, + "mime-db": { + "version": "1.30.0", + "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.30.0.tgz", + "integrity": "sha1-dMZD2i3Z1qRTmZY0ZbJtXKfXHwE=", + "dev": true + }, + "mime-types": { + "version": "2.1.17", + "resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.17.tgz", + "integrity": "sha1-Cdejk/A+mVp5+K+Fe3Cp4KsWVXo=", + "dev": true, + "requires": { + "mime-db": "1.30.0" + } + }, + "mimic-fn": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/mimic-fn/-/mimic-fn-1.1.0.tgz", + "integrity": "sha1-5md4PZLonb00KBi1IwudYqZyrRg=", + "dev": true + }, + "minimalistic-assert": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/minimalistic-assert/-/minimalistic-assert-1.0.0.tgz", + "integrity": "sha1-cCvi3aazf0g2vLP121ZkG2Sh09M=", + "dev": true + }, + "minimalistic-crypto-utils": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/minimalistic-crypto-utils/-/minimalistic-crypto-utils-1.0.1.tgz", + "integrity": "sha1-9sAMHAsIIkblxNmd+4x8CDsrWCo=", + "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, + "requires": { + "brace-expansion": "1.1.8" + } + }, + "minimist": { + "version": "0.0.8", + "resolved": "https://registry.npmjs.org/minimist/-/minimist-0.0.8.tgz", + "integrity": "sha1-hX/Kv8M5fSYluCKCYuhqp6ARsF0=", + "dev": true + }, + "mkdirp": { + "version": "0.5.1", + "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-0.5.1.tgz", + "integrity": "sha1-MAV0OOrGz3+MR2fzhkjWaX11yQM=", + "dev": true, + "requires": { + "minimist": "0.0.8" + } + }, + "mocha": { + "version": "3.5.3", + "resolved": "https://registry.npmjs.org/mocha/-/mocha-3.5.3.tgz", + "integrity": "sha512-/6na001MJWEtYxHOV1WLfsmR4YIynkUEhBwzsb+fk2qmQ3iqsi258l/Q2MWHJMImAcNpZ8DEdYAK72NHoIQ9Eg==", + "dev": true, + "requires": { + "browser-stdout": "1.3.0", + "commander": "2.9.0", + "debug": "2.6.8", + "diff": "3.2.0", + "escape-string-regexp": "1.0.5", + "glob": "7.1.1", + "growl": "1.9.2", + "he": "1.1.1", + "json3": "3.3.2", + "lodash.create": "3.1.1", + "mkdirp": "0.5.1", + "supports-color": "3.1.2" + }, + "dependencies": { + "commander": { + "version": "2.9.0", + "resolved": "https://registry.npmjs.org/commander/-/commander-2.9.0.tgz", + "integrity": "sha1-nJkJQXbhIkDLItbFFGCYQA/g99Q=", + "dev": true, + "requires": { + "graceful-readlink": "1.0.1" + } + }, + "debug": { + "version": "2.6.8", + "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.8.tgz", + "integrity": "sha1-5zFTHKLt4n0YgiJCfaF4IdaP9Pw=", + "dev": true, + "requires": { + "ms": "2.0.0" + } + }, + "glob": { + "version": "7.1.1", + "resolved": "https://registry.npmjs.org/glob/-/glob-7.1.1.tgz", + "integrity": "sha1-gFIR3wT6rxxjo2ADBs31reULLsg=", + "dev": true, + "requires": { + "fs.realpath": "1.0.0", + "inflight": "1.0.6", + "inherits": "2.0.3", + "minimatch": "3.0.4", + "once": "1.4.0", + "path-is-absolute": "1.0.1" + } + }, + "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 + }, + "supports-color": { + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-3.1.2.tgz", + "integrity": "sha1-cqJiiU2dQIuVbKBf83su2KbiotU=", + "dev": true, + "requires": { + "has-flag": "1.0.0" + } + } + } + }, + "module-deps": { + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/module-deps/-/module-deps-4.1.1.tgz", + "integrity": "sha1-IyFYM/HaE/1gbMuAh7RIUty4If0=", + "dev": true, + "requires": { + "JSONStream": "1.3.2", + "browser-resolve": "1.11.2", + "cached-path-relative": "1.0.1", + "concat-stream": "1.5.2", + "defined": "1.0.0", + "detective": "4.7.1", + "duplexer2": "0.1.4", + "inherits": "2.0.3", + "parents": "1.0.1", + "readable-stream": "2.3.3", + "resolve": "1.5.0", + "stream-combiner2": "1.1.1", + "subarg": "1.0.0", + "through2": "2.0.3", + "xtend": "4.0.1" + } + }, + "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.7", + "resolved": "https://registry.npmjs.org/mute-stream/-/mute-stream-0.0.7.tgz", + "integrity": "sha1-MHXOk7whuPq0PhvE2n6BFe0ee6s=", + "dev": true + }, + "nan": { + "version": "2.8.0", + "resolved": "https://registry.npmjs.org/nan/-/nan-2.8.0.tgz", + "integrity": "sha1-7XFfP+neArV6XmJS2QqWZ14fCFo=", + "dev": true, + "optional": 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 + }, + "negotiator": { + "version": "0.6.1", + "resolved": "https://registry.npmjs.org/negotiator/-/negotiator-0.6.1.tgz", + "integrity": "sha1-KzJxhOiZIQEXeyhWP7XnECrNDKk=", + "dev": true + }, + "node-getopt": { + "version": "0.2.3", + "resolved": "https://registry.npmjs.org/node-getopt/-/node-getopt-0.2.3.tgz", + "integrity": "sha1-aau8flQAYA0drPANuMt5tUh+kks=", + "dev": true + }, + "nomnom": { + "version": "1.8.1", + "resolved": "https://registry.npmjs.org/nomnom/-/nomnom-1.8.1.tgz", + "integrity": "sha1-IVH3Ikcrp55Qp2/BJbuMjy5Nwqc=", + "dev": true, + "requires": { + "chalk": "0.4.0", + "underscore": "1.6.0" + }, + "dependencies": { + "ansi-styles": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-1.0.0.tgz", + "integrity": "sha1-yxAt8cVvUSPquLZ817mAJ6AnkXg=", + "dev": true + }, + "chalk": { + "version": "0.4.0", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-0.4.0.tgz", + "integrity": "sha1-UZmj3c0MHv4jvAjBsCewYXbgxk8=", + "dev": true, + "requires": { + "ansi-styles": "1.0.0", + "has-color": "0.1.7", + "strip-ansi": "0.1.1" + } + }, + "strip-ansi": { + "version": "0.1.1", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-0.1.1.tgz", + "integrity": "sha1-OeipjQRNFQZgq+SmgIrPcLt7yZE=", + "dev": true + } + } + }, + "normalize-path": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/normalize-path/-/normalize-path-2.1.1.tgz", + "integrity": "sha1-GrKLVW4Zg2Oowab35vogE3/mrtk=", + "dev": true, + "requires": { + "remove-trailing-separator": "1.1.0" + } + }, + "null-check": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/null-check/-/null-check-1.0.0.tgz", + "integrity": "sha1-l33/1xdgErnsMNKjnbXPcqBDnt0=", + "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.3", + "resolved": "https://registry.npmjs.org/nwmatcher/-/nwmatcher-1.4.3.tgz", + "integrity": "sha512-IKdSTiDWCarf2JTS5e9e2+5tPZGdkRJ79XjYV0pzK8Q9BpsFyBq1RGKxzs7Q8UBushGw7m6TzVKz6fcY99iSWw==", + "dev": 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 + }, + "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 + }, + "object-component": { + "version": "0.0.3", + "resolved": "https://registry.npmjs.org/object-component/-/object-component-0.0.3.tgz", + "integrity": "sha1-8MaapQ78lbhmwYb0AKM3acsvEpE=", + "dev": true + }, + "object.omit": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/object.omit/-/object.omit-2.0.1.tgz", + "integrity": "sha1-Gpx0SCnznbuFjHbKNXmuKlTr0fo=", + "dev": true, + "requires": { + "for-own": "0.1.5", + "is-extendable": "0.1.1" + } + }, + "on-finished": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/on-finished/-/on-finished-2.3.0.tgz", + "integrity": "sha1-IPEzZIGwg811M3mSoWlxqi2QaUc=", + "dev": true, + "requires": { + "ee-first": "1.1.1" + } + }, + "once": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz", + "integrity": "sha1-WDsap3WWHUsROsF9nFC6753Xa9E=", + "dev": true, + "requires": { + "wrappy": "1.0.2" + } + }, + "onetime": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/onetime/-/onetime-2.0.1.tgz", + "integrity": "sha1-BnQoIw/WdEOyeUsiu6UotoZ5YtQ=", + "dev": true, + "requires": { + "mimic-fn": "1.1.0" + } + }, + "optimist": { + "version": "0.6.1", + "resolved": "https://registry.npmjs.org/optimist/-/optimist-0.6.1.tgz", + "integrity": "sha1-2j6nRob6IaGaERwybpDrFaAZZoY=", + "dev": true, + "requires": { + "minimist": "0.0.8", + "wordwrap": "0.0.3" + }, + "dependencies": { + "wordwrap": { + "version": "0.0.3", + "resolved": "https://registry.npmjs.org/wordwrap/-/wordwrap-0.0.3.tgz", + "integrity": "sha1-o9XabNXAvAAI03I0u68b7WMFkQc=", + "dev": true + } + } + }, + "optionator": { + "version": "0.8.2", + "resolved": "https://registry.npmjs.org/optionator/-/optionator-0.8.2.tgz", + "integrity": "sha1-NkxeQJ0/TWMB1sC0wFu6UBgK62Q=", + "dev": true, + "requires": { + "deep-is": "0.1.3", + "fast-levenshtein": "2.0.6", + "levn": "0.3.0", + "prelude-ls": "1.1.2", + "type-check": "0.3.2", + "wordwrap": "1.0.0" + } + }, + "options": { + "version": "0.0.6", + "resolved": "https://registry.npmjs.org/options/-/options-0.0.6.tgz", + "integrity": "sha1-7CLTEoBrtT5zF3Pnza788cZDEo8=", + "dev": true + }, + "os-browserify": { + "version": "0.1.2", + "resolved": "https://registry.npmjs.org/os-browserify/-/os-browserify-0.1.2.tgz", + "integrity": "sha1-ScoCk+CxlZCl9d4Qx/JlphfY/lQ=", + "dev": true + }, + "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 + }, + "pako": { + "version": "0.2.9", + "resolved": "https://registry.npmjs.org/pako/-/pako-0.2.9.tgz", + "integrity": "sha1-8/dSL073gjSNqBYbrZ7P1Rv4OnU=", + "dev": true + }, + "parents": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/parents/-/parents-1.0.1.tgz", + "integrity": "sha1-/t1NK/GTp3dF/nHjcdc8MwfZx1E=", + "dev": true, + "requires": { + "path-platform": "0.11.15" + } + }, + "parse-asn1": { + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/parse-asn1/-/parse-asn1-5.1.0.tgz", + "integrity": "sha1-N8T5t+06tlx0gXtfJICTf7+XxxI=", + "dev": true, + "requires": { + "asn1.js": "4.9.2", + "browserify-aes": "1.1.1", + "create-hash": "1.1.3", + "evp_bytestokey": "1.0.3", + "pbkdf2": "3.0.14" + } + }, + "parse-glob": { + "version": "3.0.4", + "resolved": "https://registry.npmjs.org/parse-glob/-/parse-glob-3.0.4.tgz", + "integrity": "sha1-ssN2z7EfNVE7rdFz7wu246OIORw=", + "dev": true, + "requires": { + "glob-base": "0.3.0", + "is-dotfile": "1.0.3", + "is-extglob": "1.0.0", + "is-glob": "2.0.1" + } + }, + "parse5": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/parse5/-/parse5-4.0.0.tgz", + "integrity": "sha512-VrZ7eOd3T1Fk4XWNXMgiGBK/z0MG48BWG2uQNU4I72fkQuKUTZpl+u9k+CxEG0twMVzSmXEEz12z5Fnw1jIQFA==", + "dev": true + }, + "parsejson": { + "version": "0.0.3", + "resolved": "https://registry.npmjs.org/parsejson/-/parsejson-0.0.3.tgz", + "integrity": "sha1-q343WfIJ7OmUN5c/fQ8fZK4OZKs=", + "dev": true, + "requires": { + "better-assert": "1.0.2" + } + }, + "parseqs": { + "version": "0.0.5", + "resolved": "https://registry.npmjs.org/parseqs/-/parseqs-0.0.5.tgz", + "integrity": "sha1-1SCKNzjkZ2bikbouoXNoSSGouJ0=", + "dev": true, + "requires": { + "better-assert": "1.0.2" + } + }, + "parseuri": { + "version": "0.0.5", + "resolved": "https://registry.npmjs.org/parseuri/-/parseuri-0.0.5.tgz", + "integrity": "sha1-gCBKUNTbt3m/3G6+J3jZDkvOMgo=", + "dev": true, + "requires": { + "better-assert": "1.0.2" + } + }, + "parseurl": { + "version": "1.3.2", + "resolved": "https://registry.npmjs.org/parseurl/-/parseurl-1.3.2.tgz", + "integrity": "sha1-/CidTtiZMRlGDBViUyYs3I3mW/M=", + "dev": true + }, + "path-browserify": { + "version": "0.0.0", + "resolved": "https://registry.npmjs.org/path-browserify/-/path-browserify-0.0.0.tgz", + "integrity": "sha1-oLhwcpquIUAFt9UDLsLLuw+0RRo=", + "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-platform": { + "version": "0.11.15", + "resolved": "https://registry.npmjs.org/path-platform/-/path-platform-0.11.15.tgz", + "integrity": "sha1-6GQhf3TDaFDwhSt43Hv31KVyG/I=", + "dev": true + }, + "pbkdf2": { + "version": "3.0.14", + "resolved": "https://registry.npmjs.org/pbkdf2/-/pbkdf2-3.0.14.tgz", + "integrity": "sha512-gjsZW9O34fm0R7PaLHRJmLLVfSoesxztjPjE9o6R+qtVJij90ltg1joIovN9GKrRW3t1PzhDDG3UMEMFfZ+1wA==", + "dev": true, + "requires": { + "create-hash": "1.1.3", + "create-hmac": "1.1.6", + "ripemd160": "2.0.1", + "safe-buffer": "5.1.1", + "sha.js": "2.4.10" + } + }, + "performance-now": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/performance-now/-/performance-now-2.1.0.tgz", + "integrity": "sha1-Ywn04OX6kT7BxpMHrjZLSzd8nns=", + "dev": 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, + "requires": { + "pinkie": "2.0.4" + } + }, + "pluralize": { + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/pluralize/-/pluralize-7.0.0.tgz", + "integrity": "sha512-ARhBOdzS3e41FbkW/XWrTEtukqqLoK5+Z/4UeDaLuSW+39JPeFgs4gCGqsrJHVZX0fUrx//4OF0K1CUGwlIFow==", + "dev": true + }, + "pn": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/pn/-/pn-1.1.0.tgz", + "integrity": "sha512-2qHaIQr2VLRFoxe2nASzsV6ef4yOOH+Fi9FBOVH6cqeSgUnoyySPZkxzLuzd+RYOQTRpROA0ztTMqxROKSb/nA==", + "dev": true + }, + "po2json": { + "version": "0.4.5", + "resolved": "https://registry.npmjs.org/po2json/-/po2json-0.4.5.tgz", + "integrity": "sha1-R7spUtoy1Yob4vJWpZjuvAt0URg=", + "dev": true, + "requires": { + "gettext-parser": "1.1.0", + "nomnom": "1.8.1" + } + }, + "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 + }, + "preserve": { + "version": "0.2.0", + "resolved": "https://registry.npmjs.org/preserve/-/preserve-0.2.0.tgz", + "integrity": "sha1-gV7R9uvGWSb4ZbMQwHE7yzMVzks=", + "dev": true + }, + "private": { + "version": "0.1.8", + "resolved": "https://registry.npmjs.org/private/-/private-0.1.8.tgz", + "integrity": "sha512-VvivMrbvd2nKkiG38qjULzlc+4Vx4wm/whI9pQD35YrARNnhxeiRktSOhSukRLFNlzg6Br/cJPet5J/u19r/mg==", + "dev": true + }, + "process": { + "version": "0.11.10", + "resolved": "https://registry.npmjs.org/process/-/process-0.11.10.tgz", + "integrity": "sha1-czIwDoQBYb2j5podHZGn1LwW8YI=", + "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": "2.0.0", + "resolved": "https://registry.npmjs.org/progress/-/progress-2.0.0.tgz", + "integrity": "sha1-ihvjZr+Pwj2yvSPxDG/pILQ4nR8=", + "dev": true + }, + "pseudomap": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/pseudomap/-/pseudomap-1.0.2.tgz", + "integrity": "sha1-8FKijacOYYkX7wqKw0wa5aaChrM=", + "dev": true + }, + "public-encrypt": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/public-encrypt/-/public-encrypt-4.0.0.tgz", + "integrity": "sha1-OfaZ86RlYN1eusvKaTyvfGXBjMY=", + "dev": true, + "requires": { + "bn.js": "4.11.8", + "browserify-rsa": "4.0.1", + "create-hash": "1.1.3", + "parse-asn1": "5.1.0", + "randombytes": "2.0.6" + } + }, + "punycode": { + "version": "1.4.1", + "resolved": "https://registry.npmjs.org/punycode/-/punycode-1.4.1.tgz", + "integrity": "sha1-wNWmOycYgArY4esPpSachN1BhF4=", + "dev": true + }, + "q": { + "version": "1.5.1", + "resolved": "https://registry.npmjs.org/q/-/q-1.5.1.tgz", + "integrity": "sha1-fjL3W0E4EpHQRhHxvxQQmsAGUdc=", + "dev": true + }, + "qjobs": { + "version": "1.1.5", + "resolved": "https://registry.npmjs.org/qjobs/-/qjobs-1.1.5.tgz", + "integrity": "sha1-ZZ3p8s+NzCehSBJ28gU3cnI4LnM=", + "dev": true + }, + "qs": { + "version": "6.5.1", + "resolved": "https://registry.npmjs.org/qs/-/qs-6.5.1.tgz", + "integrity": "sha512-eRzhrN1WSINYCDCbrz796z37LOe3m5tmW7RQf6oBntukAG1nmovJvhnwHHRMAfeoItc1m2Hk02WER2aQ/iqs+A==", + "dev": true + }, + "querystring": { + "version": "0.2.0", + "resolved": "https://registry.npmjs.org/querystring/-/querystring-0.2.0.tgz", + "integrity": "sha1-sgmEkgO7Jd+CDadW50cAWHhSFiA=", + "dev": true + }, + "querystring-es3": { + "version": "0.2.1", + "resolved": "https://registry.npmjs.org/querystring-es3/-/querystring-es3-0.2.1.tgz", + "integrity": "sha1-nsYfeQSYdXB9aUFFlv2Qek1xHnM=", + "dev": true + }, + "randomatic": { + "version": "1.1.7", + "resolved": "https://registry.npmjs.org/randomatic/-/randomatic-1.1.7.tgz", + "integrity": "sha512-D5JUjPyJbaJDkuAazpVnSfVkLlpeO3wDlPROTMLGKG1zMFNFRgrciKo1ltz/AzNTkqE0HzDx655QOL51N06how==", + "dev": true, + "requires": { + "is-number": "3.0.0", + "kind-of": "4.0.0" + }, + "dependencies": { + "is-number": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/is-number/-/is-number-3.0.0.tgz", + "integrity": "sha1-JP1iAaR4LPUFYcgQJ2r8fRLXEZU=", + "dev": true, + "requires": { + "kind-of": "3.2.2" + }, + "dependencies": { + "kind-of": { + "version": "3.2.2", + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", + "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=", + "dev": true, + "requires": { + "is-buffer": "1.1.6" + } + } + } + }, + "kind-of": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-4.0.0.tgz", + "integrity": "sha1-IIE989cSkosgc3hpGkUGb65y3Vc=", + "dev": true, + "requires": { + "is-buffer": "1.1.6" + } + } + } + }, + "randombytes": { + "version": "2.0.6", + "resolved": "https://registry.npmjs.org/randombytes/-/randombytes-2.0.6.tgz", + "integrity": "sha512-CIQ5OFxf4Jou6uOKe9t1AOgqpeU5fd70A8NPdHSGeYXqXsPe6peOwI0cUl88RWZ6sP1vPMV3avd/R6cZ5/sP1A==", + "dev": true, + "requires": { + "safe-buffer": "5.1.1" + } + }, + "randomfill": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/randomfill/-/randomfill-1.0.3.tgz", + "integrity": "sha512-YL6GrhrWoic0Eq8rXVbMptH7dAxCs0J+mh5Y0euNekPPYaxEmdVGim6GdoxoRzKW2yJoU8tueifS7mYxvcFDEQ==", + "dev": true, + "requires": { + "randombytes": "2.0.6", + "safe-buffer": "5.1.1" + } + }, + "range-parser": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/range-parser/-/range-parser-1.2.0.tgz", + "integrity": "sha1-9JvmtIeJTdxA3MlKMi9hEJLgDV4=", + "dev": true + }, + "raw-body": { + "version": "2.3.2", + "resolved": "https://registry.npmjs.org/raw-body/-/raw-body-2.3.2.tgz", + "integrity": "sha1-vNYMd9Prk83gBQKVw/N5OJvIj4k=", + "dev": true, + "requires": { + "bytes": "3.0.0", + "http-errors": "1.6.2", + "iconv-lite": "0.4.19", + "unpipe": "1.0.0" + } + }, + "read-only-stream": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/read-only-stream/-/read-only-stream-2.0.0.tgz", + "integrity": "sha1-JyT9aoET1zdkrCiNQ4YnDB2/F/A=", + "dev": true, + "requires": { + "readable-stream": "2.3.3" + } + }, + "readable-stream": { + "version": "2.3.3", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.3.tgz", + "integrity": "sha512-m+qzzcn7KUxEmd1gMbchF+Y2eIUbieUaxkWtptyHywrX0rE8QEYqPC07Vuy4Wm32/xE16NcdBctb8S0Xe/5IeQ==", + "dev": true, + "requires": { + "core-util-is": "1.0.2", + "inherits": "2.0.3", + "isarray": "1.0.0", + "process-nextick-args": "1.0.7", + "safe-buffer": "5.1.1", + "string_decoder": "1.0.3", + "util-deprecate": "1.0.2" + }, + "dependencies": { + "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, + "requires": { + "safe-buffer": "5.1.1" + } + } + } + }, + "readdirp": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/readdirp/-/readdirp-2.1.0.tgz", + "integrity": "sha1-TtCtBg3zBzMAxIRANz9y0cxkLXg=", + "dev": true, + "requires": { + "graceful-fs": "4.1.11", + "minimatch": "3.0.4", + "readable-stream": "2.3.3", + "set-immediate-shim": "1.0.1" + } + }, + "regenerator-runtime": { + "version": "0.11.1", + "resolved": "https://registry.npmjs.org/regenerator-runtime/-/regenerator-runtime-0.11.1.tgz", + "integrity": "sha512-MguG95oij0fC3QV3URf4V2SDYGJhJnJGqvIIgdECeODCT98wSWDAJ94SSuVpYQUoTcGUIL6L4yNB7j1DFFHSBg==", + "dev": true + }, + "regex-cache": { + "version": "0.4.4", + "resolved": "https://registry.npmjs.org/regex-cache/-/regex-cache-0.4.4.tgz", + "integrity": "sha512-nVIZwtCjkC9YgvWkpM55B5rBhBYRZhAaJbgcFYXXsHnbZ9UZI9nnVWYZpBlCqv9ho2eZryPnWrZGsOdPwVWXWQ==", + "dev": true, + "requires": { + "is-equal-shallow": "0.1.3" + } + }, + "remove-trailing-separator": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/remove-trailing-separator/-/remove-trailing-separator-1.1.0.tgz", + "integrity": "sha1-wkvOKig62tW8P1jg1IJJuSN52O8=", + "dev": true + }, + "repeat-element": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/repeat-element/-/repeat-element-1.1.2.tgz", + "integrity": "sha1-7wiaF40Ug7quTZPrmLT55OEdmQo=", + "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": "2.0.1", + "resolved": "https://registry.npmjs.org/repeating/-/repeating-2.0.1.tgz", + "integrity": "sha1-UhTFOpJtNVJwdSf7q0FdvAjQbdo=", + "dev": true, + "requires": { + "is-finite": "1.0.2" + } + }, + "request": { + "version": "2.83.0", + "resolved": "https://registry.npmjs.org/request/-/request-2.83.0.tgz", + "integrity": "sha512-lR3gD69osqm6EYLk9wB/G1W/laGWjzH90t1vEa2xuxHD5KUrSzp9pUSfTm+YC5Nxt2T8nMPEvKlhbQayU7bgFw==", + "dev": true, + "requires": { + "aws-sign2": "0.7.0", + "aws4": "1.6.0", + "caseless": "0.12.0", + "combined-stream": "1.0.5", + "extend": "3.0.1", + "forever-agent": "0.6.1", + "form-data": "2.3.1", + "har-validator": "5.0.3", + "hawk": "6.0.2", + "http-signature": "1.2.0", + "is-typedarray": "1.0.0", + "isstream": "0.1.2", + "json-stringify-safe": "5.0.1", + "mime-types": "2.1.17", + "oauth-sign": "0.8.2", + "performance-now": "2.1.0", + "qs": "6.5.1", + "safe-buffer": "5.1.1", + "stringstream": "0.0.5", + "tough-cookie": "2.3.3", + "tunnel-agent": "0.6.0", + "uuid": "3.2.1" + } + }, + "request-promise-core": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/request-promise-core/-/request-promise-core-1.1.1.tgz", + "integrity": "sha1-Pu4AssWqgyOc+wTFcA2jb4HNCLY=", + "dev": true, + "requires": { + "lodash": "4.17.4" + } + }, + "request-promise-native": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/request-promise-native/-/request-promise-native-1.0.5.tgz", + "integrity": "sha1-UoF3D2jgyXGeUWP9P6tIIhX0/aU=", + "dev": true, + "requires": { + "request-promise-core": "1.1.1", + "stealthy-require": "1.1.1", + "tough-cookie": "2.3.3" + } + }, + "require-uncached": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/require-uncached/-/require-uncached-1.0.3.tgz", + "integrity": "sha1-Tg1W1slmL9MeQwEcS5WqSZVUIdM=", + "dev": true, + "requires": { + "caller-path": "0.1.0", + "resolve-from": "1.0.1" + } + }, + "requirejs": { + "version": "2.3.5", + "resolved": "https://registry.npmjs.org/requirejs/-/requirejs-2.3.5.tgz", + "integrity": "sha512-svnO+aNcR/an9Dpi44C7KSAy5fFGLtmPbaaCeQaklUz8BQhS64tWWIIlvEA5jrWICzlO/X9KSzSeXFnZdBu8nw==", + "dev": true + }, + "requires-port": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/requires-port/-/requires-port-1.0.0.tgz", + "integrity": "sha1-kl0mAdOaxIXgkc8NpcbmlNw9yv8=", + "dev": true + }, + "resolve": { + "version": "1.5.0", + "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.5.0.tgz", + "integrity": "sha512-hgoSGrc3pjzAPHNBg+KnFcK2HwlHTs/YrAGUr6qgTVUZmXv1UEXXl0bZNBKMA9fud6lRYFdPGz0xXxycPzmmiw==", + "dev": true, + "requires": { + "path-parse": "1.0.5" + } + }, + "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": "2.0.0", + "resolved": "https://registry.npmjs.org/restore-cursor/-/restore-cursor-2.0.0.tgz", + "integrity": "sha1-n37ih/gv0ybU/RYpI9YhKe7g368=", + "dev": true, + "requires": { + "onetime": "2.0.1", + "signal-exit": "3.0.2" + } + }, + "rimraf": { + "version": "2.6.2", + "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-2.6.2.tgz", + "integrity": "sha512-lreewLK/BlghmxtfH36YYVg1i8IAce4TI7oao75I1g245+6BctqTVQiBP3YUJ9C6DQOXJmkYR9X9fCLtCOJc5w==", + "dev": true, + "requires": { + "glob": "7.1.2" + } + }, + "ripemd160": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/ripemd160/-/ripemd160-2.0.1.tgz", + "integrity": "sha1-D0WEKVxTo2KK9+bXmsohzlfRxuc=", + "dev": true, + "requires": { + "hash-base": "2.0.2", + "inherits": "2.0.3" + } + }, + "rollup": { + "version": "0.41.6", + "resolved": "https://registry.npmjs.org/rollup/-/rollup-0.41.6.tgz", + "integrity": "sha1-4NBUl4d6OYwQTYFtJzOnGKepTio=", + "dev": true, + "requires": { + "source-map-support": "0.4.18" + } + }, + "rollup-plugin-node-resolve": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/rollup-plugin-node-resolve/-/rollup-plugin-node-resolve-2.1.1.tgz", + "integrity": "sha1-y7eDsNFbAnlNWJFTULLw2QK43cg=", + "dev": true, + "requires": { + "browser-resolve": "1.11.2", + "builtin-modules": "1.1.1", + "resolve": "1.5.0" + } + }, + "run-async": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/run-async/-/run-async-2.3.0.tgz", + "integrity": "sha1-A3GrSuC91yDUFm19/aZP96RFpsA=", + "dev": true, + "requires": { + "is-promise": "2.1.0" + } + }, + "rx-lite": { + "version": "4.0.8", + "resolved": "https://registry.npmjs.org/rx-lite/-/rx-lite-4.0.8.tgz", + "integrity": "sha1-Cx4Rr4vESDbwSmQH6S2kJGe3lEQ=", + "dev": true + }, + "rx-lite-aggregates": { + "version": "4.0.8", + "resolved": "https://registry.npmjs.org/rx-lite-aggregates/-/rx-lite-aggregates-4.0.8.tgz", + "integrity": "sha1-dTuHqJoRyVRnxKwWJsTvxOBcZ74=", + "dev": true, + "requires": { + "rx-lite": "4.0.8" + } + }, + "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 + }, + "sauce-connect-launcher": { + "version": "1.2.3", + "resolved": "https://registry.npmjs.org/sauce-connect-launcher/-/sauce-connect-launcher-1.2.3.tgz", + "integrity": "sha1-0vkxrXro/avxlopEDnsgQXrKf4Y=", + "dev": true, + "requires": { + "adm-zip": "0.4.7", + "async": "2.6.0", + "https-proxy-agent": "1.0.0", + "lodash": "4.17.4", + "rimraf": "2.6.2" + } + }, + "saucelabs": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/saucelabs/-/saucelabs-1.4.0.tgz", + "integrity": "sha1-uTSpr52ih0s/QKrh/N5QpEZvXzg=", + "dev": true, + "requires": { + "https-proxy-agent": "1.0.0" + } + }, + "sax": { + "version": "1.2.4", + "resolved": "https://registry.npmjs.org/sax/-/sax-1.2.4.tgz", + "integrity": "sha512-NqVDv9TpANUjFm0N8uM5GxL36UgKi9/atZw+x7YFnQ8ckwFGKrl4xX4yWtrey3UJm5nP1kUbnYgLopqWNSRhWw==", + "dev": true + }, + "semver": { + "version": "4.3.6", + "resolved": "https://registry.npmjs.org/semver/-/semver-4.3.6.tgz", + "integrity": "sha1-MAvG4OhjdPe6YQaLWx7NV/xlMto=", + "dev": true + }, + "set-immediate-shim": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/set-immediate-shim/-/set-immediate-shim-1.0.1.tgz", + "integrity": "sha1-SysbJ+uAip+NzEgaWOXlb1mfP2E=", + "dev": true + }, + "setprototypeof": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/setprototypeof/-/setprototypeof-1.0.3.tgz", + "integrity": "sha1-ZlZ+NwQ+608E2RvWWMDL77VbjgQ=", + "dev": true + }, + "sha.js": { + "version": "2.4.10", + "resolved": "https://registry.npmjs.org/sha.js/-/sha.js-2.4.10.tgz", + "integrity": "sha512-vnwmrFDlOExK4Nm16J2KMWHLrp14lBrjxMxBJpu++EnsuBmpiYaM/MEs46Vxxm/4FvdP5yTwuCTO9it5FSjrqA==", + "dev": true, + "requires": { + "inherits": "2.0.3", + "safe-buffer": "5.1.1" + } + }, + "shasum": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/shasum/-/shasum-1.0.2.tgz", + "integrity": "sha1-5wEjENj0F/TetXEhUOVni4euVl8=", + "dev": true, + "requires": { + "json-stable-stringify": "0.0.1", + "sha.js": "2.4.10" + } + }, + "shebang-command": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/shebang-command/-/shebang-command-1.2.0.tgz", + "integrity": "sha1-RKrGW2lbAzmJaMOfNj/uXer98eo=", + "dev": true, + "requires": { + "shebang-regex": "1.0.0" + } + }, + "shebang-regex": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/shebang-regex/-/shebang-regex-1.0.0.tgz", + "integrity": "sha1-2kL0l0DAtC2yypcoVxyxkMmO/qM=", + "dev": true + }, + "shell-quote": { + "version": "1.6.1", + "resolved": "https://registry.npmjs.org/shell-quote/-/shell-quote-1.6.1.tgz", + "integrity": "sha1-9HgZSczkAmlxJ0MOo7PFR29IF2c=", + "dev": true, + "requires": { + "array-filter": "0.0.1", + "array-map": "0.0.0", + "array-reduce": "0.0.0", + "jsonify": "0.0.0" + } + }, + "signal-exit": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-3.0.2.tgz", + "integrity": "sha1-tf3AjxKH6hF4Yo5BXiUTK3NkbG0=", + "dev": true + }, + "sinon-chai": { + "version": "2.14.0", + "resolved": "https://registry.npmjs.org/sinon-chai/-/sinon-chai-2.14.0.tgz", + "integrity": "sha512-9stIF1utB0ywNHNT7RgiXbdmen8QDCRsrTjw+G9TgKt1Yexjiv8TOWZ6WHsTPz57Yky3DIswZvEqX8fpuHNDtQ==", + "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": "1.0.0", + "resolved": "https://registry.npmjs.org/slice-ansi/-/slice-ansi-1.0.0.tgz", + "integrity": "sha512-POqxBK6Lb3q6s047D/XsDVNPnF9Dl8JSaqe9h9lURl0OdNqy/ujDrOiIHtsqXMGbWWTIomRzAMaTyawAU//Reg==", + "dev": true, + "requires": { + "is-fullwidth-code-point": "2.0.0" + } + }, + "sntp": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/sntp/-/sntp-2.1.0.tgz", + "integrity": "sha512-FL1b58BDrqS3A11lJ0zEdnJ3UOKqVxawAkF3k7F0CVN7VQ34aZrV+G8BZ1WC9ZL7NyrwsW0oviwsWDgRuVYtJg==", + "dev": true, + "requires": { + "hoek": "4.2.0" + } + }, + "socket.io": { + "version": "1.7.3", + "resolved": "https://registry.npmjs.org/socket.io/-/socket.io-1.7.3.tgz", + "integrity": "sha1-uK+cq6AJSeVo42nxMn6pvp6iRhs=", + "dev": true, + "requires": { + "debug": "2.3.3", + "engine.io": "1.8.3", + "has-binary": "0.1.7", + "object-assign": "4.1.0", + "socket.io-adapter": "0.5.0", + "socket.io-client": "1.7.3", + "socket.io-parser": "2.3.1" + }, + "dependencies": { + "debug": { + "version": "2.3.3", + "resolved": "https://registry.npmjs.org/debug/-/debug-2.3.3.tgz", + "integrity": "sha1-QMRT5n5uE8kB3ewxeviYbNqe/4w=", + "dev": true, + "requires": { + "ms": "0.7.2" + } + }, + "ms": { + "version": "0.7.2", + "resolved": "https://registry.npmjs.org/ms/-/ms-0.7.2.tgz", + "integrity": "sha1-riXPJRKziFodldfwN4aNhDESR2U=", + "dev": true + }, + "object-assign": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/object-assign/-/object-assign-4.1.0.tgz", + "integrity": "sha1-ejs9DpgGPUP0wD8uiubNUahog6A=", + "dev": true + } + } + }, + "socket.io-adapter": { + "version": "0.5.0", + "resolved": "https://registry.npmjs.org/socket.io-adapter/-/socket.io-adapter-0.5.0.tgz", + "integrity": "sha1-y21LuL7IHhB4uZZ3+c7QBGBmu4s=", + "dev": true, + "requires": { + "debug": "2.3.3", + "socket.io-parser": "2.3.1" + }, + "dependencies": { + "debug": { + "version": "2.3.3", + "resolved": "https://registry.npmjs.org/debug/-/debug-2.3.3.tgz", + "integrity": "sha1-QMRT5n5uE8kB3ewxeviYbNqe/4w=", + "dev": true, + "requires": { + "ms": "0.7.2" + } + }, + "ms": { + "version": "0.7.2", + "resolved": "https://registry.npmjs.org/ms/-/ms-0.7.2.tgz", + "integrity": "sha1-riXPJRKziFodldfwN4aNhDESR2U=", + "dev": true + } + } + }, + "socket.io-client": { + "version": "1.7.3", + "resolved": "https://registry.npmjs.org/socket.io-client/-/socket.io-client-1.7.3.tgz", + "integrity": "sha1-sw6GqhDV7zVGYBwJzeR2Xjgdo3c=", + "dev": true, + "requires": { + "backo2": "1.0.2", + "component-bind": "1.0.0", + "component-emitter": "1.2.1", + "debug": "2.3.3", + "engine.io-client": "1.8.3", + "has-binary": "0.1.7", + "indexof": "0.0.1", + "object-component": "0.0.3", + "parseuri": "0.0.5", + "socket.io-parser": "2.3.1", + "to-array": "0.1.4" + }, + "dependencies": { + "component-emitter": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/component-emitter/-/component-emitter-1.2.1.tgz", + "integrity": "sha1-E3kY1teCg/ffemt8WmPhQOaUJeY=", + "dev": true + }, + "debug": { + "version": "2.3.3", + "resolved": "https://registry.npmjs.org/debug/-/debug-2.3.3.tgz", + "integrity": "sha1-QMRT5n5uE8kB3ewxeviYbNqe/4w=", + "dev": true, + "requires": { + "ms": "0.7.2" + } + }, + "ms": { + "version": "0.7.2", + "resolved": "https://registry.npmjs.org/ms/-/ms-0.7.2.tgz", + "integrity": "sha1-riXPJRKziFodldfwN4aNhDESR2U=", + "dev": true + } + } + }, + "socket.io-parser": { + "version": "2.3.1", + "resolved": "https://registry.npmjs.org/socket.io-parser/-/socket.io-parser-2.3.1.tgz", + "integrity": "sha1-3VMgJRA85Clpcya+/WQAX8/ltKA=", + "dev": true, + "requires": { + "component-emitter": "1.1.2", + "debug": "2.2.0", + "isarray": "0.0.1", + "json3": "3.3.2" + }, + "dependencies": { + "debug": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/debug/-/debug-2.2.0.tgz", + "integrity": "sha1-+HBX6ZWxofauaklgZkE3vFbwOdo=", + "dev": true, + "requires": { + "ms": "0.7.1" + } + }, + "isarray": { + "version": "0.0.1", + "resolved": "https://registry.npmjs.org/isarray/-/isarray-0.0.1.tgz", + "integrity": "sha1-ihis/Kmo9Bd+Cav8YDiTmwXR7t8=", + "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 + } + } + }, + "source-map": { + "version": "0.5.7", + "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.5.7.tgz", + "integrity": "sha1-igOdLRAh0i0eoUyA2OpGi6LvP8w=", + "dev": true + }, + "source-map-support": { + "version": "0.4.18", + "resolved": "https://registry.npmjs.org/source-map-support/-/source-map-support-0.4.18.tgz", + "integrity": "sha512-try0/JqxPLF9nOjvSta7tVondkP5dwgyLDjVoyMDlmjugT2lRZ1OfsrYTkCd2hkDnJTKRbO/Rl3orm8vlsUzbA==", + "dev": true, + "requires": { + "source-map": "0.5.7" + } + }, + "sprintf-js": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/sprintf-js/-/sprintf-js-1.1.1.tgz", + "integrity": "sha1-Nr54Mgr+WAH2zqPueLblqrlA6gw=", + "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, + "requires": { + "asn1": "0.2.3", + "assert-plus": "1.0.0", + "bcrypt-pbkdf": "1.0.1", + "dashdash": "1.14.1", + "ecc-jsbn": "0.1.1", + "getpass": "0.1.7", + "jsbn": "0.1.1", + "tweetnacl": "0.14.5" + } + }, + "statuses": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/statuses/-/statuses-1.4.0.tgz", + "integrity": "sha512-zhSCtt8v2NDrRlPQpCNtw/heZLtfUDqxBM1udqikb/Hbk52LK4nQSwr10u77iopCW5LsyHpuXS0GnEc48mLeew==", + "dev": true + }, + "stealthy-require": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/stealthy-require/-/stealthy-require-1.1.1.tgz", + "integrity": "sha1-NbCYdbT/SfJqd35QmzCQoyJr8ks=", + "dev": true + }, + "stream-browserify": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/stream-browserify/-/stream-browserify-2.0.1.tgz", + "integrity": "sha1-ZiZu5fm9uZQKTkUUyvtDu3Hlyds=", + "dev": true, + "requires": { + "inherits": "2.0.3", + "readable-stream": "2.3.3" + } + }, + "stream-combiner2": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/stream-combiner2/-/stream-combiner2-1.1.1.tgz", + "integrity": "sha1-+02KFCDqNidk4hrUeAOXvry0HL4=", + "dev": true, + "requires": { + "duplexer2": "0.1.4", + "readable-stream": "2.3.3" + } + }, + "stream-http": { + "version": "2.8.0", + "resolved": "https://registry.npmjs.org/stream-http/-/stream-http-2.8.0.tgz", + "integrity": "sha512-sZOFxI/5xw058XIRHl4dU3dZ+TTOIGJR78Dvo0oEAejIt4ou27k+3ne1zYmCV+v7UucbxIFQuOgnkTVHh8YPnw==", + "dev": true, + "requires": { + "builtin-status-codes": "3.0.0", + "inherits": "2.0.3", + "readable-stream": "2.3.3", + "to-arraybuffer": "1.0.1", + "xtend": "4.0.1" + } + }, + "stream-splicer": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/stream-splicer/-/stream-splicer-2.0.0.tgz", + "integrity": "sha1-G2O+Q4oTPktnHMGTUZdgAXWRDYM=", + "dev": true, + "requires": { + "inherits": "2.0.3", + "readable-stream": "2.3.3" + } + }, + "string-width": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-2.1.1.tgz", + "integrity": "sha512-nOqH59deCq9SRHlxq1Aw85Jnt4w6KvLKqWVik6oA9ZklXLNIOlqg4F2yrT1MVaTjAqvVwdfeZ7w7aCvJD7ugkw==", + "dev": true, + "requires": { + "is-fullwidth-code-point": "2.0.0", + "strip-ansi": "4.0.0" + }, + "dependencies": { + "ansi-regex": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-3.0.0.tgz", + "integrity": "sha1-7QMXwyIGT3lGbAKWa922Bas32Zg=", + "dev": true + }, + "strip-ansi": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-4.0.0.tgz", + "integrity": "sha1-qEeQIusaw2iocTibY1JixQXuNo8=", + "dev": true, + "requires": { + "ansi-regex": "3.0.0" + } + } + } + }, + "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 + }, + "stringstream": { + "version": "0.0.5", + "resolved": "https://registry.npmjs.org/stringstream/-/stringstream-0.0.5.tgz", + "integrity": "sha1-TkhM1N5aC7vuGORjB3EKioFiGHg=", + "dev": 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, + "requires": { + "ansi-regex": "2.1.1" + } + }, + "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 + }, + "subarg": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/subarg/-/subarg-1.0.0.tgz", + "integrity": "sha1-9izxdYHplrSPyWVpn1TAauJouNI=", + "dev": true, + "requires": { + "minimist": "1.2.0" + }, + "dependencies": { + "minimist": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.0.tgz", + "integrity": "sha1-o1AIsg9BOD7sH7kU9M1d95omQoQ=", + "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 + }, + "syntax-error": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/syntax-error/-/syntax-error-1.3.0.tgz", + "integrity": "sha1-HtkmbE1AvnXcVb+bsct3Biu5bKE=", + "dev": true, + "requires": { + "acorn": "4.0.13" + } + }, + "table": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/table/-/table-4.0.2.tgz", + "integrity": "sha512-UUkEAPdSGxtRpiV9ozJ5cMTtYiqz7Ni1OGqLXRCynrvzdtR1p+cfOWe2RJLwvUG8hNanaSRjecIqwOjqeatDsA==", + "dev": true, + "requires": { + "ajv": "5.5.2", + "ajv-keywords": "2.1.1", + "chalk": "2.3.0", + "lodash": "4.17.4", + "slice-ansi": "1.0.0", + "string-width": "2.1.1" + }, + "dependencies": { + "ansi-styles": { + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.0.tgz", + "integrity": "sha512-NnSOmMEYtVR2JVMIGTzynRkkaxtiq1xnFBcdQD/DnNCYPoEPsVJhM98BDyaoNOQIi7p4okdi3E27eN7GQbsUug==", + "dev": true, + "requires": { + "color-convert": "1.9.1" + } + }, + "chalk": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.3.0.tgz", + "integrity": "sha512-Az5zJR2CBujap2rqXGaJKaPHyJ0IrUimvYNX+ncCy8PJP4ltOGTrHUIo097ZaL2zMeKYpiCdqDvS6zdrTFok3Q==", + "dev": true, + "requires": { + "ansi-styles": "3.2.0", + "escape-string-regexp": "1.0.5", + "supports-color": "4.5.0" + } + }, + "supports-color": { + "version": "4.5.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-4.5.0.tgz", + "integrity": "sha1-vnoN5ITexcXN34s9WRJQRJEvY1s=", + "dev": true, + "requires": { + "has-flag": "2.0.0" + } + } + } + }, + "tar-stream": { + "version": "1.5.5", + "resolved": "https://registry.npmjs.org/tar-stream/-/tar-stream-1.5.5.tgz", + "integrity": "sha512-mQdgLPc/Vjfr3VWqWbfxW8yQNiJCbAZ+Gf6GDu1Cy0bdb33ofyiNGBtAY96jHFhDuivCwgW1H9DgTON+INiXgg==", + "dev": true, + "requires": { + "bl": "1.2.1", + "end-of-stream": "1.4.1", + "readable-stream": "2.3.3", + "xtend": "4.0.1" + } + }, + "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 + }, + "through2": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/through2/-/through2-2.0.3.tgz", + "integrity": "sha1-AARWmzfHx0ujnEPzzteNGtlBQL4=", + "dev": true, + "requires": { + "readable-stream": "2.3.3", + "xtend": "4.0.1" + } + }, + "timers-browserify": { + "version": "1.4.2", + "resolved": "https://registry.npmjs.org/timers-browserify/-/timers-browserify-1.4.2.tgz", + "integrity": "sha1-ycWLV1voQHN1y14kYtrO50NZ9B0=", + "dev": true, + "requires": { + "process": "0.11.10" + } + }, + "tmp": { + "version": "0.0.31", + "resolved": "https://registry.npmjs.org/tmp/-/tmp-0.0.31.tgz", + "integrity": "sha1-jzirlDjhcxXl29izZX6L+yd65Kc=", + "dev": true, + "requires": { + "os-tmpdir": "1.0.2" + } + }, + "to-array": { + "version": "0.1.4", + "resolved": "https://registry.npmjs.org/to-array/-/to-array-0.1.4.tgz", + "integrity": "sha1-F+bBH3PdTz10zaek/zI46a2b+JA=", + "dev": true + }, + "to-arraybuffer": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/to-arraybuffer/-/to-arraybuffer-1.0.1.tgz", + "integrity": "sha1-fSKbH8xjfkZsoIEYCDanqr/4P0M=", + "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.3", + "resolved": "https://registry.npmjs.org/tough-cookie/-/tough-cookie-2.3.3.tgz", + "integrity": "sha1-C2GKVWW23qkL80JdBNVe3EdadWE=", + "dev": true, + "requires": { + "punycode": "1.4.1" + } + }, + "tr46": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/tr46/-/tr46-1.0.1.tgz", + "integrity": "sha1-qLE/1r/SSJUZZ0zN5VujaTtwbQk=", + "dev": true, + "requires": { + "punycode": "2.1.0" + }, + "dependencies": { + "punycode": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/punycode/-/punycode-2.1.0.tgz", + "integrity": "sha1-X4Y+3Im5bbCQdLrXlHvwkFbKTn0=", + "dev": 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 + }, + "tty-browserify": { + "version": "0.0.0", + "resolved": "https://registry.npmjs.org/tty-browserify/-/tty-browserify-0.0.0.tgz", + "integrity": "sha1-oVe6QC2iTpv5V/mqadUk7tQpAaY=", + "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, + "requires": { + "safe-buffer": "5.1.1" + } + }, + "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, + "requires": { + "prelude-ls": "1.1.2" + } + }, + "type-detect": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/type-detect/-/type-detect-1.0.0.tgz", + "integrity": "sha1-diIXzAbbJY7EiQihKY6LlRIejqI=", + "dev": true + }, + "type-is": { + "version": "1.6.15", + "resolved": "https://registry.npmjs.org/type-is/-/type-is-1.6.15.tgz", + "integrity": "sha1-yrEPtJCeRByChC6v4a1kbIGARBA=", + "dev": true, + "requires": { + "media-typer": "0.3.0", + "mime-types": "2.1.17" + } + }, + "typedarray": { + "version": "0.0.6", + "resolved": "https://registry.npmjs.org/typedarray/-/typedarray-0.0.6.tgz", + "integrity": "sha1-hnrHTjhkGHsdPUfZlqeOxciDB3c=", + "dev": true + }, + "ultron": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/ultron/-/ultron-1.1.1.tgz", + "integrity": "sha512-UIEXBNeYmKptWH6z8ZnqTeS8fV74zG0/eRU9VGkpzz+LIJNs8W/zM/L+7ctCkRrgbNnnR0xxw4bKOr0cW0N0Og==", + "dev": true + }, + "umd": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/umd/-/umd-3.0.1.tgz", + "integrity": "sha1-iuVW4RAR9jwllnCKiDclnwGz1g4=", + "dev": true + }, + "underscore": { + "version": "1.6.0", + "resolved": "https://registry.npmjs.org/underscore/-/underscore-1.6.0.tgz", + "integrity": "sha1-izixDKze9jM3uLJOT/htRa6lKag=", + "dev": true + }, + "underscore.string": { + "version": "3.3.4", + "resolved": "https://registry.npmjs.org/underscore.string/-/underscore.string-3.3.4.tgz", + "integrity": "sha1-LCo/n4PmR2L9xF5s6sZRQoZCE9s=", + "dev": true, + "requires": { + "sprintf-js": "1.1.1", + "util-deprecate": "1.0.2" + } + }, + "unpipe": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/unpipe/-/unpipe-1.0.0.tgz", + "integrity": "sha1-sr9O6FFKrmFltIF4KdIbLvSZBOw=", + "dev": true + }, + "url": { + "version": "0.11.0", + "resolved": "https://registry.npmjs.org/url/-/url-0.11.0.tgz", + "integrity": "sha1-ODjpfPxgUh63PFJajlW/3Z4uKPE=", + "dev": true, + "requires": { + "punycode": "1.3.2", + "querystring": "0.2.0" + }, + "dependencies": { + "punycode": { + "version": "1.3.2", + "resolved": "https://registry.npmjs.org/punycode/-/punycode-1.3.2.tgz", + "integrity": "sha1-llOgNvt8HuQjQvIyXM7v6jkmxI0=", + "dev": true + } + } + }, + "useragent": { + "version": "2.2.1", + "resolved": "https://registry.npmjs.org/useragent/-/useragent-2.2.1.tgz", + "integrity": "sha1-z1k+9PLRdYdei7ZY6pLhik/QbY4=", + "dev": true, + "requires": { + "lru-cache": "2.2.4", + "tmp": "0.0.31" + } + }, + "util": { + "version": "0.10.3", + "resolved": "https://registry.npmjs.org/util/-/util-0.10.3.tgz", + "integrity": "sha1-evsa/lCAUkZInj23/g7TeTNqwPk=", + "dev": true, + "requires": { + "inherits": "2.0.1" + }, + "dependencies": { + "inherits": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.1.tgz", + "integrity": "sha1-sX0I0ya0Qj5Wjv9xn5GwscvfafE=", + "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 + }, + "utils-merge": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/utils-merge/-/utils-merge-1.0.1.tgz", + "integrity": "sha1-n5VxD1CiZ5R7LMwSR0HBAoQn5xM=", + "dev": true + }, + "uuid": { + "version": "3.2.1", + "resolved": "https://registry.npmjs.org/uuid/-/uuid-3.2.1.tgz", + "integrity": "sha512-jZnMwlb9Iku/O3smGWvZhauCf6cvvpKi4BKRiliS3cxnI+Gz9j5MEpTz2UFuXiKPJocb7gnsLHwiS05ige5BEA==", + "dev": true + }, + "vargs": { + "version": "0.1.0", + "resolved": "https://registry.npmjs.org/vargs/-/vargs-0.1.0.tgz", + "integrity": "sha1-a2GE2mUgzDIEzhtAfKwm2SYJ6/8=", + "dev": true + }, + "verror": { + "version": "1.10.0", + "resolved": "https://registry.npmjs.org/verror/-/verror-1.10.0.tgz", + "integrity": "sha1-OhBcoXBTr1XW4nDB+CiGguGNpAA=", + "dev": true, + "requires": { + "assert-plus": "1.0.0", + "core-util-is": "1.0.2", + "extsprintf": "1.3.0" + } + }, + "vm-browserify": { + "version": "0.0.4", + "resolved": "https://registry.npmjs.org/vm-browserify/-/vm-browserify-0.0.4.tgz", + "integrity": "sha1-XX6kW7755Kb/ZflUOOCofDV9WnM=", + "dev": true, + "requires": { + "indexof": "0.0.1" + } + }, + "void-elements": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/void-elements/-/void-elements-2.0.1.tgz", + "integrity": "sha1-wGavtYK7HLQSjWDqkjkulNXp2+w=", + "dev": true + }, + "w3c-hr-time": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/w3c-hr-time/-/w3c-hr-time-1.0.1.tgz", + "integrity": "sha1-gqwr/2PZUOqeMYmlimViX+3xkEU=", + "dev": true, + "requires": { + "browser-process-hrtime": "0.1.2" + } + }, + "walkdir": { + "version": "0.0.11", + "resolved": "https://registry.npmjs.org/walkdir/-/walkdir-0.0.11.tgz", + "integrity": "sha1-oW0CXrkxvQO1LzCMrtD0D86+lTI=", + "dev": true + }, + "wd": { + "version": "1.5.0", + "resolved": "https://registry.npmjs.org/wd/-/wd-1.5.0.tgz", + "integrity": "sha512-e/KpzTlhtSG3Ek0AcRz4G6PhxGsc53Nro+GkI1er9p05tWQ7W9dpGZR5SqQzGUqvbaqJCThDSAGaY7LHgi6MiA==", + "dev": true, + "requires": { + "archiver": "1.3.0", + "async": "2.0.1", + "lodash": "4.16.2", + "mkdirp": "0.5.1", + "q": "1.4.1", + "request": "2.79.0", + "underscore.string": "3.3.4", + "vargs": "0.1.0" + }, + "dependencies": { + "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 + }, + "async": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/async/-/async-2.0.1.tgz", + "integrity": "sha1-twnMAoCpw28J9FNr6CPIOKkEniU=", + "dev": true, + "requires": { + "lodash": "4.16.2" + } + }, + "aws-sign2": { + "version": "0.6.0", + "resolved": "https://registry.npmjs.org/aws-sign2/-/aws-sign2-0.6.0.tgz", + "integrity": "sha1-FDQt0428yU0OW4fXY81jYSwOeU8=", + "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, + "requires": { + "hoek": "2.16.3" + } + }, + "caseless": { + "version": "0.11.0", + "resolved": "https://registry.npmjs.org/caseless/-/caseless-0.11.0.tgz", + "integrity": "sha1-cVuW6phBWTzDMGeSP17GDr2k99c=", + "dev": true + }, + "cryptiles": { + "version": "2.0.5", + "resolved": "https://registry.npmjs.org/cryptiles/-/cryptiles-2.0.5.tgz", + "integrity": "sha1-O9/s3GCBR8HGcgL6KR59ylnqo7g=", + "dev": true, + "requires": { + "boom": "2.10.1" + } + }, + "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, + "requires": { + "asynckit": "0.4.0", + "combined-stream": "1.0.5", + "mime-types": "2.1.17" + } + }, + "har-validator": { + "version": "2.0.6", + "resolved": "https://registry.npmjs.org/har-validator/-/har-validator-2.0.6.tgz", + "integrity": "sha1-zcvAgYgmWtEZtqWnyKtw7s+10n0=", + "dev": true, + "requires": { + "chalk": "1.1.3", + "commander": "2.13.0", + "is-my-json-valid": "2.17.1", + "pinkie-promise": "2.0.1" + } + }, + "hawk": { + "version": "3.1.3", + "resolved": "https://registry.npmjs.org/hawk/-/hawk-3.1.3.tgz", + "integrity": "sha1-B4REvXwWQLD+VA0sm3PVlnjo4cQ=", + "dev": true, + "requires": { + "boom": "2.10.1", + "cryptiles": "2.0.5", + "hoek": "2.16.3", + "sntp": "1.0.9" + } + }, + "hoek": { + "version": "2.16.3", + "resolved": "https://registry.npmjs.org/hoek/-/hoek-2.16.3.tgz", + "integrity": "sha1-ILt0A9POo5jpHcRxCo/xuCdKJe0=", + "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, + "requires": { + "assert-plus": "0.2.0", + "jsprim": "1.4.1", + "sshpk": "1.13.1" + } + }, + "lodash": { + "version": "4.16.2", + "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.16.2.tgz", + "integrity": "sha1-PmJtuCcEimmSgaihJSJjJs/A5lI=", + "dev": true + }, + "q": { + "version": "1.4.1", + "resolved": "https://registry.npmjs.org/q/-/q-1.4.1.tgz", + "integrity": "sha1-VXBbzZPF82c1MMLCy8DCs63cKG4=", + "dev": true + }, + "qs": { + "version": "6.3.2", + "resolved": "https://registry.npmjs.org/qs/-/qs-6.3.2.tgz", + "integrity": "sha1-51vV9uJoEioqDgvaYwslUMFmUCw=", + "dev": true + }, + "request": { + "version": "2.79.0", + "resolved": "https://registry.npmjs.org/request/-/request-2.79.0.tgz", + "integrity": "sha1-Tf5b9r6LjNw3/Pk+BLZVd3InEN4=", + "dev": true, + "requires": { + "aws-sign2": "0.6.0", + "aws4": "1.6.0", + "caseless": "0.11.0", + "combined-stream": "1.0.5", + "extend": "3.0.1", + "forever-agent": "0.6.1", + "form-data": "2.1.4", + "har-validator": "2.0.6", + "hawk": "3.1.3", + "http-signature": "1.1.1", + "is-typedarray": "1.0.0", + "isstream": "0.1.2", + "json-stringify-safe": "5.0.1", + "mime-types": "2.1.17", + "oauth-sign": "0.8.2", + "qs": "6.3.2", + "stringstream": "0.0.5", + "tough-cookie": "2.3.3", + "tunnel-agent": "0.4.3", + "uuid": "3.2.1" + } + }, + "sntp": { + "version": "1.0.9", + "resolved": "https://registry.npmjs.org/sntp/-/sntp-1.0.9.tgz", + "integrity": "sha1-ZUEYTMkK7qbG57NeJlkIJEPGYZg=", + "dev": true, + "requires": { + "hoek": "2.16.3" + } + }, + "tunnel-agent": { + "version": "0.4.3", + "resolved": "https://registry.npmjs.org/tunnel-agent/-/tunnel-agent-0.4.3.tgz", + "integrity": "sha1-Y3PbdpCf5XDgjXNYM2Xtgop07us=", + "dev": true + } + } + }, + "webidl-conversions": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/webidl-conversions/-/webidl-conversions-4.0.2.tgz", + "integrity": "sha512-YQ+BmxuTgd6UXZW3+ICGfyqRyHXVlD5GtQr5+qjiNW7bF0cqrzX500HVXPBOvgXb5YnzDd+h0zqyv61KUD7+Sg==", + "dev": true + }, + "whatwg-encoding": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/whatwg-encoding/-/whatwg-encoding-1.0.3.tgz", + "integrity": "sha512-jLBwwKUhi8WtBfsMQlL4bUUcT8sMkAtQinscJAe/M4KHCkHuUJAF6vuB0tueNIw4c8ziO6AkRmgY+jL3a0iiPw==", + "dev": true, + "requires": { + "iconv-lite": "0.4.19" + } + }, + "whatwg-url": { + "version": "6.4.0", + "resolved": "https://registry.npmjs.org/whatwg-url/-/whatwg-url-6.4.0.tgz", + "integrity": "sha512-Z0CVh/YE217Foyb488eo+iBv+r7eAQ0wSTyApi9n06jhcA3z6Nidg/EGvl0UFkg7kMdKxfBzzr+o9JF+cevgMg==", + "dev": true, + "requires": { + "lodash.sortby": "4.7.0", + "tr46": "1.0.1", + "webidl-conversions": "4.0.2" + } + }, + "which": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/which/-/which-1.3.0.tgz", + "integrity": "sha512-xcJpopdamTuY5duC/KnTTNBraPK54YwpenP4lzxU8H91GudWpFv38u0CKjclE1Wi2EH2EDz5LRcHcKbCIzqGyg==", + "dev": true, + "requires": { + "isexe": "2.0.0" + } + }, + "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, + "requires": { + "mkdirp": "0.5.1" + } + }, + "ws": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/ws/-/ws-4.0.0.tgz", + "integrity": "sha512-QYslsH44bH8O7/W2815u5DpnCpXWpEK44FmaHffNwgJI4JMaSZONgPBTOfrxJ29mXKbXak+LsJ2uAkDTYq2ptQ==", + "dev": true, + "requires": { + "async-limiter": "1.0.0", + "safe-buffer": "5.1.1", + "ultron": "1.1.1" + } + }, + "wtf-8": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/wtf-8/-/wtf-8-1.0.0.tgz", + "integrity": "sha1-OS2LotDxw00e4tYw8V0O+2jhBIo=", + "dev": true + }, + "xml-name-validator": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/xml-name-validator/-/xml-name-validator-3.0.0.tgz", + "integrity": "sha512-A5CUptxDsvxKJEU3yO6DuWBSJz/qizqzJKOMIfUJHETbBw/sFaDxgd6fxm1ewUaM0jZ444Fc5vC5ROYurg/4Pw==", + "dev": true + }, + "xmlhttprequest-ssl": { + "version": "1.5.3", + "resolved": "https://registry.npmjs.org/xmlhttprequest-ssl/-/xmlhttprequest-ssl-1.5.3.tgz", + "integrity": "sha1-GFqIjATspGw+QHDZn3tJ3jUomS0=", + "dev": true + }, + "xtend": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/xtend/-/xtend-4.0.1.tgz", + "integrity": "sha1-pcbVMr5lbiPbgg77lDofBJmNY68=", + "dev": true + }, + "yallist": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/yallist/-/yallist-2.1.2.tgz", + "integrity": "sha1-HBH5IY8HYImkfdUS+TxmmaaoHVI=", + "dev": true + }, + "yeast": { + "version": "0.1.2", + "resolved": "https://registry.npmjs.org/yeast/-/yeast-0.1.2.tgz", + "integrity": "sha1-AI4G2AlDIMNy28L47XagymyKxBk=", + "dev": true + }, + "zip-stream": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/zip-stream/-/zip-stream-1.2.0.tgz", + "integrity": "sha1-qLxF9MG0lpnGuQGYuqyqzbzUugQ=", + "dev": true, + "requires": { + "archiver-utils": "1.3.0", + "compress-commons": "1.2.2", + "lodash": "4.17.4", + "readable-stream": "2.3.3" + } + } + } +} diff --git a/package.json b/package.json index c81f13c5..215b537d 100644 --- a/package.json +++ b/package.json @@ -7,7 +7,8 @@ "test": "tests" }, "scripts": { - "test": "PATH=$PATH:node_modules/karma/bin karma start karma.conf.js", + "lint": "eslint app core tests utils", + "test": "karma start karma.conf.js", "prepare": "node ./utils/use_require.js --as commonjs --clean" }, "repository": { @@ -40,6 +41,7 @@ "chai": "^3.5.0", "commander": "^2.9.0", "es-module-loader": "^2.1.0", + "eslint": "^4.16.0", "fs-extra": "^1.0.0", "jsdom": "*", "karma": "^1.3.0", diff --git a/tests/.eslintrc b/tests/.eslintrc new file mode 100644 index 00000000..e087085f --- /dev/null +++ b/tests/.eslintrc @@ -0,0 +1,9 @@ +{ + "env": { + "node": true, + "mocha": true + }, + "globals": { + "chai": true + } +} diff --git a/tests/assertions.js b/tests/assertions.js index a3d22c1e..833245cc 100644 --- a/tests/assertions.js +++ b/tests/assertions.js @@ -5,23 +5,21 @@ chai.use(sinonChai); // noVNC specific assertions chai.use(function (_chai, utils) { _chai.Assertion.addMethod('displayed', function (target_data) { - var obj = this._obj; - var ctx = obj._target.getContext('2d'); - var data_cl = ctx.getImageData(0, 0, obj._target.width, obj._target.height).data; + const obj = this._obj; + const ctx = obj._target.getContext('2d'); + const data_cl = ctx.getImageData(0, 0, obj._target.width, obj._target.height).data; // NB(directxman12): PhantomJS 1.x doesn't implement Uint8ClampedArray, so work around that - var data = new Uint8Array(data_cl); - var len = data_cl.length; + const data = new Uint8Array(data_cl); + const len = data_cl.length; new chai.Assertion(len).to.be.equal(target_data.length, "unexpected display size"); - var same = true; - for (var i = 0; i < len; i++) { + let same = true; + for (let i = 0; i < len; i++) { if (data[i] != target_data[i]) { same = false; break; } } - if (!same) { - console.log("expected data: %o, actual data: %o", target_data, data); - } + this.assert(same, "expected #{this} to have displayed the image #{exp}, but instead it displayed #{act}", "expected #{this} not to have displayed the image #{act}", @@ -30,28 +28,26 @@ chai.use(function (_chai, utils) { }); _chai.Assertion.addMethod('sent', function (target_data) { - var obj = this._obj; - obj.inspect = function () { - var res = { _websocket: obj._websocket, rQi: obj._rQi, _rQ: new Uint8Array(obj._rQ.buffer, 0, obj._rQlen), + const obj = this._obj; + obj.inspect = () => { + const res = { _websocket: obj._websocket, rQi: obj._rQi, _rQ: new Uint8Array(obj._rQ.buffer, 0, obj._rQlen), _sQ: new Uint8Array(obj._sQ.buffer, 0, obj._sQlen) }; res.prototype = obj; return res; }; - var data = obj._websocket._get_sent_data(); - var same = true; + const data = obj._websocket._get_sent_data(); + let same = true; if (data.length != target_data.length) { same = false; } else { - for (var i = 0; i < data.length; i++) { + for (let i = 0; i < data.length; i++) { if (data[i] != target_data[i]) { same = false; break; } } } - if (!same) { - console.log("expected data: %o, actual data: %o", target_data, data); - } + this.assert(same, "expected #{this} to have sent the data #{exp}, but it actually sent #{act}", "expected #{this} not to have sent the data #{act}", @@ -66,13 +62,11 @@ chai.use(function (_chai, utils) { _chai.Assertion.overwriteMethod('equal', function (_super) { return function assertArrayEqual(target) { if (utils.flag(this, 'array')) { - var obj = this._obj; - - var i; - var same = true; + const obj = this._obj; + let same = true; if (utils.flag(this, 'deep')) { - for (i = 0; i < obj.length; i++) { + for (let i = 0; i < obj.length; i++) { if (!utils.eql(obj[i], target[i])) { same = false; break; @@ -84,7 +78,7 @@ chai.use(function (_chai, utils) { "expected #{this} not to have elements deeply equal to #{exp}", Array.prototype.slice.call(target)); } else { - for (i = 0; i < obj.length; i++) { + for (let i = 0; i < obj.length; i++) { if (obj[i] != target[i]) { same = false; break; diff --git a/tests/fake.websocket.js b/tests/fake.websocket.js index eb4f203d..2e1a3b95 100644 --- a/tests/fake.websocket.js +++ b/tests/fake.websocket.js @@ -1,43 +1,45 @@ +import Base64 from '../core/base64.js'; + // PhantomJS can't create Event objects directly, so we need to use this function make_event(name, props) { - var evt = document.createEvent('Event'); + const evt = document.createEvent('Event'); evt.initEvent(name, true, true); if (props) { - for (var prop in props) { + for (let prop in props) { evt[prop] = props[prop]; } } return evt; } -export default function FakeWebSocket (uri, protocols) { - this.url = uri; - this.binaryType = "arraybuffer"; - this.extensions = ""; +export default class FakeWebSocket { + constructor(uri, protocols) { + this.url = uri; + this.binaryType = "arraybuffer"; + this.extensions = ""; - if (!protocols || typeof protocols === 'string') { - this.protocol = protocols; - } else { - this.protocol = protocols[0]; + if (!protocols || typeof protocols === 'string') { + this.protocol = protocols; + } else { + this.protocol = protocols[0]; + } + + this._send_queue = new Uint8Array(20000); + + this.readyState = FakeWebSocket.CONNECTING; + this.bufferedAmount = 0; + + this.__is_fake = true; } - this._send_queue = new Uint8Array(20000); - - this.readyState = FakeWebSocket.CONNECTING; - this.bufferedAmount = 0; - - this.__is_fake = true; -}; - -FakeWebSocket.prototype = { - close: function (code, reason) { + close(code, reason) { this.readyState = FakeWebSocket.CLOSED; if (this.onclose) { this.onclose(make_event("close", { 'code': code, 'reason': reason, 'wasClean': true })); } - }, + } - send: function (data) { + send(data) { if (this.protocol == 'base64') { data = Base64.decode(data); } else { @@ -45,25 +47,25 @@ FakeWebSocket.prototype = { } this._send_queue.set(data, this.bufferedAmount); this.bufferedAmount += data.length; - }, + } - _get_sent_data: function () { - var res = new Uint8Array(this._send_queue.buffer, 0, this.bufferedAmount); + _get_sent_data() { + const res = new Uint8Array(this._send_queue.buffer, 0, this.bufferedAmount); this.bufferedAmount = 0; return res; - }, + } - _open: function (data) { + _open() { this.readyState = FakeWebSocket.OPEN; if (this.onopen) { this.onopen(make_event('open')); } - }, + } - _receive_data: function (data) { + _receive_data(data) { this.onmessage(make_event("message", { 'data': data })); } -}; +} FakeWebSocket.OPEN = WebSocket.OPEN; FakeWebSocket.CONNECTING = WebSocket.CONNECTING; @@ -72,16 +74,18 @@ FakeWebSocket.CLOSED = WebSocket.CLOSED; FakeWebSocket.__is_fake = true; -FakeWebSocket.replace = function () { +FakeWebSocket.replace = () => { if (!WebSocket.__is_fake) { - var real_version = WebSocket; + const real_version = WebSocket; + // eslint-disable-next-line no-global-assign WebSocket = FakeWebSocket; FakeWebSocket.__real_version = real_version; } }; -FakeWebSocket.restore = function () { +FakeWebSocket.restore = () => { if (WebSocket.__is_fake) { + // eslint-disable-next-line no-global-assign WebSocket = WebSocket.__real_version; } }; diff --git a/tests/karma-test-main.js b/tests/karma-test-main.js index 657e3121..b3538046 100644 --- a/tests/karma-test-main.js +++ b/tests/karma-test-main.js @@ -1,8 +1,8 @@ -var TEST_REGEXP = /test\..*\.js/; -var allTestFiles = []; -var extraFiles = ['/base/tests/assertions.js']; +const TEST_REGEXP = /test\..*\.js/; +const allTestFiles = []; +const extraFiles = ['/base/tests/assertions.js']; -Object.keys(window.__karma__.files).forEach(function (file) { +Object.keys(window.__karma__.files).forEach((file) => { if (TEST_REGEXP.test(file)) { // TODO: normalize? allTestFiles.push(file); diff --git a/tests/playback-ui.js b/tests/playback-ui.js index a23b7fae..d3b75f1a 100644 --- a/tests/playback-ui.js +++ b/tests/playback-ui.js @@ -1,18 +1,19 @@ +/* global VNC_frame_data, VNC_frame_encoding */ + import * as WebUtil from '../app/webutil.js'; import RecordingPlayer from './playback.js'; -var frames = null; -var encoding = null; +let frames = null; +let encoding = null; function message(str) { - console.log(str); - var cell = document.getElementById('messages'); + const cell = document.getElementById('messages'); cell.textContent += str + "\n"; cell.scrollTop = cell.scrollHeight; } function loadFile() { - const fname = WebUtil.getQueryVar('data', null); + const fname = WebUtil.getQueryconst('data', null); if (!fname) { return Promise.reject("Must specify data=FOO in query string."); @@ -21,7 +22,7 @@ function loadFile() { message("Loading " + fname); return new Promise(function (resolve, reject) { - var script = document.createElement("script"); + const script = document.createElement("script"); script.onload = resolve; script.onerror = reject; document.body.appendChild(script); @@ -30,10 +31,10 @@ function loadFile() { } function enableUI() { - var iterations = WebUtil.getQueryVar('iterations', 3); + const iterations = WebUtil.getQueryconst('iterations', 3); document.getElementById('iterations').value = iterations; - var mode = WebUtil.getQueryVar('mode', 3); + const mode = WebUtil.getQueryconst('mode', 3); if (mode === 'realtime') { document.getElementById('mode2').checked = true; } else { @@ -120,7 +121,7 @@ IterationPlayer.prototype = { this._state = 'failed'; } - var evt = new Event('rfbdisconnected'); + const evt = new Event('rfbdisconnected'); evt.clean = clean; evt.frame = frame; evt.iteration = this._iteration; @@ -135,7 +136,7 @@ function start() { const iterations = document.getElementById('iterations').value; - var mode; + let mode; if (document.getElementById('mode1').checked) { message(`Starting performance playback (fullspeed) [${iterations} iteration(s)]`); diff --git a/tests/playback.js b/tests/playback.js index ddce4449..63e9f812 100644 --- a/tests/playback.js +++ b/tests/playback.js @@ -10,11 +10,12 @@ import Base64 from '../core/base64.js'; // Immediate polyfill if (setImmediate === undefined) { - var _immediateIdCounter = 1; - var _immediateFuncs = {}; + let _immediateIdCounter = 1; + const _immediateFuncs = {}; - var setImmediate = function (func) { - var index = _immediateIdCounter++; + // eslint-disable-next-line no-unused-vars + const setImmediate = function (func) { + const index = _immediateIdCounter++; _immediateFuncs[index] = func; window.postMessage("noVNC immediate trigger:" + index, "*"); return index; @@ -24,15 +25,15 @@ if (setImmediate === undefined) { _immediateFuncs[id]; }; - var _onMessage = function (event) { + const _onMessage = function (event) { if ((typeof event.data !== "string") || (event.data.indexOf("noVNC immediate trigger:") !== 0)) { return; } - var index = event.data.slice("noVNC immediate trigger:".length); + const index = event.data.slice("noVNC immediate trigger:".length); - var callback = _immediateFuncs[index]; + const callback = _immediateFuncs[index]; if (callback === undefined) { return; } @@ -70,11 +71,11 @@ export default function RecordingPlayer (frames, encoding, disconnected) { this._running = false; - this.onfinish = function () {}; + this.onfinish = () => {}; } RecordingPlayer.prototype = { - run: function (realtime, trafficManagement) { + run(realtime, trafficManagement) { // initialize a new RFB this._rfb = new RFB(document.getElementById('VNC_screen'), 'wss://test'); this._rfb.viewOnly = true; @@ -95,20 +96,20 @@ RecordingPlayer.prototype = { }, // _enablePlaybackMode mocks out things not required for running playback - _enablePlaybackMode: function () { - this._rfb._sock.send = function (arr) {}; - this._rfb._sock.close = function () {}; - this._rfb._sock.flush = function () {}; - this._rfb._sock.open = function () { + _enablePlaybackMode() { + this._rfb._sock.send = () => {}; + this._rfb._sock.close = () => {}; + this._rfb._sock.flush = () => {}; + this._rfb._sock.open = () => { this.init(); this._eventHandlers.open(); }; }, - _queueNextPacket: function () { + _queueNextPacket() { if (!this._running) { return; } - var frame = this._frames[this._frame_index]; + let frame = this._frames[this._frame_index]; // skip send frames while (this._frame_index < this._frame_length && frame.charAt(0) === "}") { @@ -140,7 +141,7 @@ RecordingPlayer.prototype = { } }, - _doPacket: function () { + _doPacket() { // Avoid having excessive queue buildup in non-realtime mode if (this._trafficManagement && this._rfb._flushing) { let player = this; @@ -154,12 +155,13 @@ RecordingPlayer.prototype = { } const frame = this._frames[this._frame_index]; - var start = frame.indexOf('{', 1) + 1; + let start = frame.indexOf('{', 1) + 1; + let u8; if (this._encoding === 'base64') { - var u8 = Base64.decode(frame.slice(start)); + u8 = Base64.decode(frame.slice(start)); start = 0; } else { - var u8 = new Uint8Array(frame.length - start); + u8 = new Uint8Array(frame.length - start); for (let i = 0; i < frame.length - start; i++) { u8[i] = frame.charCodeAt(start + i); } @@ -173,7 +175,7 @@ RecordingPlayer.prototype = { _finish() { if (this._rfb._display.pending()) { - var player = this; + const player = this; this._rfb._display.onflush = function () { if (player._rfb._flushing) { player._rfb._onFlush(); diff --git a/tests/test.base64.js b/tests/test.base64.js index cfee409c..040f30c5 100644 --- a/tests/test.base64.js +++ b/tests/test.base64.js @@ -1,29 +1,26 @@ -var assert = chai.assert; -var expect = chai.expect; +const expect = chai.expect; import Base64 from '../core/base64.js'; describe('Base64 Tools', function() { - "use strict"; - - var BIN_ARR = new Array(256); - for (var i = 0; i < 256; i++) { + const BIN_ARR = new Array(256); + for (let i = 0; i < 256; i++) { BIN_ARR[i] = i; } - var B64_STR = "AAECAwQFBgcICQoLDA0ODxAREhMUFRYXGBkaGxwdHh8gISIjJCUmJygpKissLS4vMDEyMzQ1Njc4OTo7PD0+P0BBQkNERUZHSElKS0xNTk9QUVJTVFVWV1hZWltcXV5fYGFiY2RlZmdoaWprbG1ub3BxcnN0dXZ3eHl6e3x9fn+AgYKDhIWGh4iJiouMjY6PkJGSk5SVlpeYmZqbnJ2en6ChoqOkpaanqKmqq6ytrq+wsbKztLW2t7i5uru8vb6/wMHCw8TFxsfIycrLzM3Oz9DR0tPU1dbX2Nna29zd3t/g4eLj5OXm5+jp6uvs7e7v8PHy8/T19vf4+fr7/P3+/w=="; + const B64_STR = "AAECAwQFBgcICQoLDA0ODxAREhMUFRYXGBkaGxwdHh8gISIjJCUmJygpKissLS4vMDEyMzQ1Njc4OTo7PD0+P0BBQkNERUZHSElKS0xNTk9QUVJTVFVWV1hZWltcXV5fYGFiY2RlZmdoaWprbG1ub3BxcnN0dXZ3eHl6e3x9fn+AgYKDhIWGh4iJiouMjY6PkJGSk5SVlpeYmZqbnJ2en6ChoqOkpaanqKmqq6ytrq+wsbKztLW2t7i5uru8vb6/wMHCw8TFxsfIycrLzM3Oz9DR0tPU1dbX2Nna29zd3t/g4eLj5OXm5+jp6uvs7e7v8PHy8/T19vf4+fr7/P3+/w=="; describe('encode', function() { it('should encode a binary string into Base64', function() { - var encoded = Base64.encode(BIN_ARR); + const encoded = Base64.encode(BIN_ARR); expect(encoded).to.equal(B64_STR); }); }); describe('decode', function() { it('should decode a Base64 string into a normal string', function() { - var decoded = Base64.decode(B64_STR); + const decoded = Base64.decode(B64_STR); expect(decoded).to.deep.equal(BIN_ARR); }); diff --git a/tests/test.display.js b/tests/test.display.js index 2e8f90e2..f24f26cf 100644 --- a/tests/test.display.js +++ b/tests/test.display.js @@ -1,5 +1,4 @@ -/* jshint expr: true */ -var expect = chai.expect; +const expect = chai.expect; import Base64 from '../core/base64.js'; import Display from '../core/display.js'; @@ -7,37 +6,35 @@ import Display from '../core/display.js'; import sinon from '../vendor/sinon.js'; describe('Display/Canvas Helper', function () { - var checked_data = [ + const checked_data = new Uint8Array([ 0x00, 0x00, 0xff, 255, 0x00, 0x00, 0xff, 255, 0x00, 0xff, 0x00, 255, 0x00, 0xff, 0x00, 255, 0x00, 0x00, 0xff, 255, 0x00, 0x00, 0xff, 255, 0x00, 0xff, 0x00, 255, 0x00, 0xff, 0x00, 255, 0x00, 0xff, 0x00, 255, 0x00, 0xff, 0x00, 255, 0x00, 0x00, 0xff, 255, 0x00, 0x00, 0xff, 255, 0x00, 0xff, 0x00, 255, 0x00, 0xff, 0x00, 255, 0x00, 0x00, 0xff, 255, 0x00, 0x00, 0xff, 255 - ]; - checked_data = new Uint8Array(checked_data); + ]); - var basic_data = [0xff, 0x00, 0x00, 255, 0x00, 0xff, 0x00, 255, 0x00, 0x00, 0xff, 255, 0xff, 0xff, 0xff, 255]; - basic_data = new Uint8Array(basic_data); + const basic_data = new Uint8Array([0xff, 0x00, 0x00, 255, 0x00, 0xff, 0x00, 255, 0x00, 0x00, 0xff, 255, 0xff, 0xff, 0xff, 255]); function make_image_canvas (input_data) { - var canvas = document.createElement('canvas'); + const canvas = document.createElement('canvas'); canvas.width = 4; canvas.height = 4; - var ctx = canvas.getContext('2d'); - var data = ctx.createImageData(4, 4); - for (var i = 0; i < checked_data.length; i++) { data.data[i] = input_data[i]; } + const ctx = canvas.getContext('2d'); + const data = ctx.createImageData(4, 4); + for (let i = 0; i < checked_data.length; i++) { data.data[i] = input_data[i]; } ctx.putImageData(data, 0, 0); return canvas; } function make_image_png (input_data) { - var canvas = make_image_canvas(input_data); - var url = canvas.toDataURL(); - var data = url.split(",")[1]; + const canvas = make_image_canvas(input_data); + const url = canvas.toDataURL(); + const data = url.split(",")[1]; return Base64.decode(data); } describe('viewport handling', function () { - var display; + let display; beforeEach(function () { display = new Display(document.createElement('canvas')); display.clipViewport = true; @@ -52,10 +49,9 @@ describe('Display/Canvas Helper', function () { display.drawImage(make_image_canvas(basic_data), 1, 1); display.flip(); - var expected = new Uint8Array(16); - var i; - for (i = 0; i < 8; i++) { expected[i] = basic_data[i]; } - for (i = 8; i < 16; i++) { expected[i] = 0; } + const expected = new Uint8Array(16); + for (let i = 0; i < 8; i++) { expected[i] = basic_data[i]; } + for (let i = 8; i < 16; i++) { expected[i] = 0; } expect(display).to.have.displayed(expected); }); @@ -120,7 +116,7 @@ describe('Display/Canvas Helper', function () { }); describe('resizing', function () { - var display; + let display; beforeEach(function () { display = new Display(document.createElement('canvas')); display.clipViewport = false; @@ -137,8 +133,8 @@ describe('Display/Canvas Helper', function () { display.fillRect(0, 0, 4, 4, [0, 0, 0xff]); display.resize(2, 2); display.flip(); - var expected = []; - for (var i = 0; i < 4 * 2*2; i += 4) { + const expected = []; + for (let i = 0; i < 4 * 2*2; i += 4) { expected[i] = 0xff; expected[i+1] = expected[i+2] = 0; expected[i+3] = 0xff; @@ -180,8 +176,8 @@ describe('Display/Canvas Helper', function () { }); describe('rescaling', function () { - var display; - var canvas; + let display; + let canvas; beforeEach(function () { canvas = document.createElement('canvas'); @@ -221,8 +217,8 @@ describe('Display/Canvas Helper', function () { }); describe('autoscaling', function () { - var display; - var canvas; + let display; + let canvas; beforeEach(function () { canvas = document.createElement('canvas'); @@ -269,7 +265,7 @@ describe('Display/Canvas Helper', function () { // TODO(directxman12): improve the tests for each of the drawing functions to cover more than just the // basic cases - var display; + let display; beforeEach(function () { display = new Display(document.createElement('canvas')); display.resize(4, 4); @@ -280,15 +276,15 @@ describe('Display/Canvas Helper', function () { display._logo = null; display.clear(); display.resize(4, 4); - var empty = []; - for (var i = 0; i < 4 * display._fb_width * display._fb_height; i++) { empty[i] = 0; } + const empty = []; + for (let i = 0; i < 4 * display._fb_width * display._fb_height; i++) { empty[i] = 0; } expect(display).to.have.displayed(new Uint8Array(empty)); }); it('should draw the logo on #clear with a logo set', function (done) { display._logo = { width: 4, height: 4, type: "image/png", data: make_image_png(checked_data) }; display.clear(); - display.onflush = function () { + display.onflush = () => { expect(display).to.have.displayed(checked_data); expect(display._fb_width).to.equal(4); expect(display._fb_height).to.equal(4); @@ -301,8 +297,8 @@ describe('Display/Canvas Helper', function () { display.fillRect(0, 0, 4, 4, [0, 0, 0xff]); display.flip(); display.fillRect(0, 0, 4, 4, [0, 0xff, 0]); - var expected = []; - for (var i = 0; i < 4 * display._fb_width * display._fb_height; i += 4) { + const expected = []; + for (let i = 0; i < 4 * display._fb_width * display._fb_height; i += 4) { expected[i] = 0xff; expected[i+1] = expected[i+2] = 0; expected[i+3] = 0xff; @@ -329,7 +325,7 @@ describe('Display/Canvas Helper', function () { it('should support drawing images via #imageRect', function (done) { display.imageRect(0, 0, "image/png", make_image_png(checked_data)); display.flip(); - display.onflush = function () { + display.onflush = () => { expect(display).to.have.displayed(checked_data); done(); }; @@ -372,8 +368,8 @@ describe('Display/Canvas Helper', function () { }); it('should support drawing BGRX blit images with true color via #blitImage', function () { - var data = []; - for (var i = 0; i < 16; i++) { + const data = []; + for (let i = 0; i < 16; i++) { data[i * 4] = checked_data[i * 4 + 2]; data[i * 4 + 1] = checked_data[i * 4 + 1]; data[i * 4 + 2] = checked_data[i * 4]; @@ -385,8 +381,8 @@ describe('Display/Canvas Helper', function () { }); it('should support drawing RGB blit images with true color via #blitRgbImage', function () { - var data = []; - for (var i = 0; i < 16; i++) { + const data = []; + for (let i = 0; i < 16; i++) { data[i * 3] = checked_data[i * 4]; data[i * 3 + 1] = checked_data[i * 4 + 1]; data[i * 3 + 2] = checked_data[i * 4 + 2]; @@ -397,7 +393,7 @@ describe('Display/Canvas Helper', function () { }); it('should support drawing an image object via #drawImage', function () { - var img = make_image_canvas(checked_data); + const img = make_image_canvas(checked_data); display.drawImage(img, 0, 0); display.flip(); expect(display).to.have.displayed(checked_data); @@ -405,7 +401,7 @@ describe('Display/Canvas Helper', function () { }); describe('the render queue processor', function () { - var display; + let display; beforeEach(function () { display = new Display(document.createElement('canvas')); display.resize(4, 4); @@ -428,7 +424,7 @@ describe('Display/Canvas Helper', function () { }); it('should wait until an image is loaded to attempt to draw it and the rest of the queue', function () { - var img = { complete: false, addEventListener: sinon.spy() } + const img = { complete: false, addEventListener: sinon.spy() } display._renderQ = [{ type: 'img', x: 3, y: 4, img: img }, { type: 'fill', x: 1, y: 2, width: 3, height: 4, color: 5 }]; display.drawImage = sinon.spy(); diff --git a/tests/test.helper.js b/tests/test.helper.js index aa64e955..4fbdf07c 100644 --- a/tests/test.helper.js +++ b/tests/test.helper.js @@ -1,5 +1,4 @@ -var assert = chai.assert; -var expect = chai.expect; +const expect = chai.expect; import keysyms from '../core/input/keysymdef.js'; import * as KeyboardUtil from "../core/input/util.js"; @@ -12,8 +11,6 @@ function isEdge() { } describe('Helpers', function() { - "use strict"; - describe('keysyms.lookup', function() { it('should map ASCII characters to keysyms', function() { expect(keysyms.lookup('a'.charCodeAt())).to.be.equal(0x61); @@ -71,7 +68,7 @@ describe('Helpers', function() { }); describe('Fix Meta on macOS', function() { - var origNavigator; + let origNavigator; beforeEach(function () { // window.navigator is a protected read-only property in many // environments, so we need to redefine it whilst running these @@ -134,7 +131,7 @@ describe('Helpers', function() { }); describe('Broken key AltGraph on IE/Edge', function() { - var origNavigator; + let origNavigator; beforeEach(function () { // window.navigator is a protected read-only property in many // environments, so we need to redefine it whilst running these diff --git a/tests/test.keyboard.js b/tests/test.keyboard.js index 513d797f..e841322f 100644 --- a/tests/test.keyboard.js +++ b/tests/test.keyboard.js @@ -1,5 +1,4 @@ -var assert = chai.assert; -var expect = chai.expect; +const expect = chai.expect; import sinon from '../vendor/sinon.js'; @@ -12,27 +11,24 @@ function isEdge() { return navigator && !!(/edge/i).exec(navigator.userAgent); } -/* jshint newcap: false, expr: true */ describe('Key Event Handling', function() { - "use strict"; - // The real KeyboardEvent constructor might not work everywhere we // want to run these tests function keyevent(typeArg, KeyboardEventInit) { - var e = { type: typeArg }; - for (var key in KeyboardEventInit) { + const e = { type: typeArg }; + for (let key in KeyboardEventInit) { e[key] = KeyboardEventInit[key]; } e.stopPropagation = sinon.spy(); e.preventDefault = sinon.spy(); return e; - }; + } describe('Decode Keyboard Events', function() { it('should decode keydown events', function(done) { if (isIE() || isEdge()) this.skip(); - var kbd = new Keyboard(document); - kbd.onkeyevent = function(keysym, code, down) { + const kbd = new Keyboard(document); + kbd.onkeyevent = (keysym, code, down) => { expect(keysym).to.be.equal(0x61); expect(code).to.be.equal('KeyA'); expect(down).to.be.equal(true); @@ -42,9 +38,9 @@ describe('Key Event Handling', function() { }); it('should decode keyup events', function(done) { if (isIE() || isEdge()) this.skip(); - var calls = 0; - var kbd = new Keyboard(document); - kbd.onkeyevent = function(keysym, code, down) { + let calls = 0; + const kbd = new Keyboard(document); + kbd.onkeyevent = (keysym, code, down) => { expect(keysym).to.be.equal(0x61); expect(code).to.be.equal('KeyA'); if (calls++ === 1) { @@ -58,14 +54,14 @@ describe('Key Event Handling', function() { describe('Legacy keypress Events', function() { it('should wait for keypress when needed', function() { - var kbd = new Keyboard(document); + const kbd = new Keyboard(document); kbd.onkeyevent = sinon.spy(); kbd._handleKeyDown(keyevent('keydown', {code: 'KeyA', keyCode: 0x41})); expect(kbd.onkeyevent).to.not.have.been.called; }); it('should decode keypress events', function(done) { - var kbd = new Keyboard(document); - kbd.onkeyevent = function(keysym, code, down) { + const kbd = new Keyboard(document); + kbd.onkeyevent = (keysym, code, down) => { expect(keysym).to.be.equal(0x61); expect(code).to.be.equal('KeyA'); expect(down).to.be.equal(true); @@ -75,15 +71,15 @@ describe('Key Event Handling', function() { kbd._handleKeyPress(keyevent('keypress', {code: 'KeyA', charCode: 0x61})); }); it('should ignore keypress with different code', function() { - var kbd = new Keyboard(document); + const kbd = new Keyboard(document); kbd.onkeyevent = sinon.spy(); kbd._handleKeyDown(keyevent('keydown', {code: 'KeyA', keyCode: 0x41})); kbd._handleKeyPress(keyevent('keypress', {code: 'KeyB', charCode: 0x61})); expect(kbd.onkeyevent).to.not.have.been.called; }); it('should handle keypress with missing code', function(done) { - var kbd = new Keyboard(document); - kbd.onkeyevent = function(keysym, code, down) { + const kbd = new Keyboard(document); + kbd.onkeyevent = (keysym, code, down) => { expect(keysym).to.be.equal(0x61); expect(code).to.be.equal('KeyA'); expect(down).to.be.equal(true); @@ -93,8 +89,8 @@ describe('Key Event Handling', function() { kbd._handleKeyPress(keyevent('keypress', {charCode: 0x61})); }); it('should guess key if no keypress and numeric key', function(done) { - var kbd = new Keyboard(document); - kbd.onkeyevent = function(keysym, code, down) { + const kbd = new Keyboard(document); + kbd.onkeyevent = (keysym, code, down) => { expect(keysym).to.be.equal(0x32); expect(code).to.be.equal('Digit2'); expect(down).to.be.equal(true); @@ -103,8 +99,8 @@ describe('Key Event Handling', function() { kbd._handleKeyDown(keyevent('keydown', {code: 'Digit2', keyCode: 0x32})); }); it('should guess key if no keypress and alpha key', function(done) { - var kbd = new Keyboard(document); - kbd.onkeyevent = function(keysym, code, down) { + const kbd = new Keyboard(document); + kbd.onkeyevent = (keysym, code, down) => { expect(keysym).to.be.equal(0x61); expect(code).to.be.equal('KeyA'); expect(down).to.be.equal(true); @@ -113,8 +109,8 @@ describe('Key Event Handling', function() { kbd._handleKeyDown(keyevent('keydown', {code: 'KeyA', keyCode: 0x41, shiftKey: false})); }); it('should guess key if no keypress and alpha key (with shift)', function(done) { - var kbd = new Keyboard(document); - kbd.onkeyevent = function(keysym, code, down) { + const kbd = new Keyboard(document); + kbd.onkeyevent = (keysym, code, down) => { expect(keysym).to.be.equal(0x41); expect(code).to.be.equal('KeyA'); expect(down).to.be.equal(true); @@ -123,8 +119,8 @@ describe('Key Event Handling', function() { kbd._handleKeyDown(keyevent('keydown', {code: 'KeyA', keyCode: 0x41, shiftKey: true})); }); it('should not guess key if no keypress and unknown key', function(done) { - var kbd = new Keyboard(document); - kbd.onkeyevent = function(keysym, code, down) { + const kbd = new Keyboard(document); + kbd.onkeyevent = (keysym, code, down) => { expect(keysym).to.be.equal(0); expect(code).to.be.equal('KeyA'); expect(down).to.be.equal(true); @@ -139,27 +135,27 @@ describe('Key Event Handling', function() { if (isIE() || isEdge()) this.skip(); }); it('should suppress anything with a valid key', function() { - var kbd = new Keyboard(document, {}); - var evt = keyevent('keydown', {code: 'KeyA', key: 'a'}); - kbd._handleKeyDown(evt); - expect(evt.preventDefault).to.have.been.called; - evt = keyevent('keyup', {code: 'KeyA', key: 'a'}); - kbd._handleKeyUp(evt); - expect(evt.preventDefault).to.have.been.called; + const kbd = new Keyboard(document, {}); + const evt1 = keyevent('keydown', {code: 'KeyA', key: 'a'}); + kbd._handleKeyDown(evt1); + expect(evt1.preventDefault).to.have.been.called; + const evt2 = keyevent('keyup', {code: 'KeyA', key: 'a'}); + kbd._handleKeyUp(evt2); + expect(evt2.preventDefault).to.have.been.called; }); it('should not suppress keys without key', function() { - var kbd = new Keyboard(document, {}); - var evt = keyevent('keydown', {code: 'KeyA', keyCode: 0x41}); + const kbd = new Keyboard(document, {}); + const evt = keyevent('keydown', {code: 'KeyA', keyCode: 0x41}); kbd._handleKeyDown(evt); expect(evt.preventDefault).to.not.have.been.called; }); it('should suppress the following keypress event', function() { - var kbd = new Keyboard(document, {}); - var evt = keyevent('keydown', {code: 'KeyA', keyCode: 0x41}); - kbd._handleKeyDown(evt); - var evt = keyevent('keypress', {code: 'KeyA', charCode: 0x41}); - kbd._handleKeyPress(evt); - expect(evt.preventDefault).to.have.been.called; + const kbd = new Keyboard(document, {}); + const evt1 = keyevent('keydown', {code: 'KeyA', keyCode: 0x41}); + kbd._handleKeyDown(evt1); + const evt2 = keyevent('keypress', {code: 'KeyA', charCode: 0x41}); + kbd._handleKeyPress(evt2); + expect(evt2.preventDefault).to.have.been.called; }); }); }); @@ -167,9 +163,9 @@ describe('Key Event Handling', function() { describe('Fake keyup', function() { it('should fake keyup events for virtual keyboards', function(done) { if (isIE() || isEdge()) this.skip(); - var count = 0; - var kbd = new Keyboard(document); - kbd.onkeyevent = function(keysym, code, down) { + let count = 0; + const kbd = new Keyboard(document); + kbd.onkeyevent = (keysym, code, down) => { switch (count++) { case 0: expect(keysym).to.be.equal(0x61); @@ -187,7 +183,7 @@ describe('Key Event Handling', function() { }); describe('iOS', function() { - var origNavigator; + let origNavigator; beforeEach(function () { // window.navigator is a protected read-only property in many // environments, so we need to redefine it whilst running these @@ -214,9 +210,9 @@ describe('Key Event Handling', function() { it('should fake keyup events on iOS', function(done) { if (isIE() || isEdge()) this.skip(); - var count = 0; - var kbd = new Keyboard(document); - kbd.onkeyevent = function(keysym, code, down) { + let count = 0; + const kbd = new Keyboard(document); + kbd.onkeyevent = (keysym, code, down) => { switch (count++) { case 0: expect(keysym).to.be.equal(0x61); @@ -240,8 +236,8 @@ describe('Key Event Handling', function() { if (isIE() || isEdge()) this.skip(); }); it('should send release using the same keysym as the press', function(done) { - var kbd = new Keyboard(document); - kbd.onkeyevent = function(keysym, code, down) { + const kbd = new Keyboard(document); + kbd.onkeyevent = (keysym, code, down) => { expect(keysym).to.be.equal(0x61); expect(code).to.be.equal('KeyA'); if (!down) { @@ -252,9 +248,9 @@ describe('Key Event Handling', function() { kbd._handleKeyUp(keyevent('keyup', {code: 'KeyA', key: 'b'})); }); it('should send the same keysym for multiple presses', function() { - var count = 0; - var kbd = new Keyboard(document); - kbd.onkeyevent = function(keysym, code, down) { + let count = 0; + const kbd = new Keyboard(document); + kbd.onkeyevent = (keysym, code, down) => { expect(keysym).to.be.equal(0x61); expect(code).to.be.equal('KeyA'); expect(down).to.be.equal(true); @@ -265,7 +261,7 @@ describe('Key Event Handling', function() { expect(count).to.be.equal(2); }); it('should do nothing on keyup events if no keys are down', function() { - var kbd = new Keyboard(document); + const kbd = new Keyboard(document); kbd.onkeyevent = sinon.spy(); kbd._handleKeyUp(keyevent('keyup', {code: 'KeyA', key: 'a'})); expect(kbd.onkeyevent).to.not.have.been.called; @@ -273,8 +269,8 @@ describe('Key Event Handling', function() { describe('Legacy Events', function() { it('should track keys using keyCode if no code', function(done) { - var kbd = new Keyboard(document); - kbd.onkeyevent = function(keysym, code, down) { + const kbd = new Keyboard(document); + kbd.onkeyevent = (keysym, code, down) => { expect(keysym).to.be.equal(0x61); expect(code).to.be.equal('Platform65'); if (!down) { @@ -285,16 +281,16 @@ describe('Key Event Handling', function() { kbd._handleKeyUp(keyevent('keyup', {keyCode: 65, key: 'b'})); }); it('should ignore compositing code', function() { - var kbd = new Keyboard(document); - kbd.onkeyevent = function(keysym, code, down) { + const kbd = new Keyboard(document); + kbd.onkeyevent = (keysym, code) => { expect(keysym).to.be.equal(0x61); expect(code).to.be.equal('Unidentified'); }; kbd._handleKeyDown(keyevent('keydown', {keyCode: 229, key: 'a'})); }); it('should track keys using keyIdentifier if no code', function(done) { - var kbd = new Keyboard(document); - kbd.onkeyevent = function(keysym, code, down) { + const kbd = new Keyboard(document); + kbd.onkeyevent = (keysym, code, down) => { expect(keysym).to.be.equal(0x61); expect(code).to.be.equal('Platform65'); if (!down) { @@ -308,7 +304,7 @@ describe('Key Event Handling', function() { }); describe('Shuffle modifiers on macOS', function() { - var origNavigator; + let origNavigator; beforeEach(function () { // window.navigator is a protected read-only property in many // environments, so we need to redefine it whilst running these @@ -334,9 +330,9 @@ describe('Key Event Handling', function() { }); it('should change Alt to AltGraph', function() { - var count = 0; - var kbd = new Keyboard(document); - kbd.onkeyevent = function(keysym, code, down) { + let count = 0; + const kbd = new Keyboard(document); + kbd.onkeyevent = (keysym, code) => { switch (count++) { case 0: expect(keysym).to.be.equal(0xFF7E); @@ -353,8 +349,8 @@ describe('Key Event Handling', function() { expect(count).to.be.equal(2); }); it('should change left Super to Alt', function(done) { - var kbd = new Keyboard(document); - kbd.onkeyevent = function(keysym, code, down) { + const kbd = new Keyboard(document); + kbd.onkeyevent = (keysym, code) => { expect(keysym).to.be.equal(0xFFE9); expect(code).to.be.equal('MetaLeft'); done(); @@ -362,8 +358,8 @@ describe('Key Event Handling', function() { kbd._handleKeyDown(keyevent('keydown', {code: 'MetaLeft', key: 'Meta', location: 1})); }); it('should change right Super to left Super', function(done) { - var kbd = new Keyboard(document); - kbd.onkeyevent = function(keysym, code, down) { + const kbd = new Keyboard(document); + kbd.onkeyevent = (keysym, code) => { expect(keysym).to.be.equal(0xFFEB); expect(code).to.be.equal('MetaRight'); done(); @@ -373,7 +369,7 @@ describe('Key Event Handling', function() { }); describe('Escape AltGraph on Windows', function() { - var origNavigator; + let origNavigator; beforeEach(function () { // window.navigator is a protected read-only property in many // environments, so we need to redefine it whilst running these @@ -399,9 +395,9 @@ describe('Key Event Handling', function() { }); it('should generate fake undo/redo events on press when AltGraph is down', function() { - var times_called = 0; - var kbd = new Keyboard(document); - kbd.onkeyevent = function(keysym, code, down) { + let times_called = 0; + const kbd = new Keyboard(document); + kbd.onkeyevent = (keysym, code, down) => { switch(times_called++) { case 0: expect(keysym).to.be.equal(0xFFE3); @@ -448,9 +444,9 @@ describe('Key Event Handling', function() { expect(times_called).to.be.equal(7); }); it('should no do anything on key release', function() { - var times_called = 0; - var kbd = new Keyboard(document); - kbd.onkeyevent = function(keysym, code, down) { + let times_called = 0; + const kbd = new Keyboard(document); + kbd.onkeyevent = (keysym, code, down) => { switch(times_called++) { case 7: expect(keysym).to.be.equal(0x61); @@ -468,9 +464,9 @@ describe('Key Event Handling', function() { expect(times_called).to.be.equal(8); }); it('should not consider a char modifier to be down on the modifier key itself', function() { - var times_called = 0; - var kbd = new Keyboard(document); - kbd.onkeyevent = function(keysym, code, down) { + let times_called = 0; + const kbd = new Keyboard(document); + kbd.onkeyevent = (keysym, code, down) => { switch(times_called++) { case 0: expect(keysym).to.be.equal(0xFFE3); diff --git a/tests/test.localization.js b/tests/test.localization.js index 339144a5..ae916088 100644 --- a/tests/test.localization.js +++ b/tests/test.localization.js @@ -1,15 +1,10 @@ -/* jshint expr: true */ +const expect = chai.expect; -var assert = chai.assert; -var expect = chai.expect; - -import l10nGet, { l10n } from '../app/localization.js'; +import { l10n } from '../app/localization.js'; describe('Localization', function() { - "use strict"; - describe('language selection', function () { - var origNavigator; + let origNavigator; beforeEach(function () { // window.navigator is a protected read-only property in many // environments, so we need to redefine it whilst running these @@ -35,7 +30,8 @@ describe('Localization', function() { }); it('should use English by default', function() { - expect(l10n.language).to.equal('en'); + const a = l10n.language; + expect(a).to.equal('en'); }); it('should use English if no user language matches', function() { window.navigator.languages = ["nl", "de"]; diff --git a/tests/test.mouse.js b/tests/test.mouse.js index 248a9334..756b0c5a 100644 --- a/tests/test.mouse.js +++ b/tests/test.mouse.js @@ -1,40 +1,36 @@ -var assert = chai.assert; -var expect = chai.expect; +const expect = chai.expect; import sinon from '../vendor/sinon.js'; import Mouse from '../core/input/mouse.js'; import * as eventUtils from '../core/util/events.js'; -/* jshint newcap: false, expr: true */ describe('Mouse Event Handling', function() { - "use strict"; - sinon.stub(eventUtils, 'setCapture'); // This function is only used on target (the canvas) // and for these tests we can assume that the canvas is 100x100 // located at coordinates 10x10 sinon.stub(Element.prototype, 'getBoundingClientRect').returns( {left: 10, right: 110, top: 10, bottom: 110, width: 100, height: 100}); - var target = document.createElement('canvas'); + const target = document.createElement('canvas'); // The real constructors might not work everywhere we // want to run these tests - var mouseevent, touchevent; - mouseevent = touchevent = function(typeArg, MouseEventInit) { - var e = { type: typeArg }; - for (var key in MouseEventInit) { + const touchevent = (typeArg, MouseEventInit) => { + const e = { type: typeArg }; + for (let key in MouseEventInit) { e[key] = MouseEventInit[key]; } e.stopPropagation = sinon.spy(); e.preventDefault = sinon.spy(); return e; }; + const mouseevent = touchevent; describe('Decode Mouse Events', function() { it('should decode mousedown events', function(done) { - var mouse = new Mouse(target); - mouse.onmousebutton = function(x, y, down, bmask) { + const mouse = new Mouse(target); + mouse.onmousebutton = (x, y, down, bmask) => { expect(bmask).to.be.equal(0x01); expect(down).to.be.equal(1); done(); @@ -42,9 +38,9 @@ describe('Mouse Event Handling', function() { mouse._handleMouseDown(mouseevent('mousedown', { button: '0x01' })); }); it('should decode mouseup events', function(done) { - var calls = 0; - var mouse = new Mouse(target); - mouse.onmousebutton = function(x, y, down, bmask) { + let calls = 0; + const mouse = new Mouse(target); + mouse.onmousebutton = (x, y, down, bmask) => { expect(bmask).to.be.equal(0x01); if (calls++ === 1) { expect(down).to.not.be.equal(1); @@ -55,8 +51,8 @@ describe('Mouse Event Handling', function() { mouse._handleMouseUp(mouseevent('mouseup', { button: '0x01' })); }); it('should decode mousemove events', function(done) { - var mouse = new Mouse(target); - mouse.onmousemove = function(x, y) { + const mouse = new Mouse(target); + mouse.onmousemove = (x, y) => { // Note that target relative coordinates are sent expect(x).to.be.equal(40); expect(y).to.be.equal(10); @@ -66,9 +62,9 @@ describe('Mouse Event Handling', function() { { clientX: 50, clientY: 20 })); }); it('should decode mousewheel events', function(done) { - var calls = 0; - var mouse = new Mouse(target); - mouse.onmousebutton = function(x, y, down, bmask) { + let calls = 0; + const mouse = new Mouse(target); + mouse.onmousebutton = (x, y, down, bmask) => { calls++; expect(bmask).to.be.equal(1<<6); if (calls === 1) { @@ -90,9 +86,9 @@ describe('Mouse Event Handling', function() { afterEach(function () { this.clock.restore(); }); it('should use same pos for 2nd tap if close enough', function(done) { - var calls = 0; - var mouse = new Mouse(target); - mouse.onmousebutton = function(x, y, down, bmask) { + let calls = 0; + const mouse = new Mouse(target); + mouse.onmousebutton = (x, y, down) => { calls++; if (calls === 1) { expect(down).to.be.equal(1); @@ -121,9 +117,9 @@ describe('Mouse Event Handling', function() { }); it('should not modify 2nd tap pos if far apart', function(done) { - var calls = 0; - var mouse = new Mouse(target); - mouse.onmousebutton = function(x, y, down, bmask) { + let calls = 0; + const mouse = new Mouse(target); + mouse.onmousebutton = (x, y, down) => { calls++; if (calls === 1) { expect(down).to.be.equal(1); @@ -150,9 +146,9 @@ describe('Mouse Event Handling', function() { }); it('should not modify 2nd tap pos if not soon enough', function(done) { - var calls = 0; - var mouse = new Mouse(target); - mouse.onmousebutton = function(x, y, down, bmask) { + let calls = 0; + const mouse = new Mouse(target); + mouse.onmousebutton = (x, y, down) => { calls++; if (calls === 1) { expect(down).to.be.equal(1); @@ -179,9 +175,9 @@ describe('Mouse Event Handling', function() { }); it('should not modify 2nd tap pos if not touch', function(done) { - var calls = 0; - var mouse = new Mouse(target); - mouse.onmousebutton = function(x, y, down, bmask) { + let calls = 0; + const mouse = new Mouse(target); + mouse.onmousebutton = (x, y, down) => { calls++; if (calls === 1) { expect(down).to.be.equal(1); @@ -215,7 +211,7 @@ describe('Mouse Event Handling', function() { afterEach(function () { this.clock.restore(); }); it('should accumulate wheel events if small enough', function () { - var mouse = new Mouse(target); + const mouse = new Mouse(target); mouse.onmousebutton = sinon.spy(); mouse._handleMouseWheel(mouseevent( @@ -248,7 +244,7 @@ describe('Mouse Event Handling', function() { }); it('should not accumulate large wheel events', function () { - var mouse = new Mouse(target); + const mouse = new Mouse(target); mouse.onmousebutton = sinon.spy(); mouse._handleMouseWheel(mouseevent( @@ -267,7 +263,7 @@ describe('Mouse Event Handling', function() { }); it('should send even small wheel events after a timeout', function () { - var mouse = new Mouse(target); + const mouse = new Mouse(target); mouse.onmousebutton = sinon.spy(); mouse._handleMouseWheel(mouseevent( @@ -279,7 +275,7 @@ describe('Mouse Event Handling', function() { }); it('should account for non-zero deltaMode', function () { - var mouse = new Mouse(target); + const mouse = new Mouse(target); mouse.onmousebutton = sinon.spy(); mouse._handleMouseWheel(mouseevent( diff --git a/tests/test.rfb.js b/tests/test.rfb.js index 31a7f2d5..7ddf265d 100644 --- a/tests/test.rfb.js +++ b/tests/test.rfb.js @@ -1,6 +1,4 @@ -/* jshint expr: true */ -var assert = chai.assert; -var expect = chai.expect; +const expect = chai.expect; import RFB from '../core/rfb.js'; import Websock from '../core/websock.js'; @@ -15,7 +13,7 @@ import sinon from '../vendor/sinon.js'; function UIEvent ( event, params ) { params = params || { bubbles: false, cancelable: false, view: window, detail: undefined }; - var evt = document.createEvent( 'UIEvent' ); + const evt = document.createEvent( 'UIEvent' ); evt.initUIEvent( event, params.bubbles, params.cancelable, params.view, params.detail ); return evt; } @@ -25,18 +23,18 @@ import sinon from '../vendor/sinon.js'; window.UIEvent = UIEvent; })(); -var push8 = function (arr, num) { +const push8 = (arr, num) =>{ "use strict"; arr.push(num & 0xFF); }; -var push16 = function (arr, num) { +const push16 = (arr, num) => { "use strict"; arr.push((num >> 8) & 0xFF, num & 0xFF); }; -var push32 = function (arr, num) { +const push32 = (arr, num) => { "use strict"; arr.push((num >> 24) & 0xFF, (num >> 16) & 0xFF, @@ -45,8 +43,8 @@ var push32 = function (arr, num) { }; describe('Remote Frame Buffer Protocol Client', function() { - var clock; - var raf; + let clock; + let raf; before(FakeWebSocket.replace); after(FakeWebSocket.restore); @@ -58,16 +56,15 @@ describe('Remote Frame Buffer Protocol Client', function() { window.requestAnimationFrame = setTimeout; // Use a single set of buffers instead of reallocating to // speed up tests - var sock = new Websock(); - var _sQ = new Uint8Array(sock._sQbufferSize); - var rQ = new Uint8Array(sock._rQbufferSize); + const sock = new Websock(); + const _sQ = new Uint8Array(sock._sQbufferSize); + const rQ = new Uint8Array(sock._rQbufferSize); Websock.prototype._old_allocate_buffers = Websock.prototype._allocate_buffers; Websock.prototype._allocate_buffers = function () { this._sQ = _sQ; this._rQ = rQ; }; - }); after(function () { @@ -76,8 +73,8 @@ describe('Remote Frame Buffer Protocol Client', function() { window.requestAnimationFrame = raf; }); - var container; - var rfbs; + let container; + let rfbs; beforeEach(function () { // Create a container element for all RFB objects to attach to @@ -104,7 +101,7 @@ describe('Remote Frame Buffer Protocol Client', function() { function make_rfb (url, options) { url = url || 'wss://host:8675'; - var rfb = new RFB(container, url, options); + const rfb = new RFB(container, url, options); clock.tick(); rfb._sock._websocket._open(); rfb._rfb_connection_state = 'connected'; @@ -116,14 +113,14 @@ describe('Remote Frame Buffer Protocol Client', function() { describe('Connecting/Disconnecting', function () { describe('#RFB', function () { it('should set the current state to "connecting"', function () { - var client = new RFB(document.createElement('div'), 'wss://host:8675'); + const client = new RFB(document.createElement('div'), 'wss://host:8675'); client._rfb_connection_state = ''; this.clock.tick(); expect(client._rfb_connection_state).to.equal('connecting'); }); it('should actually connect to the websocket', function () { - var client = new RFB(document.createElement('div'), 'ws://HOST:8675/PATH'); + const client = new RFB(document.createElement('div'), 'ws://HOST:8675/PATH'); sinon.spy(client._sock, 'open'); this.clock.tick(); expect(client._sock.open).to.have.been.calledOnce; @@ -132,7 +129,7 @@ describe('Remote Frame Buffer Protocol Client', function() { }); describe('#disconnect', function () { - var client; + let client; beforeEach(function () { client = make_rfb(); }); @@ -168,7 +165,7 @@ describe('Remote Frame Buffer Protocol Client', function() { }); describe('#sendCredentials', function () { - var client; + let client; beforeEach(function () { client = make_rfb(); client._rfb_connection_state = 'connecting'; @@ -189,14 +186,14 @@ describe('Remote Frame Buffer Protocol Client', function() { }); describe('Public API Basic Behavior', function () { - var client; + let client; beforeEach(function () { client = make_rfb(); }); describe('#sendCtrlAlDel', function () { it('should sent ctrl[down]-alt[down]-del[down] then del[up]-alt[up]-ctrl[up]', function () { - var expected = {_sQ: new Uint8Array(48), _sQlen: 0, flush: function () {}}; + const expected = {_sQ: new Uint8Array(48), _sQlen: 0, flush: function () {}}; RFB.messages.keyEvent(expected, 0xFFE3, 1); RFB.messages.keyEvent(expected, 0xFFE9, 1); RFB.messages.keyEvent(expected, 0xFFFF, 1); @@ -225,14 +222,14 @@ describe('Remote Frame Buffer Protocol Client', function() { describe('#sendKey', function () { it('should send a single key with the given code and state (down = true)', function () { - var expected = {_sQ: new Uint8Array(8), _sQlen: 0, flush: function () {}}; + const expected = {_sQ: new Uint8Array(8), _sQlen: 0, flush: function () {}}; RFB.messages.keyEvent(expected, 123, 1); client.sendKey(123, 'Key123', true); expect(client._sock).to.have.sent(expected._sQ); }); it('should send both a down and up event if the state is not specified', function () { - var expected = {_sQ: new Uint8Array(16), _sQlen: 0, flush: function () {}}; + const expected = {_sQ: new Uint8Array(16), _sQlen: 0, flush: function () {}}; RFB.messages.keyEvent(expected, 123, 1); RFB.messages.keyEvent(expected, 123, 0); client.sendKey(123, 'Key123'); @@ -255,7 +252,7 @@ describe('Remote Frame Buffer Protocol Client', function() { it('should send QEMU extended events if supported', function () { client._qemuExtKeyEventSupported = true; - var expected = {_sQ: new Uint8Array(12), _sQlen: 0, flush: function () {}}; + const expected = {_sQ: new Uint8Array(12), _sQlen: 0, flush: function () {}}; RFB.messages.QEMUExtendedKeyEvent(expected, 0x20, true, 0x0039); client.sendKey(0x20, 'Space', true); expect(client._sock).to.have.sent(expected._sQ); @@ -263,7 +260,7 @@ describe('Remote Frame Buffer Protocol Client', function() { it('should not send QEMU extended events if unknown key code', function () { client._qemuExtKeyEventSupported = true; - var expected = {_sQ: new Uint8Array(8), _sQlen: 0, flush: function () {}}; + const expected = {_sQ: new Uint8Array(8), _sQlen: 0, flush: function () {}}; RFB.messages.keyEvent(expected, 123, 1); client.sendKey(123, 'FooBar', true); expect(client._sock).to.have.sent(expected._sQ); @@ -288,7 +285,7 @@ describe('Remote Frame Buffer Protocol Client', function() { describe('#clipboardPasteFrom', function () { it('should send the given text in a paste event', function () { - var expected = {_sQ: new Uint8Array(11), _sQlen: 0, flush: function () {}}; + const expected = {_sQ: new Uint8Array(11), _sQlen: 0, flush: function () {}}; RFB.messages.clientCutText(expected, 'abc'); client.clipboardPasteFrom('abc'); expect(client._sock).to.have.sent(expected._sQ); @@ -331,7 +328,7 @@ describe('Remote Frame Buffer Protocol Client', function() { }); describe('Clipping', function () { - var client; + let client; beforeEach(function () { client = make_rfb(); container.style.width = '70px'; @@ -340,7 +337,7 @@ describe('Remote Frame Buffer Protocol Client', function() { }); it('should update display clip state when changing the property', function () { - var spy = sinon.spy(client._display, "clipViewport", ["set"]); + const spy = sinon.spy(client._display, "clipViewport", ["set"]); client.clipViewport = false; expect(spy.set).to.have.been.calledOnce; @@ -357,7 +354,7 @@ describe('Remote Frame Buffer Protocol Client', function() { container.style.width = '40px'; container.style.height = '50px'; - var event = new UIEvent('resize'); + const event = new UIEvent('resize'); window.dispatchEvent(event); clock.tick(); @@ -367,7 +364,7 @@ describe('Remote Frame Buffer Protocol Client', function() { it('should update the viewport when the remote session resizes', function () { // Simple ExtendedDesktopSize FBU message - var incoming = [ 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, + const incoming = [ 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x00, 0xff, 0xff, 0xff, 0xfe, 0xcc, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x00, 0xff, @@ -389,7 +386,7 @@ describe('Remote Frame Buffer Protocol Client', function() { container.style.width = '40px'; container.style.height = '50px'; - var event = new UIEvent('resize'); + const event = new UIEvent('resize'); window.dispatchEvent(event); clock.tick(); @@ -402,7 +399,7 @@ describe('Remote Frame Buffer Protocol Client', function() { container.style.width = '40px'; container.style.height = '50px'; - var event = new UIEvent('resize'); + const event = new UIEvent('resize'); window.dispatchEvent(event); clock.tick(); @@ -504,7 +501,7 @@ describe('Remote Frame Buffer Protocol Client', function() { }); describe('Scaling', function () { - var client; + let client; beforeEach(function () { client = make_rfb(); container.style.width = '70px'; @@ -513,7 +510,7 @@ describe('Remote Frame Buffer Protocol Client', function() { }); it('should update display scale factor when changing the property', function () { - var spy = sinon.spy(client._display, "scale", ["set"]); + const spy = sinon.spy(client._display, "scale", ["set"]); sinon.spy(client._display, "autoscale"); client.scaleViewport = false; @@ -529,7 +526,7 @@ describe('Remote Frame Buffer Protocol Client', function() { it('should update the clipping setting when changing the property', function () { client.clipViewport = true; - var spy = sinon.spy(client._display, "clipViewport", ["set"]); + const spy = sinon.spy(client._display, "clipViewport", ["set"]); client.scaleViewport = false; expect(spy.set).to.have.been.calledOnce; @@ -547,7 +544,7 @@ describe('Remote Frame Buffer Protocol Client', function() { container.style.width = '40px'; container.style.height = '50px'; - var event = new UIEvent('resize'); + const event = new UIEvent('resize'); window.dispatchEvent(event); clock.tick(); @@ -557,7 +554,7 @@ describe('Remote Frame Buffer Protocol Client', function() { it('should update the scaling when the remote session resizes', function () { // Simple ExtendedDesktopSize FBU message - var incoming = [ 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, + const incoming = [ 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x00, 0xff, 0xff, 0xff, 0xfe, 0xcc, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x00, 0xff, @@ -578,7 +575,7 @@ describe('Remote Frame Buffer Protocol Client', function() { container.style.width = '40px'; container.style.height = '50px'; - var event = new UIEvent('resize'); + const event = new UIEvent('resize'); window.dispatchEvent(event); clock.tick(); @@ -587,7 +584,7 @@ describe('Remote Frame Buffer Protocol Client', function() { }); describe('Remote resize', function () { - var client; + let client; beforeEach(function () { client = make_rfb(); client._supportsSetDesktopSize = true; @@ -610,7 +607,7 @@ describe('Remote Frame Buffer Protocol Client', function() { it('should request a resize when initially connecting', function () { // Simple ExtendedDesktopSize FBU message - var incoming = [ 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, + const incoming = [ 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x00, 0x04, 0xff, 0xff, 0xfe, 0xcc, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x00, 0x04, @@ -637,7 +634,7 @@ describe('Remote Frame Buffer Protocol Client', function() { it('should request a resize when the container resizes', function () { container.style.width = '40px'; container.style.height = '50px'; - var event = new UIEvent('resize'); + const event = new UIEvent('resize'); window.dispatchEvent(event); clock.tick(1000); @@ -648,16 +645,14 @@ describe('Remote Frame Buffer Protocol Client', function() { it('should not resize until the container size is stable', function () { container.style.width = '20px'; container.style.height = '30px'; - var event = new UIEvent('resize'); - window.dispatchEvent(event); + window.dispatchEvent(new UIEvent('resize')); clock.tick(400); expect(RFB.messages.setDesktopSize).to.not.have.been.called; container.style.width = '40px'; container.style.height = '50px'; - var event = new UIEvent('resize'); - window.dispatchEvent(event); + window.dispatchEvent(new UIEvent('resize')); clock.tick(400); expect(RFB.messages.setDesktopSize).to.not.have.been.called; @@ -673,7 +668,7 @@ describe('Remote Frame Buffer Protocol Client', function() { container.style.width = '40px'; container.style.height = '50px'; - var event = new UIEvent('resize'); + const event = new UIEvent('resize'); window.dispatchEvent(event); clock.tick(1000); @@ -685,7 +680,7 @@ describe('Remote Frame Buffer Protocol Client', function() { container.style.width = '40px'; container.style.height = '50px'; - var event = new UIEvent('resize'); + const event = new UIEvent('resize'); window.dispatchEvent(event); clock.tick(1000); @@ -697,7 +692,7 @@ describe('Remote Frame Buffer Protocol Client', function() { container.style.width = '40px'; container.style.height = '50px'; - var event = new UIEvent('resize'); + const event = new UIEvent('resize'); window.dispatchEvent(event); clock.tick(1000); @@ -706,7 +701,7 @@ describe('Remote Frame Buffer Protocol Client', function() { it('should not try to override a server resize', function () { // Simple ExtendedDesktopSize FBU message - var incoming = [ 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, + const incoming = [ 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x00, 0x04, 0xff, 0xff, 0xfe, 0xcc, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x00, 0x04, @@ -720,13 +715,13 @@ describe('Remote Frame Buffer Protocol Client', function() { describe('Misc Internals', function () { describe('#_updateConnectionState', function () { - var client; + let client; beforeEach(function () { client = make_rfb(); }); it('should clear the disconnect timer if the state is not "disconnecting"', function () { - var spy = sinon.spy(); + const spy = sinon.spy(); client._disconnTimer = setTimeout(spy, 50); client._rfb_connection_state = 'connecting'; client._updateConnectionState('connected'); @@ -749,7 +744,7 @@ describe('Remote Frame Buffer Protocol Client', function() { }); it('should ignore state changes to the same state', function () { - var connectSpy = sinon.spy(); + const connectSpy = sinon.spy(); client.addEventListener("connect", connectSpy); expect(client._rfb_connection_state).to.equal('connected'); @@ -758,7 +753,7 @@ describe('Remote Frame Buffer Protocol Client', function() { client.disconnect(); - var disconnectSpy = sinon.spy(); + const disconnectSpy = sinon.spy(); client.addEventListener("disconnect", disconnectSpy); expect(client._rfb_connection_state).to.equal('disconnected'); @@ -767,7 +762,7 @@ describe('Remote Frame Buffer Protocol Client', function() { }); it('should ignore illegal state changes', function () { - var spy = sinon.spy(); + const spy = sinon.spy(); client.addEventListener("disconnect", spy); client._updateConnectionState('disconnected'); expect(client._rfb_connection_state).to.not.equal('disconnected'); @@ -776,7 +771,7 @@ describe('Remote Frame Buffer Protocol Client', function() { }); describe('#_fail', function () { - var client; + let client; beforeEach(function () { client = make_rfb(); }); @@ -795,7 +790,7 @@ describe('Remote Frame Buffer Protocol Client', function() { expect(client._rfb_connection_state).to.equal('disconnected'); }); - it('should set clean_disconnect variable', function () { + it('should set clean_disconnect constiable', function () { client._rfb_clean_disconnect = true; client._rfb_connection_state = 'connected'; client._fail(); @@ -804,7 +799,7 @@ describe('Remote Frame Buffer Protocol Client', function() { it('should result in disconnect event with clean set to false', function () { client._rfb_connection_state = 'connected'; - var spy = sinon.spy(); + const spy = sinon.spy(); client.addEventListener("disconnect", spy); client._fail(); this.clock.tick(2000); @@ -818,7 +813,7 @@ describe('Remote Frame Buffer Protocol Client', function() { describe('Connection States', function () { describe('connecting', function () { it('should open the websocket connection', function () { - var client = new RFB(document.createElement('div'), + const client = new RFB(document.createElement('div'), 'ws://HOST:8675/PATH'); sinon.spy(client._sock, 'open'); this.clock.tick(); @@ -827,13 +822,13 @@ describe('Remote Frame Buffer Protocol Client', function() { }); describe('connected', function () { - var client; + let client; beforeEach(function () { client = make_rfb(); }); it('should result in a connect event if state becomes connected', function () { - var spy = sinon.spy(); + const spy = sinon.spy(); client.addEventListener("connect", spy); client._rfb_connection_state = 'connecting'; client._updateConnectionState('connected'); @@ -841,23 +836,23 @@ describe('Remote Frame Buffer Protocol Client', function() { }); it('should not result in a connect event if the state is not "connected"', function () { - var spy = sinon.spy(); + const spy = sinon.spy(); client.addEventListener("connect", spy); - client._sock._websocket.open = function () {}; // explicitly don't call onopen + client._sock._websocket.open = () => {}; // explicitly don't call onopen client._updateConnectionState('connecting'); expect(spy).to.not.have.been.called; }); }); describe('disconnecting', function () { - var client; + let client; beforeEach(function () { client = make_rfb(); }); it('should force disconnect if we do not call Websock.onclose within the disconnection timeout', function () { sinon.spy(client, '_updateConnectionState'); - client._sock._websocket.close = function () {}; // explicitly don't call onclose + client._sock._websocket.close = () => {}; // explicitly don't call onclose client._updateConnectionState('disconnecting'); this.clock.tick(3 * 1000); expect(client._updateConnectionState).to.have.been.calledTwice; @@ -880,22 +875,22 @@ describe('Remote Frame Buffer Protocol Client', function() { }); it('should not result in a disconnect event', function () { - var spy = sinon.spy(); + const spy = sinon.spy(); client.addEventListener("disconnect", spy); - client._sock._websocket.close = function () {}; // explicitly don't call onclose + client._sock._websocket.close = () => {}; // explicitly don't call onclose client._updateConnectionState('disconnecting'); expect(spy).to.not.have.been.called; }); }); describe('disconnected', function () { - var client; + let client; beforeEach(function () { client = new RFB(document.createElement('div'), 'ws://HOST:8675/PATH'); }); it('should result in a disconnect event if state becomes "disconnected"', function () { - var spy = sinon.spy(); + const spy = sinon.spy(); client.addEventListener("disconnect", spy); client._rfb_connection_state = 'disconnecting'; client._updateConnectionState('disconnected'); @@ -904,7 +899,7 @@ describe('Remote Frame Buffer Protocol Client', function() { }); it('should result in a disconnect event without msg when no reason given', function () { - var spy = sinon.spy(); + const spy = sinon.spy(); client.addEventListener("disconnect", spy); client._rfb_connection_state = 'disconnecting'; client._rfb_disconnect_reason = ""; @@ -916,7 +911,7 @@ describe('Remote Frame Buffer Protocol Client', function() { }); describe('Protocol Initialization States', function () { - var client; + let client; beforeEach(function () { client = make_rfb(); client._rfb_connection_state = 'connecting'; @@ -924,8 +919,8 @@ describe('Remote Frame Buffer Protocol Client', function() { describe('ProtocolVersion', function () { function send_ver (ver, client) { - var arr = new Uint8Array(12); - for (var i = 0; i < ver.length; i++) { + const arr = new Uint8Array(12); + for (let i = 0; i < ver.length; i++) { arr[i+4] = ver.charCodeAt(i); } arr[0] = 'R'; arr[1] = 'F'; arr[2] = 'B'; arr[3] = ' '; @@ -984,9 +979,9 @@ describe('Remote Frame Buffer Protocol Client', function() { it('should send back the interpreted version', function () { send_ver('004.000', client); - var expected_str = 'RFB 003.008\n'; - var expected = []; - for (var i = 0; i < expected_str.length; i++) { + const expected_str = 'RFB 003.008\n'; + const expected = []; + for (let i = 0; i < expected_str.length; i++) { expected[i] = expected_str.charCodeAt(i); } @@ -1008,7 +1003,7 @@ describe('Remote Frame Buffer Protocol Client', function() { send_ver('000.000', client); expect(client._rfb_version).to.equal(0); - var sent_data = client._sock._websocket._get_sent_data(); + const sent_data = client._sock._websocket._get_sent_data(); expect(new Uint8Array(sent_data.buffer, 0, 9)).to.array.equal(new Uint8Array([73, 68, 58, 49, 50, 51, 52, 53, 0])); expect(sent_data).to.have.length(250); }); @@ -1028,8 +1023,8 @@ describe('Remote Frame Buffer Protocol Client', function() { it('should simply receive the auth scheme when for versions < 3.7', function () { client._rfb_version = 3.6; - var auth_scheme_raw = [1, 2, 3, 4]; - var auth_scheme = (auth_scheme_raw[0] << 24) + (auth_scheme_raw[1] << 16) + + const auth_scheme_raw = [1, 2, 3, 4]; + const auth_scheme = (auth_scheme_raw[0] << 24) + (auth_scheme_raw[1] << 16) + (auth_scheme_raw[2] << 8) + auth_scheme_raw[3]; client._sock._websocket._receive_data(auth_scheme_raw); expect(client._rfb_auth_scheme).to.equal(auth_scheme); @@ -1037,7 +1032,7 @@ describe('Remote Frame Buffer Protocol Client', function() { it('should prefer no authentication is possible', function () { client._rfb_version = 3.7; - var auth_schemes = [2, 1, 3]; + const auth_schemes = [2, 1, 3]; client._sock._websocket._receive_data(auth_schemes); expect(client._rfb_auth_scheme).to.equal(1); expect(client._sock).to.have.sent(new Uint8Array([1, 1])); @@ -1045,7 +1040,7 @@ describe('Remote Frame Buffer Protocol Client', function() { it('should choose for the most prefered scheme possible for versions >= 3.7', function () { client._rfb_version = 3.7; - var auth_schemes = [2, 22, 16]; + const auth_schemes = [2, 22, 16]; client._sock._websocket._receive_data(auth_schemes); expect(client._rfb_auth_scheme).to.equal(22); expect(client._sock).to.have.sent(new Uint8Array([22])); @@ -1054,14 +1049,14 @@ describe('Remote Frame Buffer Protocol Client', function() { it('should fail if there are no supported schemes for versions >= 3.7', function () { sinon.spy(client, "_fail"); client._rfb_version = 3.7; - var auth_schemes = [1, 32]; + const auth_schemes = [1, 32]; client._sock._websocket._receive_data(auth_schemes); expect(client._fail).to.have.been.calledOnce; }); it('should fail with the appropriate message if no types are sent for versions >= 3.7', function () { client._rfb_version = 3.7; - var failure_data = [0, 0, 0, 0, 6, 119, 104, 111, 111, 112, 115]; + const failure_data = [0, 0, 0, 0, 6, 119, 104, 111, 111, 112, 115]; sinon.spy(client, '_fail'); client._sock._websocket._receive_data(failure_data); @@ -1072,7 +1067,7 @@ describe('Remote Frame Buffer Protocol Client', function() { it('should transition to the Authentication state and continue on successful negotiation', function () { client._rfb_version = 3.7; - var auth_schemes = [1, 1]; + const auth_schemes = [1, 1]; client._negotiate_authentication = sinon.spy(); client._sock._websocket._receive_data(auth_schemes); expect(client._rfb_init_state).to.equal('Authentication'); @@ -1091,11 +1086,11 @@ describe('Remote Frame Buffer Protocol Client', function() { it('should fail on auth scheme 0 (pre 3.7) with the given message', function () { client._rfb_version = 3.6; - var err_msg = "Whoopsies"; - var data = [0, 0, 0, 0]; - var err_len = err_msg.length; + const err_msg = "Whoopsies"; + const data = [0, 0, 0, 0]; + const err_len = err_msg.length; push32(data, err_len); - for (var i = 0; i < err_len; i++) { + for (let i = 0; i < err_len; i++) { data.push(err_msg.charCodeAt(i)); } @@ -1131,12 +1126,12 @@ describe('Remote Frame Buffer Protocol Client', function() { }); it('should fire the credentialsrequired event if missing a password', function () { - var spy = sinon.spy(); + const spy = sinon.spy(); client.addEventListener("credentialsrequired", spy); send_security(2, client); - var challenge = []; - for (var i = 0; i < 16; i++) { challenge[i] = i; } + const challenge = []; + for (let i = 0; i < 16; i++) { challenge[i] = i; } client._sock._websocket._receive_data(new Uint8Array(challenge)); expect(client._rfb_credentials).to.be.empty; @@ -1149,11 +1144,11 @@ describe('Remote Frame Buffer Protocol Client', function() { send_security(2, client); client._sock._websocket._get_sent_data(); // skip the choice of auth reply - var challenge = []; - for (var i = 0; i < 16; i++) { challenge[i] = i; } + const challenge = []; + for (let i = 0; i < 16; i++) { challenge[i] = i; } client._sock._websocket._receive_data(new Uint8Array(challenge)); - var des_pass = RFB.genDES('passwd', challenge); + const des_pass = RFB.genDES('passwd', challenge); expect(client._sock).to.have.sent(new Uint8Array(des_pass)); }); @@ -1161,8 +1156,8 @@ describe('Remote Frame Buffer Protocol Client', function() { client._rfb_credentials = { password: 'passwd' }; send_security(2, client); - var challenge = []; - for (var i = 0; i < 16; i++) { challenge[i] = i; } + const challenge = []; + for (let i = 0; i < 16; i++) { challenge[i] = i; } client._sock._websocket._receive_data(new Uint8Array(challenge)); expect(client._rfb_init_state).to.equal('SecurityResult'); @@ -1185,7 +1180,7 @@ describe('Remote Frame Buffer Protocol Client', function() { }); it('should fire the credentialsrequired event if all credentials are missing', function() { - var spy = sinon.spy(); + const spy = sinon.spy(); client.addEventListener("credentialsrequired", spy); client._rfb_credentials = {}; send_security(22, client); @@ -1196,7 +1191,7 @@ describe('Remote Frame Buffer Protocol Client', function() { }); it('should fire the credentialsrequired event if some credentials are missing', function() { - var spy = sinon.spy(); + const spy = sinon.spy(); client.addEventListener("credentialsrequired", spy); client._rfb_credentials = { username: 'user', target: 'target' }; @@ -1214,8 +1209,8 @@ describe('Remote Frame Buffer Protocol Client', function() { send_security(22, client); - var expected = [22, 4, 6]; // auth selection, len user, len target - for (var i = 0; i < 10; i++) { expected[i+3] = 'usertarget'.charCodeAt(i); } + const expected = [22, 4, 6]; // auth selection, len user, len target + for (let i = 0; i < 10; i++) { expected[i+3] = 'usertarget'.charCodeAt(i); } expect(client._sock).to.have.sent(new Uint8Array(expected)); }); @@ -1230,17 +1225,16 @@ describe('Remote Frame Buffer Protocol Client', function() { }); function send_num_str_pairs(pairs, client) { - var pairs_len = pairs.length; - var data = []; + const pairs_len = pairs.length; + const data = []; push32(data, pairs_len); - for (var i = 0; i < pairs_len; i++) { + for (let i = 0; i < pairs_len; i++) { push32(data, pairs[i][0]); - var j; - for (j = 0; j < 4; j++) { + for (let j = 0; j < 4; j++) { data.push(pairs[i][1].charCodeAt(j)); } - for (j = 0; j < 8; j++) { + for (let j = 0; j < 8; j++) { data.push(pairs[i][2].charCodeAt(j)); } } @@ -1319,7 +1313,7 @@ describe('Remote Frame Buffer Protocol Client', function() { it('should fail on an error code of 1 with the given message for versions >= 3.8', function () { client._rfb_version = 3.8; sinon.spy(client, '_fail'); - var failure_data = [0, 0, 0, 1, 0, 0, 0, 6, 119, 104, 111, 111, 112, 115]; + const failure_data = [0, 0, 0, 1, 0, 0, 0, 6, 119, 104, 111, 111, 112, 115]; client._sock._websocket._receive_data(new Uint8Array(failure_data)); expect(client._fail).to.have.been.calledWith( 'Security negotiation failed on security result (reason: whoops)'); @@ -1334,7 +1328,7 @@ describe('Remote Frame Buffer Protocol Client', function() { }); it('should result in securityfailure event when receiving a non zero status', function () { - var spy = sinon.spy(); + const spy = sinon.spy(); client.addEventListener("securityfailure", spy); client._sock._websocket._receive_data(new Uint8Array([0, 0, 0, 2])); expect(spy).to.have.been.calledOnce; @@ -1343,9 +1337,9 @@ describe('Remote Frame Buffer Protocol Client', function() { it('should include reason when provided in securityfailure event', function () { client._rfb_version = 3.8; - var spy = sinon.spy(); + const spy = sinon.spy(); client.addEventListener("securityfailure", spy); - var failure_data = [0, 0, 0, 1, 0, 0, 0, 12, 115, 117, 99, 104, + const failure_data = [0, 0, 0, 1, 0, 0, 0, 12, 115, 117, 99, 104, 32, 102, 97, 105, 108, 117, 114, 101]; client._sock._websocket._receive_data(new Uint8Array(failure_data)); expect(spy.args[0][0].detail.status).to.equal(1); @@ -1354,9 +1348,9 @@ describe('Remote Frame Buffer Protocol Client', function() { it('should not include reason when length is zero in securityfailure event', function () { client._rfb_version = 3.9; - var spy = sinon.spy(); + const spy = sinon.spy(); client.addEventListener("securityfailure", spy); - var failure_data = [0, 0, 0, 1, 0, 0, 0, 0]; + const failure_data = [0, 0, 0, 1, 0, 0, 0, 0]; client._sock._websocket._receive_data(new Uint8Array(failure_data)); expect(spy.args[0][0].detail.status).to.equal(1); expect('reason' in spy.args[0][0].detail).to.be.false; @@ -1364,7 +1358,7 @@ describe('Remote Frame Buffer Protocol Client', function() { it('should not include reason in securityfailure event for version < 3.8', function () { client._rfb_version = 3.6; - var spy = sinon.spy(); + const spy = sinon.spy(); client.addEventListener("securityfailure", spy); client._sock._websocket._receive_data(new Uint8Array([0, 0, 0, 2])); expect(spy.args[0][0].detail.status).to.equal(2); @@ -1374,7 +1368,7 @@ describe('Remote Frame Buffer Protocol Client', function() { describe('ClientInitialisation', function () { it('should transition to the ServerInitialisation state', function () { - var client = make_rfb(); + const client = make_rfb(); client._rfb_connection_state = 'connecting'; client._rfb_init_state = 'SecurityResult'; client._sock._websocket._receive_data(new Uint8Array([0, 0, 0, 0])); @@ -1382,7 +1376,7 @@ describe('Remote Frame Buffer Protocol Client', function() { }); it('should send 1 if we are in shared mode', function () { - var client = make_rfb('wss://host:8675', { shared: true }); + const client = make_rfb('wss://host:8675', { shared: true }); client._rfb_connection_state = 'connecting'; client._rfb_init_state = 'SecurityResult'; client._sock._websocket._receive_data(new Uint8Array([0, 0, 0, 0])); @@ -1390,7 +1384,7 @@ describe('Remote Frame Buffer Protocol Client', function() { }); it('should send 0 if we are not in shared mode', function () { - var client = make_rfb('wss://host:8675', { shared: false }); + const client = make_rfb('wss://host:8675', { shared: false }); client._rfb_connection_state = 'connecting'; client._rfb_init_state = 'SecurityResult'; client._sock._websocket._receive_data(new Uint8Array([0, 0, 0, 0])); @@ -1404,13 +1398,13 @@ describe('Remote Frame Buffer Protocol Client', function() { }); function send_server_init(opts, client) { - var full_opts = { width: 10, height: 12, bpp: 24, depth: 24, big_endian: 0, + const full_opts = { width: 10, height: 12, bpp: 24, depth: 24, big_endian: 0, true_color: 1, red_max: 255, green_max: 255, blue_max: 255, red_shift: 16, green_shift: 8, blue_shift: 0, name: 'a name' }; - for (var opt in opts) { + for (let opt in opts) { full_opts[opt] = opts[opt]; } - var data = []; + const data = []; push16(data, full_opts.width); push16(data, full_opts.height); @@ -1434,9 +1428,9 @@ describe('Remote Frame Buffer Protocol Client', function() { client._sock._websocket._receive_data(new Uint8Array(data)); - var name_data = []; + const name_data = []; push32(name_data, full_opts.name.length); - for (var i = 0; i < full_opts.name.length; i++) { + for (let i = 0; i < full_opts.name.length; i++) { name_data.push(full_opts.name.charCodeAt(i)); } client._sock._websocket._receive_data(new Uint8Array(name_data)); @@ -1451,7 +1445,7 @@ describe('Remote Frame Buffer Protocol Client', function() { // NB(sross): we just warn, not fail, for endian-ness and shifts, so we don't test them it('should set the framebuffer name and call the callback', function () { - var spy = sinon.spy(); + const spy = sinon.spy(); client.addEventListener("desktopname", spy); send_server_init({ name: 'some name' }, client); @@ -1466,12 +1460,12 @@ describe('Remote Frame Buffer Protocol Client', function() { client._rfb_tightvnc = true; send_server_init({}, client); - var tight_data = []; + const tight_data = []; push16(tight_data, 1); push16(tight_data, 2); push16(tight_data, 3); push16(tight_data, 0); - for (var i = 0; i < 16 + 32 + 48; i++) { + for (let i = 0; i < 16 + 32 + 48; i++) { tight_data.push(i); } client._sock._websocket._receive_data(tight_data); @@ -1508,7 +1502,7 @@ describe('Remote Frame Buffer Protocol Client', function() { RFB.messages.fbUpdateRequest.restore(); }); - // TODO(directxman12): test the various options in this configuration matrix + // TODO(directxman12): test the constious options in this configuration matrix it('should reply with the pixel format, client encodings, and initial update request', function () { send_server_init({ width: 27, height: 32 }, client); @@ -1545,7 +1539,7 @@ describe('Remote Frame Buffer Protocol Client', function() { }); describe('Protocol Message Processing After Completing Initialization', function () { - var client; + let client; beforeEach(function () { client = make_rfb(); @@ -1555,21 +1549,21 @@ describe('Remote Frame Buffer Protocol Client', function() { }); describe('Framebuffer Update Handling', function () { - var target_data_arr = [ + const target_data_arr = [ 0xff, 0x00, 0x00, 255, 0x00, 0xff, 0x00, 255, 0x00, 0x00, 0xff, 255, 0x00, 0x00, 0xff, 255, 0x00, 0xff, 0x00, 255, 0xff, 0x00, 0x00, 255, 0x00, 0x00, 0xff, 255, 0x00, 0x00, 0xff, 255, 0xee, 0x00, 0xff, 255, 0x00, 0xee, 0xff, 255, 0xaa, 0xee, 0xff, 255, 0xab, 0xee, 0xff, 255, 0xee, 0x00, 0xff, 255, 0x00, 0xee, 0xff, 255, 0xaa, 0xee, 0xff, 255, 0xab, 0xee, 0xff, 255 ]; - var target_data; + let target_data; - var target_data_check_arr = [ + const target_data_check_arr = [ 0x00, 0x00, 0xff, 255, 0x00, 0x00, 0xff, 255, 0x00, 0xff, 0x00, 255, 0x00, 0xff, 0x00, 255, 0x00, 0x00, 0xff, 255, 0x00, 0x00, 0xff, 255, 0x00, 0xff, 0x00, 255, 0x00, 0xff, 0x00, 255, 0x00, 0xff, 0x00, 255, 0x00, 0xff, 0x00, 255, 0x00, 0x00, 0xff, 255, 0x00, 0x00, 0xff, 255, 0x00, 0xff, 0x00, 255, 0x00, 0xff, 0x00, 255, 0x00, 0x00, 0xff, 255, 0x00, 0x00, 0xff, 255 ]; - var target_data_check; + let target_data_check; before(function () { // NB(directxman12): PhantomJS 1.x doesn't implement Uint8ClampedArray @@ -1578,7 +1572,7 @@ describe('Remote Frame Buffer Protocol Client', function() { }); function send_fbu_msg (rect_info, rect_data, client, rect_cnt) { - var data = []; + let data = []; if (!rect_cnt || rect_cnt > -1) { // header @@ -1587,7 +1581,7 @@ describe('Remote Frame Buffer Protocol Client', function() { push16(data, rect_cnt || rect_data.length); } - for (var i = 0; i < rect_data.length; i++) { + for (let i = 0; i < rect_data.length; i++) { if (rect_info[i]) { push16(data, rect_info[i].x); push16(data, rect_info[i].y); @@ -1602,10 +1596,10 @@ describe('Remote Frame Buffer Protocol Client', function() { } it('should send an update request if there is sufficient data', function () { - var expected_msg = {_sQ: new Uint8Array(10), _sQlen: 0, flush: function() {}}; + const expected_msg = {_sQ: new Uint8Array(10), _sQlen: 0, flush: function() {}}; RFB.messages.fbUpdateRequest(expected_msg, true, 0, 0, 640, 20); - client._framebufferUpdate = function () { return true; }; + client._framebufferUpdate = () => true; client._sock._websocket._receive_data(new Uint8Array([0])); expect(client._sock).to.have.sent(expected_msg._sQ); @@ -1617,14 +1611,17 @@ describe('Remote Frame Buffer Protocol Client', function() { }); it('should resume receiving an update if we previously did not have enough data', function () { - var expected_msg = {_sQ: new Uint8Array(10), _sQlen: 0, flush: function() {}}; + const expected_msg = {_sQ: new Uint8Array(10), _sQlen: 0, flush: function() {}}; RFB.messages.fbUpdateRequest(expected_msg, true, 0, 0, 640, 20); // just enough to set FBU.rects client._sock._websocket._receive_data(new Uint8Array([0, 0, 0, 3])); expect(client._sock._websocket._get_sent_data()).to.have.length(0); - client._framebufferUpdate = function () { this._sock.rQskip8(); return true; }; // we magically have enough data + client._framebufferUpdate = function () { + this._sock.rQskip8(); + return true; + }; // we magically have enough data // 247 should *not* be used as the message type here client._sock._websocket._receive_data(new Uint8Array([247])); expect(client._sock).to.have.sent(expected_msg._sQ); @@ -1632,7 +1629,7 @@ describe('Remote Frame Buffer Protocol Client', function() { it('should not send a request in continuous updates mode', function () { client._enabledContinuousUpdates = true; - client._framebufferUpdate = function () { return true; }; + client._framebufferUpdate = () => true; client._sock._websocket._receive_data(new Uint8Array([0])); expect(client._sock._websocket._get_sent_data()).to.have.length(0); @@ -1640,7 +1637,7 @@ describe('Remote Frame Buffer Protocol Client', function() { it('should fail on an unsupported encoding', function () { sinon.spy(client, "_fail"); - var rect_info = { x: 8, y: 11, width: 27, height: 32, encoding: 234 }; + const rect_info = { x: 8, y: 11, width: 27, height: 32, encoding: 234 }; send_fbu_msg([rect_info], [[]], client); expect(client._fail).to.have.been.calledOnce; }); @@ -1652,10 +1649,10 @@ describe('Remote Frame Buffer Protocol Client', function() { client._display.resize(4, 4); client._display.blitRgbxImage(0, 0, 4, 2, new Uint8Array(target_data_check_arr.slice(0, 32)), 0); - var info = [{ x: 0, y: 2, width: 2, height: 2, encoding: 0x01}, + const info = [{ x: 0, y: 2, width: 2, height: 2, encoding: 0x01}, { x: 2, y: 2, width: 2, height: 2, encoding: 0x01}]; // data says [{ old_x: 2, old_y: 0 }, { old_x: 0, old_y: 0 }] - var rects = [[0, 2, 0, 0], [0, 0, 0, 0]]; + const rects = [[0, 2, 0, 0], [0, 0, 0, 0]]; send_fbu_msg([info[0]], [rects[0]], client, 2); send_fbu_msg([info[1]], [rects[1]], client, -1); expect(client._display).to.have.displayed(target_data_check); @@ -1671,12 +1668,12 @@ describe('Remote Frame Buffer Protocol Client', function() { }); it('should handle the RAW encoding', function () { - var info = [{ x: 0, y: 0, width: 2, height: 2, encoding: 0x00 }, + const info = [{ x: 0, y: 0, width: 2, height: 2, encoding: 0x00 }, { x: 2, y: 0, width: 2, height: 2, encoding: 0x00 }, { x: 0, y: 2, width: 4, height: 1, encoding: 0x00 }, { x: 0, y: 3, width: 4, height: 1, encoding: 0x00 }]; // data is in bgrx - var rects = [ + const rects = [ [0x00, 0x00, 0xff, 0, 0x00, 0xff, 0x00, 0, 0x00, 0xff, 0x00, 0, 0x00, 0x00, 0xff, 0], [0xff, 0x00, 0x00, 0, 0xff, 0x00, 0x00, 0, 0xff, 0x00, 0x00, 0, 0xff, 0x00, 0x00, 0], [0xff, 0x00, 0xee, 0, 0xff, 0xee, 0x00, 0, 0xff, 0xee, 0xaa, 0, 0xff, 0xee, 0xab, 0], @@ -1686,11 +1683,11 @@ describe('Remote Frame Buffer Protocol Client', function() { }); it('should handle the RAW encoding in low colour mode', function () { - var info = [{ x: 0, y: 0, width: 2, height: 2, encoding: 0x00 }, + const info = [{ x: 0, y: 0, width: 2, height: 2, encoding: 0x00 }, { x: 2, y: 0, width: 2, height: 2, encoding: 0x00 }, { x: 0, y: 2, width: 4, height: 1, encoding: 0x00 }, { x: 0, y: 3, width: 4, height: 1, encoding: 0x00 }]; - var rects = [ + const rects = [ [0x03, 0x03, 0x03, 0x03], [0x0c, 0x0c, 0x0c, 0x0c], [0x0c, 0x0c, 0x03, 0x03], @@ -1704,10 +1701,10 @@ describe('Remote Frame Buffer Protocol Client', function() { // seed some initial data to copy client._display.blitRgbxImage(0, 0, 4, 2, new Uint8Array(target_data_check_arr.slice(0, 32)), 0); - var info = [{ x: 0, y: 2, width: 2, height: 2, encoding: 0x01}, + const info = [{ x: 0, y: 2, width: 2, height: 2, encoding: 0x01}, { x: 2, y: 2, width: 2, height: 2, encoding: 0x01}]; // data says [{ old_x: 0, old_y: 0 }, { old_x: 0, old_y: 0 }] - var rects = [[0, 2, 0, 0], [0, 0, 0, 0]]; + const rects = [[0, 2, 0, 0], [0, 0, 0, 0]]; send_fbu_msg(info, rects, client); expect(client._display).to.have.displayed(target_data_check); }); @@ -1716,8 +1713,8 @@ describe('Remote Frame Buffer Protocol Client', function() { // TODO(directxman12): test rre_chunk_sz (related to above about subrects)? it('should handle the RRE encoding', function () { - var info = [{ x: 0, y: 0, width: 4, height: 4, encoding: 0x02 }]; - var rect = []; + const info = [{ x: 0, y: 0, width: 4, height: 4, encoding: 0x02 }]; + const rect = []; push32(rect, 2); // 2 subrects push32(rect, 0xff00ff); // becomes 00ff00ff --> #00FF00 bg color rect.push(0xff); // becomes ff0000ff --> #0000FF color @@ -1743,8 +1740,8 @@ describe('Remote Frame Buffer Protocol Client', function() { describe('the HEXTILE encoding handler', function () { it('should handle a tile with fg, bg specified, normal subrects', function () { - var info = [{ x: 0, y: 0, width: 4, height: 4, encoding: 0x05 }]; - var rect = []; + const info = [{ x: 0, y: 0, width: 4, height: 4, encoding: 0x05 }]; + const rect = []; rect.push(0x02 | 0x04 | 0x08); // bg spec, fg spec, anysubrects push32(rect, 0xff00ff); // becomes 00ff00ff --> #00FF00 bg color rect.push(0xff); // becomes ff0000ff --> #0000FF fg color @@ -1761,10 +1758,10 @@ describe('Remote Frame Buffer Protocol Client', function() { }); it('should handle a raw tile', function () { - var info = [{ x: 0, y: 0, width: 4, height: 4, encoding: 0x05 }]; - var rect = []; + const info = [{ x: 0, y: 0, width: 4, height: 4, encoding: 0x05 }]; + const rect = []; rect.push(0x01); // raw - for (var i = 0; i < target_data.length; i += 4) { + for (let i = 0; i < target_data.length; i += 4) { rect.push(target_data[i + 2]); rect.push(target_data[i + 1]); rect.push(target_data[i]); @@ -1775,14 +1772,14 @@ describe('Remote Frame Buffer Protocol Client', function() { }); it('should handle a tile with only bg specified (solid bg)', function () { - var info = [{ x: 0, y: 0, width: 4, height: 4, encoding: 0x05 }]; - var rect = []; + const info = [{ x: 0, y: 0, width: 4, height: 4, encoding: 0x05 }]; + const rect = []; rect.push(0x02); push32(rect, 0xff00ff); // becomes 00ff00ff --> #00FF00 bg color send_fbu_msg(info, [rect], client); - var expected = []; - for (var i = 0; i < 16; i++) { push32(expected, 0xff00ff); } + const expected = []; + for (let i = 0; i < 16; i++) { push32(expected, 0xff00ff); } expect(client._display).to.have.displayed(new Uint8Array(expected)); }); @@ -1791,9 +1788,9 @@ describe('Remote Frame Buffer Protocol Client', function() { client._fb_width = 8; client._display.resize(8, 4); - var info = [{ x: 0, y: 0, width: 32, height: 4, encoding: 0x05 }]; + const info = [{ x: 0, y: 0, width: 32, height: 4, encoding: 0x05 }]; - var rect = []; + const rect = []; // send a bg frame rect.push(0x02); @@ -1804,16 +1801,15 @@ describe('Remote Frame Buffer Protocol Client', function() { send_fbu_msg(info, [rect], client); - var expected = []; - var i; - for (i = 0; i < 16; i++) { push32(expected, 0xff00ff); } // rect 1: solid - for (i = 0; i < 16; i++) { push32(expected, 0xff00ff); } // rect 2: same bkground color + const expected = []; + for (let i = 0; i < 16; i++) { push32(expected, 0xff00ff); } // rect 1: solid + for (let i = 0; i < 16; i++) { push32(expected, 0xff00ff); } // rect 2: same bkground color expect(client._display).to.have.displayed(new Uint8Array(expected)); }); it('should handle a tile with bg and coloured subrects', function () { - var info = [{ x: 0, y: 0, width: 4, height: 4, encoding: 0x05 }]; - var rect = []; + const info = [{ x: 0, y: 0, width: 4, height: 4, encoding: 0x05 }]; + const rect = []; rect.push(0x02 | 0x08 | 0x10); // bg spec, anysubrects, colouredsubrects push32(rect, 0xff00ff); // becomes 00ff00ff --> #00FF00 bg color rect.push(2); // 2 subrects @@ -1838,8 +1834,8 @@ describe('Remote Frame Buffer Protocol Client', function() { client._fb_height = 17; client._display.resize(4, 17); - var info = [{ x: 0, y: 0, width: 4, height: 17, encoding: 0x05}]; - var rect = []; + const info = [{ x: 0, y: 0, width: 4, height: 17, encoding: 0x05}]; + const rect = []; rect.push(0x02 | 0x04 | 0x08); // bg spec, fg spec, anysubrects push32(rect, 0xff00ff); // becomes 00ff00ff --> #00FF00 bg color rect.push(0xff); // becomes ff0000ff --> #0000FF fg color @@ -1847,8 +1843,7 @@ describe('Remote Frame Buffer Protocol Client', function() { rect.push(0x00); rect.push(0xff); rect.push(8); // 8 subrects - var i; - for (i = 0; i < 4; i++) { + for (let i = 0; i < 4; i++) { rect.push((0 << 4) | (i * 4)); // x: 0, y: i*4 rect.push(1 | (1 << 4)); // width: 2, height: 2 rect.push((2 << 4) | (i * 4 + 2)); // x: 2, y: i * 4 + 2 @@ -1860,16 +1855,16 @@ describe('Remote Frame Buffer Protocol Client', function() { rect.push(1 | (1 << 4)); // width: 2, height: 2 send_fbu_msg(info, [rect], client); - var expected = []; - for (i = 0; i < 4; i++) { expected = expected.concat(target_data_check_arr); } + let expected = []; + for (let i = 0; i < 4; i++) { expected = expected.concat(target_data_check_arr); } expected = expected.concat(target_data_check_arr.slice(0, 16)); expect(client._display).to.have.displayed(new Uint8Array(expected)); }); it('should fail on an invalid subencoding', function () { sinon.spy(client,"_fail"); - var info = [{ x: 0, y: 0, width: 4, height: 4, encoding: 0x05 }]; - var rects = [[45]]; // an invalid subencoding + const info = [{ x: 0, y: 0, width: 4, height: 4, encoding: 0x05 }]; + const rects = [[45]]; // an invalid subencoding send_fbu_msg(info, rects, client); expect(client._fail).to.have.been.calledOnce; }); @@ -1884,7 +1879,6 @@ describe('Remote Frame Buffer Protocol Client', function() { }); it('should handle the DesktopSize pseduo-encoding', function () { - var spy = sinon.spy(); sinon.spy(client._display, 'resize'); send_fbu_msg([{ x: 0, y: 0, width: 20, height: 50, encoding: -223 }], [[]], client); @@ -1896,23 +1890,20 @@ describe('Remote Frame Buffer Protocol Client', function() { }); describe('the ExtendedDesktopSize pseudo-encoding handler', function () { - var resizeSpy; - beforeEach(function () { // a really small frame client._fb_width = 4; client._fb_height = 4; client._display.resize(4, 4); sinon.spy(client._display, 'resize'); - resizeSpy = sinon.spy(); }); function make_screen_data (nr_of_screens) { - var data = []; + const data = []; push8(data, nr_of_screens); // number-of-screens push8(data, 0); // padding push16(data, 0); // padding - for (var i=0; i {}; client.disconnect(); expect(client._rfb_connection_state).to.equal('disconnecting'); client._sock._websocket.close = real; diff --git a/tests/test.util.js b/tests/test.util.js index 1eab1e99..c73e4ff1 100644 --- a/tests/test.util.js +++ b/tests/test.util.js @@ -1,7 +1,5 @@ -/* jshint expr: true */ - -var assert = chai.assert; -var expect = chai.expect; +/* eslint-disable no-console */ +const expect = chai.expect; import * as Log from '../core/util/logging.js'; @@ -70,3 +68,4 @@ describe('Utils', function() { // (we can't really test them against the browsers, except for Gecko // via PhantomJS, the default test driver) }); +/* eslint-enable no-console */ diff --git a/tests/test.websock.js b/tests/test.websock.js index 211ab601..a36d3ad9 100644 --- a/tests/test.websock.js +++ b/tests/test.websock.js @@ -1,6 +1,4 @@ -/* jshint expr: true */ -var assert = chai.assert; -var expect = chai.expect; +const expect = chai.expect; import Websock from '../core/websock.js'; import FakeWebSocket from './fake.websocket.js'; @@ -11,8 +9,8 @@ describe('Websock', function() { "use strict"; describe('Queue methods', function () { - var sock; - var RQ_TEMPLATE = new Uint8Array([0, 1, 2, 3, 4, 5, 6, 7]); + let sock; + const RQ_TEMPLATE = new Uint8Array([0, 1, 2, 3, 4, 5, 6, 7]); beforeEach(function () { sock = new Websock(); @@ -37,8 +35,8 @@ describe('Websock', function() { describe('rQpeek8', function () { it('should peek at the next byte without poping it off the queue', function () { - var bef_len = sock.rQlen(); - var peek = sock.rQpeek8(); + const bef_len = sock.rQlen(); + const peek = sock.rQpeek8(); expect(sock.rQpeek8()).to.equal(peek); expect(sock.rQlen()).to.equal(bef_len); }); @@ -46,8 +44,8 @@ describe('Websock', function() { describe('rQshift8', function () { it('should pop a single byte from the receive queue', function () { - var peek = sock.rQpeek8(); - var bef_len = sock.rQlen(); + const peek = sock.rQpeek8(); + const bef_len = sock.rQlen(); expect(sock.rQshift8()).to.equal(peek); expect(sock.rQlen()).to.equal(bef_len - 1); }); @@ -55,8 +53,8 @@ describe('Websock', function() { describe('rQshift16', function () { it('should pop two bytes from the receive queue and return a single number', function () { - var bef_len = sock.rQlen(); - var expected = (RQ_TEMPLATE[0] << 8) + RQ_TEMPLATE[1]; + const bef_len = sock.rQlen(); + const expected = (RQ_TEMPLATE[0] << 8) + RQ_TEMPLATE[1]; expect(sock.rQshift16()).to.equal(expected); expect(sock.rQlen()).to.equal(bef_len - 2); }); @@ -64,8 +62,8 @@ describe('Websock', function() { describe('rQshift32', function () { it('should pop four bytes from the receive queue and return a single number', function () { - var bef_len = sock.rQlen(); - var expected = (RQ_TEMPLATE[0] << 24) + + const bef_len = sock.rQlen(); + const expected = (RQ_TEMPLATE[0] << 24) + (RQ_TEMPLATE[1] << 16) + (RQ_TEMPLATE[2] << 8) + RQ_TEMPLATE[3]; @@ -76,9 +74,9 @@ describe('Websock', function() { describe('rQshiftStr', function () { it('should shift the given number of bytes off of the receive queue and return a string', function () { - var bef_len = sock.rQlen(); - var bef_rQi = sock.get_rQi(); - var shifted = sock.rQshiftStr(3); + const bef_len = sock.rQlen(); + const bef_rQi = sock.get_rQi(); + const shifted = sock.rQshiftStr(3); expect(shifted).to.be.a('string'); expect(shifted).to.equal(String.fromCharCode.apply(null, Array.prototype.slice.call(new Uint8Array(RQ_TEMPLATE.buffer, bef_rQi, 3)))); expect(sock.rQlen()).to.equal(bef_len - 3); @@ -92,9 +90,9 @@ describe('Websock', function() { describe('rQshiftBytes', function () { it('should shift the given number of bytes of the receive queue and return an array', function () { - var bef_len = sock.rQlen(); - var bef_rQi = sock.get_rQi(); - var shifted = sock.rQshiftBytes(3); + const bef_len = sock.rQlen(); + const bef_rQi = sock.get_rQi(); + const shifted = sock.rQshiftBytes(3); expect(shifted).to.be.an.instanceof(Uint8Array); expect(shifted).to.array.equal(new Uint8Array(RQ_TEMPLATE.buffer, bef_rQi, 3)); expect(sock.rQlen()).to.equal(bef_len - 3); @@ -112,19 +110,19 @@ describe('Websock', function() { }); it('should not modify the receive queue', function () { - var bef_len = sock.rQlen(); + const bef_len = sock.rQlen(); sock.rQslice(0, 2); expect(sock.rQlen()).to.equal(bef_len); }); it('should return an array containing the given slice of the receive queue', function () { - var sl = sock.rQslice(0, 2); + const sl = sock.rQslice(0, 2); expect(sl).to.be.an.instanceof(Uint8Array); expect(sl).to.array.equal(new Uint8Array(RQ_TEMPLATE.buffer, 0, 2)); }); it('should use the rest of the receive queue if no end is given', function () { - var sl = sock.rQslice(1); + const sl = sock.rQslice(1); expect(sl).to.have.length(RQ_TEMPLATE.length - 1); expect(sl).to.array.equal(new Uint8Array(RQ_TEMPLATE.buffer, 1)); }); @@ -178,7 +176,7 @@ describe('Websock', function() { sock._websocket.readyState = WebSocket.OPEN sock._sQ = new Uint8Array([1, 2, 3]); sock._sQlen = 3; - var encoded = sock._encode_message(); + const encoded = sock._encode_message(); sock.flush(); expect(sock._websocket.send).to.have.been.calledOnce; @@ -202,7 +200,7 @@ describe('Websock', function() { it('should add to the send queue', function () { sock.send([1, 2, 3]); - var sq = sock.get_sQ(); + const sq = sock.get_sQ(); expect(new Uint8Array(sq.buffer, sock._sQlen - 3, 3)).to.array.equal(new Uint8Array([1, 2, 3])); }); @@ -225,14 +223,15 @@ describe('Websock', function() { }); describe('lifecycle methods', function () { - var old_WS; + let old_WS; before(function () { old_WS = WebSocket; }); - var sock; + let sock; beforeEach(function () { sock = new Websock(); + // eslint-disable-next-line no-global-assign WebSocket = sinon.spy(); WebSocket.OPEN = old_WS.OPEN; WebSocket.CONNECTING = old_WS.CONNECTING; @@ -328,19 +327,20 @@ describe('Websock', function() { }); after(function () { + // eslint-disable-next-line no-global-assign WebSocket = old_WS; }); }); describe('WebSocket Receiving', function () { - var sock; + let sock; beforeEach(function () { sock = new Websock(); sock._allocate_buffers(); }); it('should support adding binary Uint8Array data to the receive queue', function () { - var msg = { data: new Uint8Array([1, 2, 3]) }; + const msg = { data: new Uint8Array([1, 2, 3]) }; sock._mode = 'binary'; sock._recv_message(msg); expect(sock.rQshiftStr(3)).to.equal('\x01\x02\x03'); @@ -348,7 +348,7 @@ describe('Websock', function() { it('should call the message event handler if present', function () { sock._eventHandlers.message = sinon.spy(); - var msg = { data: new Uint8Array([1, 2, 3]).buffer }; + const msg = { data: new Uint8Array([1, 2, 3]).buffer }; sock._mode = 'binary'; sock._recv_message(msg); expect(sock._eventHandlers.message).to.have.been.calledOnce; @@ -356,7 +356,7 @@ describe('Websock', function() { it('should not call the message event handler if there is nothing in the receive queue', function () { sock._eventHandlers.message = sinon.spy(); - var msg = { data: new Uint8Array([]).buffer }; + const msg = { data: new Uint8Array([]).buffer }; sock._mode = 'binary'; sock._recv_message(msg); expect(sock._eventHandlers.message).not.to.have.been.called; @@ -369,7 +369,7 @@ describe('Websock', function() { sock._rQlen = 6; sock.set_rQi(6); sock._rQmax = 3; - var msg = { data: new Uint8Array([1, 2, 3]).buffer }; + const msg = { data: new Uint8Array([1, 2, 3]).buffer }; sock._mode = 'binary'; sock._recv_message(msg); expect(sock._rQlen).to.equal(3); @@ -382,12 +382,12 @@ describe('Websock', function() { sock.set_rQi(0); sock._rQbufferSize = 20; sock._rQmax = 2; - var msg = { data: new Uint8Array(30).buffer }; + const msg = { data: new Uint8Array(30).buffer }; sock._mode = 'binary'; sock._recv_message(msg); expect(sock._rQlen).to.equal(30); expect(sock.get_rQi()).to.equal(0); - expect(sock._rQ.length).to.equal(240); // keep the invariant that rQbufferSize / 8 >= rQlen + expect(sock._rQ.length).to.equal(240); // keep the inconstiant that rQbufferSize / 8 >= rQlen }); }); @@ -396,7 +396,7 @@ describe('Websock', function() { after(function () { FakeWebSocket.restore(); }); describe('as binary data', function () { - var sock; + let sock; beforeEach(function () { sock = new Websock(); sock.open('ws://', 'binary'); @@ -406,7 +406,7 @@ describe('Websock', function() { it('should only send the send queue up to the send queue length', function () { sock._sQ = new Uint8Array([1, 2, 3, 4, 5]); sock._sQlen = 3; - var res = sock._encode_message(); + const res = sock._encode_message(); expect(res).to.array.equal(new Uint8Array([1, 2, 3])); }); diff --git a/utils/.eslintrc b/utils/.eslintrc new file mode 100644 index 00000000..155f52c6 --- /dev/null +++ b/utils/.eslintrc @@ -0,0 +1,8 @@ +{ + "env": { + "node": true + }, + "rules": { + "no-console": 0 + } +} diff --git a/utils/genkeysymdef.js b/utils/genkeysymdef.js index 8486da39..ac9c4ef0 100755 --- a/utils/genkeysymdef.js +++ b/utils/genkeysymdef.js @@ -8,12 +8,12 @@ "use strict"; -var fs = require('fs'); +const fs = require('fs'); -var show_help = process.argv.length === 2; -var filename; +let show_help = process.argv.length === 2; +let filename; -for (var i = 2; i < process.argv.length; ++i) { +for (let i = 2; i < process.argv.length; ++i) { switch (process.argv[i]) { case "--help": case "-h": @@ -36,37 +36,37 @@ if (show_help) { console.log("Usage: node parse.js [options] filename:"); console.log(" -h [ --help ] Produce this help message"); console.log(" filename The keysymdef.h file to parse"); - return; + process.exit(0); } -var buf = fs.readFileSync(filename); -var str = buf.toString('utf8'); +const buf = fs.readFileSync(filename); +const str = buf.toString('utf8'); -var re = /^\#define XK_([a-zA-Z_0-9]+)\s+0x([0-9a-fA-F]+)\s*(\/\*\s*(.*)\s*\*\/)?\s*$/m; +const re = /^#define XK_([a-zA-Z_0-9]+)\s+0x([0-9a-fA-F]+)\s*(\/\*\s*(.*)\s*\*\/)?\s*$/m; -var arr = str.split('\n'); +const arr = str.split('\n'); -var codepoints = {}; +const codepoints = {}; -for (var i = 0; i < arr.length; ++i) { - var result = re.exec(arr[i]); +for (let i = 0; i < arr.length; ++i) { + const result = re.exec(arr[i]); if (result){ - var keyname = result[1]; - var keysym = parseInt(result[2], 16); - var remainder = result[3]; + const name = result[1]; + const keysym = parseInt(result[2], 16); + const remainder = result[3]; - var unicodeRes = /U\+([0-9a-fA-F]+)/.exec(remainder); + const unicodeRes = /U\+([0-9a-fA-F]+)/.exec(remainder); if (unicodeRes) { - var unicode = parseInt(unicodeRes[1], 16); + const unicode = parseInt(unicodeRes[1], 16); // The first entry is the preferred one if (!codepoints[unicode]){ - codepoints[unicode] = { keysym: keysym, name: keyname }; + codepoints[unicode] = { keysym, name }; } } } } -var out = +let out = "/*\n" + " * Mapping from Unicode codepoints to X11/RFB keysyms\n" + " *\n" + @@ -79,14 +79,14 @@ var out = "var codepoints = {\n"; function toHex(num) { - var s = num.toString(16); + let s = num.toString(16); if (s.length < 4) { s = ("0000" + s).slice(-4); } return "0x" + s; -}; +} -for (var codepoint in codepoints) { +for (let codepoint in codepoints) { codepoint = parseInt(codepoint); // Latin-1? diff --git a/utils/use_require.js b/utils/use_require.js index 050efa25..b184a5d1 100755 --- a/utils/use_require.js +++ b/utils/use_require.js @@ -1,9 +1,9 @@ #!/usr/bin/env node -var path = require('path'); -var program = require('commander'); -var fs = require('fs'); -var fse = require('fs-extra'); +const path = require('path'); +const program = require('commander'); +const fs = require('fs'); +const fse = require('fs-extra'); const SUPPORTED_FORMATS = new Set(['amd', 'commonjs', 'systemjs', 'umd']); @@ -40,7 +40,7 @@ no_copy_files.forEach((file) => no_transform_files.add(file)); // walkDir *recursively* walks directories trees, // calling the callback for all normal files found. -var walkDir = function (base_path, cb, filter) { +function walkDir(base_path, cb, filter) { fs.readdir(base_path, (err, files) => { if (err) throw err; @@ -56,26 +56,26 @@ var walkDir = function (base_path, cb, filter) { }); }); }); -}; +} -var transform_html = function (new_script) { +function transform_html(new_script) { // write out the modified vnc.html file that works with the bundle - var src_html_path = path.resolve(__dirname, '..', 'vnc.html'); - var out_html_path = path.resolve(paths.out_dir_base, 'vnc.html'); + const src_html_path = path.resolve(__dirname, '..', 'vnc.html'); + const out_html_path = path.resolve(paths.out_dir_base, 'vnc.html'); fs.readFile(src_html_path, (err, contents_raw) => { if (err) { throw err; } - var contents = contents_raw.toString(); + let contents = contents_raw.toString(); - var start_marker = '\n'; - var end_marker = ''; - var start_ind = contents.indexOf(start_marker) + start_marker.length; - var end_ind = contents.indexOf(end_marker, start_ind); + const start_marker = '\n'; + const end_marker = ''; + const start_ind = contents.indexOf(start_marker) + start_marker.length; + const end_ind = contents.indexOf(end_marker, start_ind); contents = contents.slice(0, start_ind) + `${new_script}\n` + contents.slice(end_ind); console.log(`Writing ${out_html_path}`); - fs.writeFile(out_html_path, contents, function (err) { + fs.writeFile(out_html_path, contents, (err) => { if (err) { throw err; } }); }); @@ -96,12 +96,13 @@ var make_lib_files = function (import_format, source_maps, with_app_dir) { }); const babel = require('babel-core'); - var in_path; + let in_path; + let out_path_base; if (with_app_dir) { - var out_path_base = paths.out_dir_base; + out_path_base = paths.out_dir_base; in_path = paths.main; } else { - var out_path_base = paths.lib_dir_base; + out_path_base = paths.lib_dir_base; } fse.ensureDirSync(out_path_base); @@ -109,7 +110,7 @@ var make_lib_files = function (import_format, source_maps, with_app_dir) { const helpers = require('./use_require_helpers'); const helper = helpers[import_format]; - var handleDir = (js_only, vendor_rewrite, in_path_base, filename) => { + const handleDir = (js_only, vendor_rewrite, in_path_base, filename) => { if (no_copy_files.has(filename)) return; const out_path = path.join(out_path_base, path.relative(in_path_base, filename)); @@ -143,7 +144,7 @@ var make_lib_files = function (import_format, source_maps, with_app_dir) { babel.transformFile(filename, opts, (err, res) => { console.log(`Writing ${out_path}`); if (err) throw err; - var {code, map, ast} = res; + let {code, map} = res; if (source_maps === true) { // append URL for external source map code += `\n//# sourceMappingURL=${path.basename(out_path)}.map\n`; @@ -161,11 +162,11 @@ var make_lib_files = function (import_format, source_maps, with_app_dir) { helper.noCopyOverride(paths, no_copy_files); } - walkDir(paths.vendor, handleDir.bind(null, true, false, in_path || paths.main), (filename, stats) => !no_copy_files.has(filename)); - walkDir(paths.core, handleDir.bind(null, true, !in_path, in_path || paths.core), (filename, stats) => !no_copy_files.has(filename)); + walkDir(paths.vendor, handleDir.bind(null, true, false, in_path || paths.main), filename => !no_copy_files.has(filename)); + walkDir(paths.core, handleDir.bind(null, true, !in_path, in_path || paths.core), filename => !no_copy_files.has(filename)); if (with_app_dir) { - walkDir(paths.app, handleDir.bind(null, false, false, in_path), (filename, stats) => !no_copy_files.has(filename)); + walkDir(paths.app, handleDir.bind(null, false, false, in_path), filename => !no_copy_files.has(filename)); const out_app_path = path.join(out_path_base, 'app.js'); if (helper && helper.appWriter) { diff --git a/utils/use_require_helpers.js b/utils/use_require_helpers.js index 990fb4df..b65e2225 100644 --- a/utils/use_require_helpers.js +++ b/utils/use_require_helpers.js @@ -1,7 +1,6 @@ // writes helpers require for vnc.html (they should output app.js) -var fs = require('fs'); -var fse = require('fs-extra'); -var path = require('path'); +const fs = require('fs'); +const path = require('path'); module.exports = { 'amd': { @@ -19,8 +18,8 @@ module.exports = { opts.plugins.unshift("add-module-exports"); }, appWriter: (base_out_path, out_path) => { - var browserify = require('browserify'); - var b = browserify(path.join(base_out_path, 'app/ui.js'), {}); + const browserify = require('browserify'); + const b = browserify(path.join(base_out_path, 'app/ui.js'), {}); b.bundle().pipe(fs.createWriteStream(out_path)); return ``; }, diff --git a/vendor/pako/lib/zlib/deflate.js b/vendor/pako/lib/zlib/deflate.js index 0588e043..c51915e2 100644 --- a/vendor/pako/lib/zlib/deflate.js +++ b/vendor/pako/lib/zlib/deflate.js @@ -280,7 +280,7 @@ function longest_match(s, cur_match) { * the 256th check will be made at strstart+258. */ do { - /*jshint noempty:false*/ + // Do nothing } while (_win[++scan] === _win[++match] && _win[++scan] === _win[++match] && _win[++scan] === _win[++match] && _win[++scan] === _win[++match] && _win[++scan] === _win[++match] && _win[++scan] === _win[++match] && @@ -892,7 +892,7 @@ function deflate_rle(s, flush) { if (prev === _win[++scan] && prev === _win[++scan] && prev === _win[++scan]) { strend = s.strstart + MAX_MATCH; do { - /*jshint noempty:false*/ + // Do nothing } while (prev === _win[++scan] && prev === _win[++scan] && prev === _win[++scan] && prev === _win[++scan] && prev === _win[++scan] && prev === _win[++scan] &&