From a70d865d74c024db282a4cb88f2518fde4a2cfc1 Mon Sep 17 00:00:00 2001 From: Bryan Ashby Date: Sun, 9 Dec 2018 02:33:48 -0700 Subject: [PATCH] Code tidy --- core/client.js | 10 +++++++--- core/file_base_download_manager.js | 1 - core/file_base_web_download_manager.js | 1 - core/misc_util.js | 3 +-- core/nua.js | 1 - 5 files changed, 8 insertions(+), 8 deletions(-) diff --git a/core/client.js b/core/client.js index 6f4aec79..60a04af7 100644 --- a/core/client.js +++ b/core/client.js @@ -54,6 +54,7 @@ exports.Client = Client; // Resources & Standards: // * http://www.ansi-bbs.org/ansi-bbs-core-server.html // +/* eslint-disable no-control-regex */ const RE_DSR_RESPONSE_ANYWHERE = /(?:\u001b\[)([0-9;]+)(R)/; const RE_DEV_ATTR_RESPONSE_ANYWHERE = /(?:\u001b\[)[=?]([0-9a-zA-Z;]+)(c)/; const RE_META_KEYCODE_ANYWHERE = /(?:\u001b)([a-zA-Z0-9])/; @@ -63,6 +64,7 @@ const RE_FUNCTION_KEYCODE_ANYWHERE = new RegExp('(?:\u001b+)(O|N|\\[|\\[\\[)(?: '(?:M([@ #!a`])(.)(.))', // mouse stuff '(?:1;)?(\\d+)?([a-zA-Z@])' ].join('|') + ')'); +/* eslint-enable no-control-regex */ const RE_FUNCTION_KEYCODE = new RegExp('^' + RE_FUNCTION_KEYCODE_ANYWHERE.source); const RE_ESC_CODE_ANYWHERE = new RegExp( [ @@ -70,7 +72,7 @@ const RE_ESC_CODE_ANYWHERE = new RegExp( [ RE_META_KEYCODE_ANYWHERE.source, RE_DSR_RESPONSE_ANYWHERE.source, RE_DEV_ATTR_RESPONSE_ANYWHERE.source, - /\u001b./.source + /\u001b./.source // eslint-disable-line no-control-regex ].join('|')); @@ -158,15 +160,17 @@ function Client(/*input, output*/) { return termClient; }; + /* eslint-disable no-control-regex */ this.isMouseInput = function(data) { - return /\x1b\[M/.test(data) || // eslint-disable-line no-control-regex - /\u001b\[M([\x00\u0020-\uffff]{3})/.test(data) || // eslint-disable-line no-control-regex + return /\x1b\[M/.test(data) || + /\u001b\[M([\x00\u0020-\uffff]{3})/.test(data) || /\u001b\[(\d+;\d+;\d+)M/.test(data) || /\u001b\[<(\d+;\d+;\d+)([mM])/.test(data) || /\u001b\[<(\d+;\d+;\d+;\d+)&w/.test(data) || /\u001b\[24([0135])~\[(\d+),(\d+)\]\r/.test(data) || /\u001b\[(O|I)/.test(data); }; + /* eslint-enable no-control-regex */ this.getKeyComponentsFromCode = function(code) { return { diff --git a/core/file_base_download_manager.js b/core/file_base_download_manager.js index 50abd6da..8487697f 100644 --- a/core/file_base_download_manager.js +++ b/core/file_base_download_manager.js @@ -8,7 +8,6 @@ const DownloadQueue = require('./download_queue.js'); const theme = require('./theme.js'); const ansi = require('./ansi_term.js'); const Errors = require('./enig_error.js').Errors; -const stringFormat = require('./string_format.js'); const FileAreaWeb = require('./file_area_web.js'); // deps diff --git a/core/file_base_web_download_manager.js b/core/file_base_web_download_manager.js index 62ee02eb..cf509cd9 100644 --- a/core/file_base_web_download_manager.js +++ b/core/file_base_web_download_manager.js @@ -8,7 +8,6 @@ const DownloadQueue = require('./download_queue.js'); const theme = require('./theme.js'); const ansi = require('./ansi_term.js'); const Errors = require('./enig_error.js').Errors; -const stringFormat = require('./string_format.js'); const FileAreaWeb = require('./file_area_web.js'); const ErrNotEnabled = require('./enig_error.js').ErrorReasons.NotEnabled; const Config = require('./config.js').get; diff --git a/core/misc_util.js b/core/misc_util.js index 62a3967d..78c76719 100644 --- a/core/misc_util.js +++ b/core/misc_util.js @@ -1,10 +1,9 @@ /* jslint node: true */ 'use strict'; +// deps const paths = require('path'); - const os = require('os'); -const moment = require('moment'); const packageJson = require('../package.json'); diff --git a/core/nua.js b/core/nua.js index 42c63895..2cb4c26b 100644 --- a/core/nua.js +++ b/core/nua.js @@ -15,7 +15,6 @@ const UserProps = require('./user_property.js'); // deps const _ = require('lodash'); -const moment = require('moment'); exports.moduleInfo = { name : 'NUA',