Code tidy
This commit is contained in:
parent
844286ea1c
commit
a70d865d74
|
@ -54,6 +54,7 @@ exports.Client = Client;
|
||||||
// Resources & Standards:
|
// Resources & Standards:
|
||||||
// * http://www.ansi-bbs.org/ansi-bbs-core-server.html
|
// * 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_DSR_RESPONSE_ANYWHERE = /(?:\u001b\[)([0-9;]+)(R)/;
|
||||||
const RE_DEV_ATTR_RESPONSE_ANYWHERE = /(?:\u001b\[)[=?]([0-9a-zA-Z;]+)(c)/;
|
const RE_DEV_ATTR_RESPONSE_ANYWHERE = /(?:\u001b\[)[=?]([0-9a-zA-Z;]+)(c)/;
|
||||||
const RE_META_KEYCODE_ANYWHERE = /(?:\u001b)([a-zA-Z0-9])/;
|
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
|
'(?:M([@ #!a`])(.)(.))', // mouse stuff
|
||||||
'(?:1;)?(\\d+)?([a-zA-Z@])'
|
'(?:1;)?(\\d+)?([a-zA-Z@])'
|
||||||
].join('|') + ')');
|
].join('|') + ')');
|
||||||
|
/* eslint-enable no-control-regex */
|
||||||
|
|
||||||
const RE_FUNCTION_KEYCODE = new RegExp('^' + RE_FUNCTION_KEYCODE_ANYWHERE.source);
|
const RE_FUNCTION_KEYCODE = new RegExp('^' + RE_FUNCTION_KEYCODE_ANYWHERE.source);
|
||||||
const RE_ESC_CODE_ANYWHERE = new RegExp( [
|
const RE_ESC_CODE_ANYWHERE = new RegExp( [
|
||||||
|
@ -70,7 +72,7 @@ const RE_ESC_CODE_ANYWHERE = new RegExp( [
|
||||||
RE_META_KEYCODE_ANYWHERE.source,
|
RE_META_KEYCODE_ANYWHERE.source,
|
||||||
RE_DSR_RESPONSE_ANYWHERE.source,
|
RE_DSR_RESPONSE_ANYWHERE.source,
|
||||||
RE_DEV_ATTR_RESPONSE_ANYWHERE.source,
|
RE_DEV_ATTR_RESPONSE_ANYWHERE.source,
|
||||||
/\u001b./.source
|
/\u001b./.source // eslint-disable-line no-control-regex
|
||||||
].join('|'));
|
].join('|'));
|
||||||
|
|
||||||
|
|
||||||
|
@ -158,15 +160,17 @@ function Client(/*input, output*/) {
|
||||||
return termClient;
|
return termClient;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
/* eslint-disable no-control-regex */
|
||||||
this.isMouseInput = function(data) {
|
this.isMouseInput = function(data) {
|
||||||
return /\x1b\[M/.test(data) || // eslint-disable-line no-control-regex
|
return /\x1b\[M/.test(data) ||
|
||||||
/\u001b\[M([\x00\u0020-\uffff]{3})/.test(data) || // eslint-disable-line no-control-regex
|
/\u001b\[M([\x00\u0020-\uffff]{3})/.test(data) ||
|
||||||
/\u001b\[(\d+;\d+;\d+)M/.test(data) ||
|
/\u001b\[(\d+;\d+;\d+)M/.test(data) ||
|
||||||
/\u001b\[<(\d+;\d+;\d+)([mM])/.test(data) ||
|
/\u001b\[<(\d+;\d+;\d+)([mM])/.test(data) ||
|
||||||
/\u001b\[<(\d+;\d+;\d+;\d+)&w/.test(data) ||
|
/\u001b\[<(\d+;\d+;\d+;\d+)&w/.test(data) ||
|
||||||
/\u001b\[24([0135])~\[(\d+),(\d+)\]\r/.test(data) ||
|
/\u001b\[24([0135])~\[(\d+),(\d+)\]\r/.test(data) ||
|
||||||
/\u001b\[(O|I)/.test(data);
|
/\u001b\[(O|I)/.test(data);
|
||||||
};
|
};
|
||||||
|
/* eslint-enable no-control-regex */
|
||||||
|
|
||||||
this.getKeyComponentsFromCode = function(code) {
|
this.getKeyComponentsFromCode = function(code) {
|
||||||
return {
|
return {
|
||||||
|
|
|
@ -8,7 +8,6 @@ const DownloadQueue = require('./download_queue.js');
|
||||||
const theme = require('./theme.js');
|
const theme = require('./theme.js');
|
||||||
const ansi = require('./ansi_term.js');
|
const ansi = require('./ansi_term.js');
|
||||||
const Errors = require('./enig_error.js').Errors;
|
const Errors = require('./enig_error.js').Errors;
|
||||||
const stringFormat = require('./string_format.js');
|
|
||||||
const FileAreaWeb = require('./file_area_web.js');
|
const FileAreaWeb = require('./file_area_web.js');
|
||||||
|
|
||||||
// deps
|
// deps
|
||||||
|
|
|
@ -8,7 +8,6 @@ const DownloadQueue = require('./download_queue.js');
|
||||||
const theme = require('./theme.js');
|
const theme = require('./theme.js');
|
||||||
const ansi = require('./ansi_term.js');
|
const ansi = require('./ansi_term.js');
|
||||||
const Errors = require('./enig_error.js').Errors;
|
const Errors = require('./enig_error.js').Errors;
|
||||||
const stringFormat = require('./string_format.js');
|
|
||||||
const FileAreaWeb = require('./file_area_web.js');
|
const FileAreaWeb = require('./file_area_web.js');
|
||||||
const ErrNotEnabled = require('./enig_error.js').ErrorReasons.NotEnabled;
|
const ErrNotEnabled = require('./enig_error.js').ErrorReasons.NotEnabled;
|
||||||
const Config = require('./config.js').get;
|
const Config = require('./config.js').get;
|
||||||
|
|
|
@ -1,10 +1,9 @@
|
||||||
/* jslint node: true */
|
/* jslint node: true */
|
||||||
'use strict';
|
'use strict';
|
||||||
|
|
||||||
|
// deps
|
||||||
const paths = require('path');
|
const paths = require('path');
|
||||||
|
|
||||||
const os = require('os');
|
const os = require('os');
|
||||||
const moment = require('moment');
|
|
||||||
|
|
||||||
const packageJson = require('../package.json');
|
const packageJson = require('../package.json');
|
||||||
|
|
||||||
|
|
|
@ -15,7 +15,6 @@ const UserProps = require('./user_property.js');
|
||||||
|
|
||||||
// deps
|
// deps
|
||||||
const _ = require('lodash');
|
const _ = require('lodash');
|
||||||
const moment = require('moment');
|
|
||||||
|
|
||||||
exports.moduleInfo = {
|
exports.moduleInfo = {
|
||||||
name : 'NUA',
|
name : 'NUA',
|
||||||
|
|
Loading…
Reference in New Issue