diff --git a/.editorconfig b/.editorconfig new file mode 100644 index 0000000..5370727 --- /dev/null +++ b/.editorconfig @@ -0,0 +1,14 @@ +# editorconfig.org + +root = true + +[*] +charset = utf-8 +end_of_line = lf +insert_final_newline = true +indent_style = space +indent_size = 2 +trim_trailing_whitespace = true + +[*.md] +trim_trailing_whitespace = false diff --git a/.eslintrc.js b/.eslintrc.js new file mode 100644 index 0000000..a55639c --- /dev/null +++ b/.eslintrc.js @@ -0,0 +1,15 @@ +module.exports = { + env: { + browser: true, + commonjs: true, + es2021: true, + }, + extends: [ + 'airbnb-base', + ], + parserOptions: { + ecmaVersion: 12, + }, + rules: { + }, +}; diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 0000000..c917234 --- /dev/null +++ b/.gitattributes @@ -0,0 +1,107 @@ +# From https://github.com/Danimoth/gitattributes/blob/master/Web.gitattributes + +# Handle line endings automatically for files detected as text +# and leave all files detected as binary untouched. +* text=auto + +# +# The above will handle all files NOT found below +# + +# +## These files are text and should be normalized (Convert crlf => lf) +# + +# source code +*.php text +*.css text +*.sass text +*.scss text +*.less text +*.styl text +*.js text eol=lf +*.coffee text +*.json text +*.htm text +*.html text +*.xml text +*.svg text +*.txt text +*.ini text +*.inc text +*.pl text +*.rb text +*.py text +*.scm text +*.sql text +*.sh text +*.bat text + +# templates +*.ejs text +*.hbt text +*.jade text +*.haml text +*.hbs text +*.dot text +*.tmpl text +*.phtml text + +# server config +.htaccess text +.nginx.conf text + +# git config +.gitattributes text +.gitignore text +.gitconfig text + +# code analysis config +.jshintrc text +.jscsrc text +.jshintignore text +.csslintrc text + +# misc config +*.yaml text +*.yml text +.editorconfig text + +# build config +*.npmignore text +*.bowerrc text + +# Heroku +Procfile text +.slugignore text + +# Documentation +*.md text +LICENSE text +AUTHORS text + + +# +## These files are binary and should be left untouched +# + +# (binary is a macro for -text -diff) +*.png binary +*.jpg binary +*.jpeg binary +*.gif binary +*.ico binary +*.mov binary +*.mp4 binary +*.mp3 binary +*.flv binary +*.fla binary +*.swf binary +*.gz binary +*.zip binary +*.7z binary +*.ttf binary +*.eot binary +*.woff binary +*.pyc binary +*.pdf binary diff --git a/package-lock.json b/package-lock.json index 8d2934e..43ea2c8 100644 --- a/package-lock.json +++ b/package-lock.json @@ -4,6 +4,113 @@ "lockfileVersion": 1, "requires": true, "dependencies": { + "@babel/code-frame": { + "version": "7.10.4", + "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.10.4.tgz", + "integrity": "sha512-vG6SvB6oYEhvgisZNFRmRCUkLz11c7rp+tbNTynGqc6mS1d5ATd/sGyV6W0KZZnXRKMTzZDRgQT3Ou9jhpAfUg==", + "dev": true, + "requires": { + "@babel/highlight": "^7.10.4" + } + }, + "@babel/helper-validator-identifier": { + "version": "7.10.4", + "resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.10.4.tgz", + "integrity": "sha512-3U9y+43hz7ZM+rzG24Qe2mufW5KhvFg/NhnNph+i9mgCtdTCtMJuI1TMkrIUiK7Ix4PYlRF9I5dhqaLYA/ADXw==", + "dev": true + }, + "@babel/highlight": { + "version": "7.10.4", + "resolved": "https://registry.npmjs.org/@babel/highlight/-/highlight-7.10.4.tgz", + "integrity": "sha512-i6rgnR/YgPEQzZZnbTHHuZdlE8qyoBNalD6F+q4vAFlcMEcqmkoG+mPqJYJCo63qPf74+Y1UZsl3l6f7/RIkmA==", + "dev": true, + "requires": { + "@babel/helper-validator-identifier": "^7.10.4", + "chalk": "^2.0.0", + "js-tokens": "^4.0.0" + }, + "dependencies": { + "ansi-styles": { + "version": "3.2.1", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", + "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", + "dev": true, + "requires": { + "color-convert": "^1.9.0" + } + }, + "chalk": { + "version": "2.4.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz", + "integrity": "sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==", + "dev": true, + "requires": { + "ansi-styles": "^3.2.1", + "escape-string-regexp": "^1.0.5", + "supports-color": "^5.3.0" + } + }, + "color-convert": { + "version": "1.9.3", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-1.9.3.tgz", + "integrity": "sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg==", + "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 + }, + "has-flag": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", + "integrity": "sha1-tdRU3CGZriJWmfNGfloH87lVuv0=", + "dev": true + }, + "supports-color": { + "version": "5.5.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz", + "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==", + "dev": true, + "requires": { + "has-flag": "^3.0.0" + } + } + } + }, + "@eslint/eslintrc": { + "version": "0.1.3", + "resolved": "https://registry.npmjs.org/@eslint/eslintrc/-/eslintrc-0.1.3.tgz", + "integrity": "sha512-4YVwPkANLeNtRjMekzux1ci8hIaH5eGKktGqR0d3LWsKNn5B2X/1Z6Trxy7jQXl9EBGE6Yj02O+t09FMeRllaA==", + "dev": true, + "requires": { + "ajv": "^6.12.4", + "debug": "^4.1.1", + "espree": "^7.3.0", + "globals": "^12.1.0", + "ignore": "^4.0.6", + "import-fresh": "^3.2.1", + "js-yaml": "^3.13.1", + "lodash": "^4.17.19", + "minimatch": "^3.0.4", + "strip-json-comments": "^3.1.1" + }, + "dependencies": { + "debug": { + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.1.1.tgz", + "integrity": "sha512-pYAIzeRo8J6KPEaJ0VWOh5Pzkbw/RetuzehGM7QRRX5he4fPHx2rdKMB256ehJCkX+XRQm16eZLqLNS8RSZXZw==", + "dev": true, + "requires": { + "ms": "^2.1.1" + } + } + } + }, "@opencensus/core": { "version": "0.0.9", "resolved": "https://registry.npmjs.org/@opencensus/core/-/core-0.0.9.tgz", @@ -173,29 +280,29 @@ } } }, - "@pm2/pm2-version-check": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/@pm2/pm2-version-check/-/pm2-version-check-1.0.3.tgz", - "integrity": "sha512-SBuYsh+o35knItbRW97vl5/5nEc5c5DYP7PxjyPLOfmm9bMaDsVeATXjXMBy6+KLlyrYWHZxGbfXe003NnHClg==", - "requires": { - "debug": "^4.1.1" - }, - "dependencies": { - "debug": { - "version": "4.1.1", - "resolved": "https://registry.npmjs.org/debug/-/debug-4.1.1.tgz", - "integrity": "sha512-pYAIzeRo8J6KPEaJ0VWOh5Pzkbw/RetuzehGM7QRRX5he4fPHx2rdKMB256ehJCkX+XRQm16eZLqLNS8RSZXZw==", - "requires": { - "ms": "^2.1.1" - } - } - } - }, "@types/color-name": { "version": "1.1.1", "resolved": "https://registry.npmjs.org/@types/color-name/-/color-name-1.1.1.tgz", "integrity": "sha512-rr+OQyAjxze7GgWrSaJwydHStIhHq2lvY3BOC2Mj7KnzI7XK0Uw1TOOdI9lDoajEbSWLiYgoo4f1R51erQfhPQ==" }, + "@types/json5": { + "version": "0.0.29", + "resolved": "https://registry.npmjs.org/@types/json5/-/json5-0.0.29.tgz", + "integrity": "sha1-7ihweulOEdK4J7y+UnC86n8+ce4=", + "dev": true + }, + "acorn": { + "version": "7.4.0", + "resolved": "https://registry.npmjs.org/acorn/-/acorn-7.4.0.tgz", + "integrity": "sha512-+G7P8jJmCHr+S+cLfQxygbWhXy+8YTVGzAkpEbcLo2mLoL7tij/VG41QSHACSf5QgYRhMZYHuNc6drJaO0Da+w==", + "dev": true + }, + "acorn-jsx": { + "version": "5.3.1", + "resolved": "https://registry.npmjs.org/acorn-jsx/-/acorn-jsx-5.3.1.tgz", + "integrity": "sha512-K0Ptm/47OKfQRpNQ2J/oIN/3QYiK6FwW+eJbILhsdxh2WTLdl+30o8aGdTbm5JbffpFFAg/g+zi1E+jvJha5ng==", + "dev": true + }, "agent-base": { "version": "4.3.0", "resolved": "https://registry.npmjs.org/agent-base/-/agent-base-4.3.0.tgz", @@ -204,6 +311,18 @@ "es6-promisify": "^5.0.0" } }, + "ajv": { + "version": "6.12.5", + "resolved": "https://registry.npmjs.org/ajv/-/ajv-6.12.5.tgz", + "integrity": "sha512-lRF8RORchjpKG50/WFf8xmg7sgCLFiYNNnqdKflk63whMQcWR5ngGjiSXkL9bjxy6B2npOK2HSMN49jEBMSkag==", + "dev": true, + "requires": { + "fast-deep-equal": "^3.1.1", + "fast-json-stable-stringify": "^2.0.0", + "json-schema-traverse": "^0.4.1", + "uri-js": "^4.2.2" + } + }, "amp": { "version": "0.3.1", "resolved": "https://registry.npmjs.org/amp/-/amp-0.3.1.tgz", @@ -222,6 +341,12 @@ "resolved": "https://registry.npmjs.org/ansi-colors/-/ansi-colors-3.2.4.tgz", "integrity": "sha512-hHUXGagefjN2iRrID63xckIvotOXOojhQKWIPUZ4mNUZ9nLZW+7FMNoE1lOkEhNWYsx/7ysGIuJYCiMAA9FnrA==" }, + "ansi-regex": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.0.tgz", + "integrity": "sha512-bY6fj56OUQ0hU1KjFNDQuJFezqKdrAyFdIevADiqrWHwSlbmBNMHp5ak2f40Pm8JTFyM2mqxkG6ngkHO11f/lg==", + "dev": true + }, "ansi-styles": { "version": "4.2.1", "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.2.1.tgz", @@ -255,6 +380,69 @@ } } }, + "array-includes": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/array-includes/-/array-includes-3.1.1.tgz", + "integrity": "sha512-c2VXaCHl7zPsvpkFsw4nxvFie4fh1ur9bpcgsVkIjqn0H/Xwdg+7fv3n2r/isyS8EBj5b06M9kHyZuIr4El6WQ==", + "dev": true, + "requires": { + "define-properties": "^1.1.3", + "es-abstract": "^1.17.0", + "is-string": "^1.0.5" + }, + "dependencies": { + "es-abstract": { + "version": "1.17.6", + "resolved": "https://registry.npmjs.org/es-abstract/-/es-abstract-1.17.6.tgz", + "integrity": "sha512-Fr89bON3WFyUi5EvAeI48QTWX0AyekGgLA8H+c+7fbfCkJwRWRMLd8CQedNEyJuoYYhmtEqY92pgte1FAhBlhw==", + "dev": true, + "requires": { + "es-to-primitive": "^1.2.1", + "function-bind": "^1.1.1", + "has": "^1.0.3", + "has-symbols": "^1.0.1", + "is-callable": "^1.2.0", + "is-regex": "^1.1.0", + "object-inspect": "^1.7.0", + "object-keys": "^1.1.1", + "object.assign": "^4.1.0", + "string.prototype.trimend": "^1.0.1", + "string.prototype.trimstart": "^1.0.1" + } + } + } + }, + "array.prototype.flat": { + "version": "1.2.3", + "resolved": "https://registry.npmjs.org/array.prototype.flat/-/array.prototype.flat-1.2.3.tgz", + "integrity": "sha512-gBlRZV0VSmfPIeWfuuy56XZMvbVfbEUnOXUvt3F/eUUUSyzlgLxhEX4YAEpxNAogRGehPSnfXyPtYyKAhkzQhQ==", + "dev": true, + "requires": { + "define-properties": "^1.1.3", + "es-abstract": "^1.17.0-next.1" + }, + "dependencies": { + "es-abstract": { + "version": "1.17.6", + "resolved": "https://registry.npmjs.org/es-abstract/-/es-abstract-1.17.6.tgz", + "integrity": "sha512-Fr89bON3WFyUi5EvAeI48QTWX0AyekGgLA8H+c+7fbfCkJwRWRMLd8CQedNEyJuoYYhmtEqY92pgte1FAhBlhw==", + "dev": true, + "requires": { + "es-to-primitive": "^1.2.1", + "function-bind": "^1.1.1", + "has": "^1.0.3", + "has-symbols": "^1.0.1", + "is-callable": "^1.2.0", + "is-regex": "^1.1.0", + "object-inspect": "^1.7.0", + "object-keys": "^1.1.1", + "object.assign": "^4.1.0", + "string.prototype.trimend": "^1.0.1", + "string.prototype.trimstart": "^1.0.1" + } + } + } + }, "ast-types": { "version": "0.14.1", "resolved": "https://registry.npmjs.org/ast-types/-/ast-types-0.14.1.tgz", @@ -263,6 +451,12 @@ "tslib": "^2.0.1" } }, + "astral-regex": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/astral-regex/-/astral-regex-1.0.0.tgz", + "integrity": "sha512-+Ryf6g3BKoRc7jfp7ad8tM4TtMiaWvbF/1/sQcZPkkS7ag3D5nMBCe2UfOTONtAkaG0tO0ij3C5Lwmf1EiyjHg==", + "dev": true + }, "async": { "version": "2.6.3", "resolved": "https://registry.npmjs.org/async/-/async-2.6.3.tgz", @@ -370,10 +564,11 @@ "resolved": "https://registry.npmjs.org/bytes/-/bytes-3.1.0.tgz", "integrity": "sha512-zauLjrfCG+xvoyaqLoV8bLVXXNGC4JqlxFCutSDWA6fJrTo2ZuvLYTqZ7aHBLZSMOopbzwv8f+wZcVzfVTI2Dg==" }, - "camelcase": { - "version": "5.3.1", - "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-5.3.1.tgz", - "integrity": "sha512-L28STB170nwWS63UjtlEOE3dldQApaJXZkOI1uMFfzf3rRuPegHaHesyee+YxQ+W6SvRDQV6UrdOdRiR153wJg==" + "callsites": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/callsites/-/callsites-3.1.0.tgz", + "integrity": "sha512-P8BjAsXvZS+VIDUI11hHCQEv74YT67YUi5JJFNWIqL235sBmjX4+qx9Muvls5ivyNENctx46xQLQ3aTuE7ssaQ==", + "dev": true }, "chalk": { "version": "3.0.0", @@ -445,6 +640,18 @@ "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", "integrity": "sha1-2Klr13/Wjfd5OnMDajug1UBdR3s=" }, + "confusing-browser-globals": { + "version": "1.0.9", + "resolved": "https://registry.npmjs.org/confusing-browser-globals/-/confusing-browser-globals-1.0.9.tgz", + "integrity": "sha512-KbS1Y0jMtyPgIxjO7ZzMAuUpAKMt1SzCL9fsrKsX6b0zJPTaT0SiSPmewwVZg9UAO83HVIlEhZF84LIjZ0lmAw==", + "dev": true + }, + "contains-path": { + "version": "0.1.0", + "resolved": "https://registry.npmjs.org/contains-path/-/contains-path-0.1.0.tgz", + "integrity": "sha1-/ozxhP9mcLa67wGp1IYaXL7EEgo=", + "dev": true + }, "continuation-local-storage": { "version": "3.2.1", "resolved": "https://registry.npmjs.org/continuation-local-storage/-/continuation-local-storage-3.2.1.tgz", @@ -472,6 +679,17 @@ "moment-timezone": "^0.5.x" } }, + "cross-spawn": { + "version": "7.0.3", + "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.3.tgz", + "integrity": "sha512-iRDPJKUPVEND7dHPO8rkbOnPpyDygcDFtWjpeWNCgy8WP2rXcxXL8TskReQl6OrB2G7+UJrags1q15Fudc7G6w==", + "dev": true, + "requires": { + "path-key": "^3.1.0", + "shebang-command": "^2.0.0", + "which": "^2.0.1" + } + }, "data-uri-to-buffer": { "version": "1.2.0", "resolved": "https://registry.npmjs.org/data-uri-to-buffer/-/data-uri-to-buffer-1.2.0.tgz", @@ -495,6 +713,15 @@ "resolved": "https://registry.npmjs.org/deep-is/-/deep-is-0.1.3.tgz", "integrity": "sha1-s2nW+128E+7PUk+RsHD+7cNXzzQ=" }, + "define-properties": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/define-properties/-/define-properties-1.1.3.tgz", + "integrity": "sha512-3MqfYKj2lLzdMSf8ZIZE/V+Zuy+BgD6f164e8K2w7dgnpKArBDerGYpM46IYYcjnkdPNMjPk9A6VFB8+3SKlXQ==", + "dev": true, + "requires": { + "object-keys": "^1.0.12" + } + }, "degenerator": { "version": "1.0.4", "resolved": "https://registry.npmjs.org/degenerator/-/degenerator-1.0.4.tgz", @@ -510,6 +737,15 @@ "resolved": "https://registry.npmjs.org/depd/-/depd-1.1.2.tgz", "integrity": "sha1-m81S4UwJd2PnSbJ0xDRu0uVgtak=" }, + "doctrine": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/doctrine/-/doctrine-3.0.0.tgz", + "integrity": "sha512-yS+Q5i3hBf7GBkd4KG8a7eBNNWNGLTaEwwYWUijIYM7zrlYDM0BFXHjjPWlWZ1Rg7UaddZeIDmi9jF3HmqiQ2w==", + "dev": true, + "requires": { + "esutils": "^2.0.2" + } + }, "ecstatic": { "version": "3.3.2", "resolved": "https://registry.npmjs.org/ecstatic/-/ecstatic-3.3.2.tgz", @@ -529,6 +765,12 @@ "shimmer": "^1.2.0" } }, + "emoji-regex": { + "version": "7.0.3", + "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-7.0.3.tgz", + "integrity": "sha512-CwBLREIQ7LvYFB0WyRvwhq5N5qPhc6PMjD6bYggFlI5YyDgl+0vxq5VHbMOFqLg7hfWzmu8T5Z1QofhmTIhItA==", + "dev": true + }, "enquirer": { "version": "2.3.5", "resolved": "https://registry.npmjs.org/enquirer/-/enquirer-2.3.5.tgz", @@ -537,6 +779,46 @@ "ansi-colors": "^3.2.1" } }, + "error-ex": { + "version": "1.3.2", + "resolved": "https://registry.npmjs.org/error-ex/-/error-ex-1.3.2.tgz", + "integrity": "sha512-7dFHNmqeFSEt2ZBsCriorKnn3Z2pj+fd9kmI6QoWw4//DL+icEBfc0U7qJCisqrTsKTjw4fNFy2pW9OqStD84g==", + "dev": true, + "requires": { + "is-arrayish": "^0.2.1" + } + }, + "es-abstract": { + "version": "1.18.0-next.0", + "resolved": "https://registry.npmjs.org/es-abstract/-/es-abstract-1.18.0-next.0.tgz", + "integrity": "sha512-elZXTZXKn51hUBdJjSZGYRujuzilgXo8vSPQzjGYXLvSlGiCo8VO8ZGV3kjo9a0WNJJ57hENagwbtlRuHuzkcQ==", + "dev": true, + "requires": { + "es-to-primitive": "^1.2.1", + "function-bind": "^1.1.1", + "has": "^1.0.3", + "has-symbols": "^1.0.1", + "is-callable": "^1.2.0", + "is-negative-zero": "^2.0.0", + "is-regex": "^1.1.1", + "object-inspect": "^1.8.0", + "object-keys": "^1.1.1", + "object.assign": "^4.1.0", + "string.prototype.trimend": "^1.0.1", + "string.prototype.trimstart": "^1.0.1" + } + }, + "es-to-primitive": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/es-to-primitive/-/es-to-primitive-1.2.1.tgz", + "integrity": "sha512-QCOllgZJtaUo9miYBcLChTUaHNjJF3PYs1VidD7AwiEj1kYxKeQTctLAezAOH5ZKRH0g2IgPn6KwB4IT8iRpvA==", + "dev": true, + "requires": { + "is-callable": "^1.1.4", + "is-date-object": "^1.0.1", + "is-symbol": "^1.0.2" + } + }, "es6-promise": { "version": "4.2.8", "resolved": "https://registry.npmjs.org/es6-promise/-/es6-promise-4.2.8.tgz", @@ -555,6 +837,12 @@ "resolved": "https://registry.npmjs.org/escape-regexp/-/escape-regexp-0.0.1.tgz", "integrity": "sha1-9EvaEtRbvfnLf4Yu5+SCez3TIlQ=" }, + "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.14.3", "resolved": "https://registry.npmjs.org/escodegen/-/escodegen-1.14.3.tgz", @@ -574,16 +862,310 @@ } } }, + "eslint": { + "version": "7.9.0", + "resolved": "https://registry.npmjs.org/eslint/-/eslint-7.9.0.tgz", + "integrity": "sha512-V6QyhX21+uXp4T+3nrNfI3hQNBDa/P8ga7LoQOenwrlEFXrEnUEE+ok1dMtaS3b6rmLXhT1TkTIsG75HMLbknA==", + "dev": true, + "requires": { + "@babel/code-frame": "^7.0.0", + "@eslint/eslintrc": "^0.1.3", + "ajv": "^6.10.0", + "chalk": "^4.0.0", + "cross-spawn": "^7.0.2", + "debug": "^4.0.1", + "doctrine": "^3.0.0", + "enquirer": "^2.3.5", + "eslint-scope": "^5.1.0", + "eslint-utils": "^2.1.0", + "eslint-visitor-keys": "^1.3.0", + "espree": "^7.3.0", + "esquery": "^1.2.0", + "esutils": "^2.0.2", + "file-entry-cache": "^5.0.1", + "functional-red-black-tree": "^1.0.1", + "glob-parent": "^5.0.0", + "globals": "^12.1.0", + "ignore": "^4.0.6", + "import-fresh": "^3.0.0", + "imurmurhash": "^0.1.4", + "is-glob": "^4.0.0", + "js-yaml": "^3.13.1", + "json-stable-stringify-without-jsonify": "^1.0.1", + "levn": "^0.4.1", + "lodash": "^4.17.19", + "minimatch": "^3.0.4", + "natural-compare": "^1.4.0", + "optionator": "^0.9.1", + "progress": "^2.0.0", + "regexpp": "^3.1.0", + "semver": "^7.2.1", + "strip-ansi": "^6.0.0", + "strip-json-comments": "^3.1.0", + "table": "^5.2.3", + "text-table": "^0.2.0", + "v8-compile-cache": "^2.0.3" + }, + "dependencies": { + "chalk": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.0.tgz", + "integrity": "sha512-qwx12AxXe2Q5xQ43Ac//I6v5aXTipYrSESdOgzrN+9XjgEpyjpKuvSGaN4qE93f7TQTlerQQ8S+EQ0EyDoVL1A==", + "dev": true, + "requires": { + "ansi-styles": "^4.1.0", + "supports-color": "^7.1.0" + } + }, + "debug": { + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.1.1.tgz", + "integrity": "sha512-pYAIzeRo8J6KPEaJ0VWOh5Pzkbw/RetuzehGM7QRRX5he4fPHx2rdKMB256ehJCkX+XRQm16eZLqLNS8RSZXZw==", + "dev": true, + "requires": { + "ms": "^2.1.1" + } + }, + "levn": { + "version": "0.4.1", + "resolved": "https://registry.npmjs.org/levn/-/levn-0.4.1.tgz", + "integrity": "sha512-+bT2uH4E5LGE7h/n3evcS/sQlJXCpIp6ym8OWJ5eV6+67Dsql/LaaT7qJBAt2rzfoa/5QBGBhxDix1dMt2kQKQ==", + "dev": true, + "requires": { + "prelude-ls": "^1.2.1", + "type-check": "~0.4.0" + } + }, + "optionator": { + "version": "0.9.1", + "resolved": "https://registry.npmjs.org/optionator/-/optionator-0.9.1.tgz", + "integrity": "sha512-74RlY5FCnhq4jRxVUPKDaRwrVNXMqsGsiW6AJw4XK8hmtm10wC0ypZBLw5IIp85NZMr91+qd1RvvENwg7jjRFw==", + "dev": true, + "requires": { + "deep-is": "^0.1.3", + "fast-levenshtein": "^2.0.6", + "levn": "^0.4.1", + "prelude-ls": "^1.2.1", + "type-check": "^0.4.0", + "word-wrap": "^1.2.3" + } + }, + "prelude-ls": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/prelude-ls/-/prelude-ls-1.2.1.tgz", + "integrity": "sha512-vkcDPrRZo1QZLbn5RLGPpg/WmIQ65qoWWhcGKf/b5eplkkarX0m9z8ppCat4mlOqUsWpyNuYgO3VRyrYHSzX5g==", + "dev": true + }, + "type-check": { + "version": "0.4.0", + "resolved": "https://registry.npmjs.org/type-check/-/type-check-0.4.0.tgz", + "integrity": "sha512-XleUoc9uwGXqjWwXaUTZAmzMcFZ5858QA2vvx1Ur5xIcixXIP+8LnFDgRplU30us6teqdlskFfu+ae4K79Ooew==", + "dev": true, + "requires": { + "prelude-ls": "^1.2.1" + } + } + } + }, + "eslint-config-airbnb-base": { + "version": "14.2.0", + "resolved": "https://registry.npmjs.org/eslint-config-airbnb-base/-/eslint-config-airbnb-base-14.2.0.tgz", + "integrity": "sha512-Snswd5oC6nJaevs3nZoLSTvGJBvzTfnBqOIArkf3cbyTyq9UD79wOk8s+RiL6bhca0p/eRO6veczhf6A/7Jy8Q==", + "dev": true, + "requires": { + "confusing-browser-globals": "^1.0.9", + "object.assign": "^4.1.0", + "object.entries": "^1.1.2" + } + }, + "eslint-import-resolver-node": { + "version": "0.3.4", + "resolved": "https://registry.npmjs.org/eslint-import-resolver-node/-/eslint-import-resolver-node-0.3.4.tgz", + "integrity": "sha512-ogtf+5AB/O+nM6DIeBUNr2fuT7ot9Qg/1harBfBtaP13ekEWFQEEMP94BCB7zaNW3gyY+8SHYF00rnqYwXKWOA==", + "dev": true, + "requires": { + "debug": "^2.6.9", + "resolve": "^1.13.1" + }, + "dependencies": { + "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" + } + }, + "ms": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", + "integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=", + "dev": true + } + } + }, + "eslint-module-utils": { + "version": "2.6.0", + "resolved": "https://registry.npmjs.org/eslint-module-utils/-/eslint-module-utils-2.6.0.tgz", + "integrity": "sha512-6j9xxegbqe8/kZY8cYpcp0xhbK0EgJlg3g9mib3/miLaExuuwc3n5UEfSnU6hWMbT0FAYVvDbL9RrRgpUeQIvA==", + "dev": true, + "requires": { + "debug": "^2.6.9", + "pkg-dir": "^2.0.0" + }, + "dependencies": { + "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" + } + }, + "ms": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", + "integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=", + "dev": true + } + } + }, + "eslint-plugin-import": { + "version": "2.22.0", + "resolved": "https://registry.npmjs.org/eslint-plugin-import/-/eslint-plugin-import-2.22.0.tgz", + "integrity": "sha512-66Fpf1Ln6aIS5Gr/55ts19eUuoDhAbZgnr6UxK5hbDx6l/QgQgx61AePq+BV4PP2uXQFClgMVzep5zZ94qqsxg==", + "dev": true, + "requires": { + "array-includes": "^3.1.1", + "array.prototype.flat": "^1.2.3", + "contains-path": "^0.1.0", + "debug": "^2.6.9", + "doctrine": "1.5.0", + "eslint-import-resolver-node": "^0.3.3", + "eslint-module-utils": "^2.6.0", + "has": "^1.0.3", + "minimatch": "^3.0.4", + "object.values": "^1.1.1", + "read-pkg-up": "^2.0.0", + "resolve": "^1.17.0", + "tsconfig-paths": "^3.9.0" + }, + "dependencies": { + "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" + } + }, + "doctrine": { + "version": "1.5.0", + "resolved": "https://registry.npmjs.org/doctrine/-/doctrine-1.5.0.tgz", + "integrity": "sha1-N53Ocw9hZvds76TmcHoVmwLFpvo=", + "dev": true, + "requires": { + "esutils": "^2.0.2", + "isarray": "^1.0.0" + } + }, + "isarray": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz", + "integrity": "sha1-u5NdSFgsuhaMBoNJV6VKPgcSTxE=", + "dev": true + }, + "ms": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", + "integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=", + "dev": true + } + } + }, + "eslint-scope": { + "version": "5.1.1", + "resolved": "https://registry.npmjs.org/eslint-scope/-/eslint-scope-5.1.1.tgz", + "integrity": "sha512-2NxwbF/hZ0KpepYN0cNbo+FN6XoK7GaHlQhgx/hIZl6Va0bF45RQOOwhLIy8lQDbuCiadSLCBnH2CFYquit5bw==", + "dev": true, + "requires": { + "esrecurse": "^4.3.0", + "estraverse": "^4.1.1" + } + }, + "eslint-utils": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/eslint-utils/-/eslint-utils-2.1.0.tgz", + "integrity": "sha512-w94dQYoauyvlDc43XnGB8lU3Zt713vNChgt4EWwhXAP2XkBvndfxF0AgIqKOOasjPIPzj9JqgwkwbCYD0/V3Zg==", + "dev": true, + "requires": { + "eslint-visitor-keys": "^1.1.0" + } + }, + "eslint-visitor-keys": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-1.3.0.tgz", + "integrity": "sha512-6J72N8UNa462wa/KFODt/PJ3IU60SDpC3QXC1Hjc1BXXpfL2C9R5+AU7jhe0F6GREqVMh4Juu+NY7xn+6dipUQ==", + "dev": true + }, "esm": { "version": "3.2.25", "resolved": "https://registry.npmjs.org/esm/-/esm-3.2.25.tgz", "integrity": "sha512-U1suiZ2oDVWv4zPO56S0NcR5QriEahGtdN2OR6FiOG4WJvcjBVFB0qI4+eKoWFH483PKGuLuu6V8Z4T5g63UVA==" }, + "espree": { + "version": "7.3.0", + "resolved": "https://registry.npmjs.org/espree/-/espree-7.3.0.tgz", + "integrity": "sha512-dksIWsvKCixn1yrEXO8UosNSxaDoSYpq9reEjZSbHLpT5hpaCAKTLBwq0RHtLrIr+c0ByiYzWT8KTMRzoRCNlw==", + "dev": true, + "requires": { + "acorn": "^7.4.0", + "acorn-jsx": "^5.2.0", + "eslint-visitor-keys": "^1.3.0" + } + }, "esprima": { "version": "3.1.3", "resolved": "https://registry.npmjs.org/esprima/-/esprima-3.1.3.tgz", "integrity": "sha1-/cpRzuYTOJXjyI1TXOSdv/YqRjM=" }, + "esquery": { + "version": "1.3.1", + "resolved": "https://registry.npmjs.org/esquery/-/esquery-1.3.1.tgz", + "integrity": "sha512-olpvt9QG0vniUBZspVRN6lwB7hOZoTRtT+jzR+tS4ffYx2mzbw+z0XCOk44aaLYKApNX5nMm+E+P6o25ip/DHQ==", + "dev": true, + "requires": { + "estraverse": "^5.1.0" + }, + "dependencies": { + "estraverse": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-5.2.0.tgz", + "integrity": "sha512-BxbNGGNm0RyRYvUdHpIwv9IWzeM9XClbOxwoATuFdOE7ZE6wHL+HQ5T8hoPM+zHvmKzzsEqhgy0GrQ5X13afiQ==", + "dev": true + } + } + }, + "esrecurse": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/esrecurse/-/esrecurse-4.3.0.tgz", + "integrity": "sha512-KmfKL3b6G+RXvP8N1vr3Tq1kL/oCFgn2NYXEtqP8/L3pKapUA4G8cFVaoF3SU323CD4XypR/ffioHmkti6/Tag==", + "dev": true, + "requires": { + "estraverse": "^5.2.0" + }, + "dependencies": { + "estraverse": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-5.2.0.tgz", + "integrity": "sha512-BxbNGGNm0RyRYvUdHpIwv9IWzeM9XClbOxwoATuFdOE7ZE6wHL+HQ5T8hoPM+zHvmKzzsEqhgy0GrQ5X13afiQ==", + "dev": true + } + } + }, "estraverse": { "version": "4.3.0", "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-4.3.0.tgz", @@ -609,6 +1191,18 @@ "resolved": "https://registry.npmjs.org/extend/-/extend-3.0.2.tgz", "integrity": "sha512-fjquC59cD7CyW6urNXK0FBufkZcoiGG80wTuPujX590cB5Ttln20E2UB4S/WARVqhXffZl2LNgS+gQdPIIim/g==" }, + "fast-deep-equal": { + "version": "3.1.3", + "resolved": "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-3.1.3.tgz", + "integrity": "sha512-f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q==", + "dev": true + }, + "fast-json-stable-stringify": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/fast-json-stable-stringify/-/fast-json-stable-stringify-2.1.0.tgz", + "integrity": "sha512-lhd/wF+Lk98HZoTCtlVraHtfh5XYijIjalXck7saUtuanSDyLMxnHhSXEDJqHxD7msR8D0uCmqlkwjCV8xvwHw==", + "dev": true + }, "fast-levenshtein": { "version": "2.0.6", "resolved": "https://registry.npmjs.org/fast-levenshtein/-/fast-levenshtein-2.0.6.tgz", @@ -619,6 +1213,15 @@ "resolved": "https://registry.npmjs.org/fclone/-/fclone-1.0.11.tgz", "integrity": "sha1-EOhdo4v+p/xZk0HClu4ddyZu5kA=" }, + "file-entry-cache": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/file-entry-cache/-/file-entry-cache-5.0.1.tgz", + "integrity": "sha512-bCg29ictuBaKUwwArK4ouCaqDgLZcysCFLmM/Yn/FDoqndh/9vNuQfXRDvTuXKLxfD/JtZQGKFT8MGcJBK644g==", + "dev": true, + "requires": { + "flat-cache": "^2.0.1" + } + }, "file-uri-to-path": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/file-uri-to-path/-/file-uri-to-path-1.0.0.tgz", @@ -632,6 +1235,32 @@ "to-regex-range": "^5.0.1" } }, + "find-up": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/find-up/-/find-up-2.1.0.tgz", + "integrity": "sha1-RdG35QbHF93UgndaK3eSCjwMV6c=", + "dev": true, + "requires": { + "locate-path": "^2.0.0" + } + }, + "flat-cache": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/flat-cache/-/flat-cache-2.0.1.tgz", + "integrity": "sha512-LoQe6yDuUMDzQAEH8sgmh4Md6oZnc/7PjtwjNFSzveXqSHt6ka9fPBuso7IGf9Rz4uqnSnWiFH2B/zj24a5ReA==", + "dev": true, + "requires": { + "flatted": "^2.0.0", + "rimraf": "2.6.3", + "write": "1.0.3" + } + }, + "flatted": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/flatted/-/flatted-2.0.2.tgz", + "integrity": "sha512-r5wGx7YeOwNWNlCA0wQ86zKyDLMQr+/RB8xy74M4hTphfmjlijTSSXGuH8rnvKZnfT9i+75zmd8jcKdMR4O6jA==", + "dev": true + }, "follow-redirects": { "version": "1.13.0", "resolved": "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.13.0.tgz", @@ -670,6 +1299,18 @@ } } }, + "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 + }, "get-uri": { "version": "2.0.4", "resolved": "https://registry.npmjs.org/get-uri/-/get-uri-2.0.4.tgz", @@ -719,16 +1360,52 @@ "is-glob": "^4.0.1" } }, + "globals": { + "version": "12.4.0", + "resolved": "https://registry.npmjs.org/globals/-/globals-12.4.0.tgz", + "integrity": "sha512-BWICuzzDvDoH54NHKCseDanAhE3CeDorgDL5MT6LMXXj2WCnd9UC2szdk4AWLfjdgNBCXLUanXYcpBBKOSWGwg==", + "dev": true, + "requires": { + "type-fest": "^0.8.1" + } + }, + "graceful-fs": { + "version": "4.2.4", + "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.4.tgz", + "integrity": "sha512-WjKPNJF79dtJAVniUlGGWHYGz2jWxT6VhN/4m1NdkbZ2nOsEF+cI1Edgql5zCRhs/VsQYRvrXctxktVXZUkixw==", + "dev": true + }, + "has": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/has/-/has-1.0.3.tgz", + "integrity": "sha512-f2dvO0VU6Oej7RkWJGrehjbzMAjFp5/VKPp5tTpWIV4JHHZK1/BxbFRtf/siA2SWTe09caDmVtYYzWEIbBS4zw==", + "dev": true, + "requires": { + "function-bind": "^1.1.1" + } + }, "has-flag": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==" }, + "has-symbols": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/has-symbols/-/has-symbols-1.0.1.tgz", + "integrity": "sha512-PLcsoqu++dmEIZB+6totNFKq/7Do+Z0u4oT0zKOJNl3lYK6vGwwu2hjHs+68OEZbTjiUE9bgOABXbP/GvrS0Kg==", + "dev": true + }, "he": { "version": "1.2.0", "resolved": "https://registry.npmjs.org/he/-/he-1.2.0.tgz", "integrity": "sha512-F/1DnUGPopORZi0ni+CvrCgHQ5FyEAHRLSApuYWMmrbSwoN2Mn/7k+Gl38gJnR7yyDZk6WLXwiGod1JOWNDKGw==" }, + "hosted-git-info": { + "version": "2.8.8", + "resolved": "https://registry.npmjs.org/hosted-git-info/-/hosted-git-info-2.8.8.tgz", + "integrity": "sha512-f/wzC2QaWBs7t9IYqB4T3sR1xviIViXJRJTWBlx2Gf3g0Xi5vI7Yy4koXQ1c9OYDGHN9sBy1DQ2AB8fqZBWhUg==", + "dev": true + }, "http-errors": { "version": "1.7.3", "resolved": "https://registry.npmjs.org/http-errors/-/http-errors-1.7.3.tgz", @@ -809,6 +1486,28 @@ "safer-buffer": ">= 2.1.2 < 3" } }, + "ignore": { + "version": "4.0.6", + "resolved": "https://registry.npmjs.org/ignore/-/ignore-4.0.6.tgz", + "integrity": "sha512-cyFDKrqc/YdcWFniJhzI42+AzS+gNwmUzOSFcRCQYwySuBBBy/KjuxWLZ/FHEH6Moq1NizMOBWyTcv8O4OZIMg==", + "dev": true + }, + "import-fresh": { + "version": "3.2.1", + "resolved": "https://registry.npmjs.org/import-fresh/-/import-fresh-3.2.1.tgz", + "integrity": "sha512-6e1q1cnWP2RXD9/keSkxHScg508CdXqXWgWBaETNhyuBFz+kUZlKboh+ISK+bU++DmbHimVBrOz/zzPe0sZ3sQ==", + "dev": true, + "requires": { + "parent-module": "^1.0.0", + "resolve-from": "^4.0.0" + } + }, + "imurmurhash": { + "version": "0.1.4", + "resolved": "https://registry.npmjs.org/imurmurhash/-/imurmurhash-0.1.4.tgz", + "integrity": "sha1-khi5srkoojixPcT7a21XbyMUU+o=", + "dev": true + }, "inflight": { "version": "1.0.6", "resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz", @@ -828,6 +1527,12 @@ "resolved": "https://registry.npmjs.org/ip/-/ip-1.1.5.tgz", "integrity": "sha1-vd7XARQpCCjAoDnnLvJfWq7ENUo=" }, + "is-arrayish": { + "version": "0.2.1", + "resolved": "https://registry.npmjs.org/is-arrayish/-/is-arrayish-0.2.1.tgz", + "integrity": "sha1-d8mYQFJ6qOyxqLppe4BkWnqSap0=", + "dev": true + }, "is-binary-path": { "version": "2.1.0", "resolved": "https://registry.npmjs.org/is-binary-path/-/is-binary-path-2.1.0.tgz", @@ -836,11 +1541,29 @@ "binary-extensions": "^2.0.0" } }, + "is-callable": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/is-callable/-/is-callable-1.2.1.tgz", + "integrity": "sha512-wliAfSzx6V+6WfMOmus1xy0XvSgf/dlStkvTfq7F0g4bOIW0PSUbnyse3NhDwdyYS1ozfUtAAySqTws3z9Eqgg==", + "dev": true + }, + "is-date-object": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/is-date-object/-/is-date-object-1.0.2.tgz", + "integrity": "sha512-USlDT524woQ08aoZFzh3/Z6ch9Y/EWXEHQ/AaRN0SkKq4t2Jw2R2339tSXmwuVoY7LLlBCbOIlx2myP/L5zk0g==", + "dev": true + }, "is-extglob": { "version": "2.1.1", "resolved": "https://registry.npmjs.org/is-extglob/-/is-extglob-2.1.1.tgz", "integrity": "sha1-qIwCU1eR8C7TfHahueqXc8gz+MI=" }, + "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": "4.0.1", "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-4.0.1.tgz", @@ -849,16 +1572,97 @@ "is-extglob": "^2.1.1" } }, + "is-negative-zero": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/is-negative-zero/-/is-negative-zero-2.0.0.tgz", + "integrity": "sha1-lVOxIbD6wohp2p7UWeIMdUN4hGE=", + "dev": true + }, "is-number": { "version": "7.0.0", "resolved": "https://registry.npmjs.org/is-number/-/is-number-7.0.0.tgz", "integrity": "sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng==" }, + "is-regex": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/is-regex/-/is-regex-1.1.1.tgz", + "integrity": "sha512-1+QkEcxiLlB7VEyFtyBg94e08OAsvq7FUBgApTq/w2ymCLyKJgDPsybBENVtA7XCQEgEXxKPonG+mvYRxh/LIg==", + "dev": true, + "requires": { + "has-symbols": "^1.0.1" + } + }, + "is-string": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/is-string/-/is-string-1.0.5.tgz", + "integrity": "sha512-buY6VNRjhQMiF1qWDouloZlQbRhDPCebwxSjxMjxgemYT46YMd2NR0/H+fBhEfWX4A/w9TBJ+ol+okqJKFE6vQ==", + "dev": true + }, + "is-symbol": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/is-symbol/-/is-symbol-1.0.3.tgz", + "integrity": "sha512-OwijhaRSgqvhm/0ZdAcXNZt9lYdKFpcRDT5ULUuYXPoT794UNOdU+gpT6Rzo7b4V2HUl/op6GqY894AZwv9faQ==", + "dev": true, + "requires": { + "has-symbols": "^1.0.1" + } + }, "isarray": { "version": "0.0.1", "resolved": "https://registry.npmjs.org/isarray/-/isarray-0.0.1.tgz", "integrity": "sha1-ihis/Kmo9Bd+Cav8YDiTmwXR7t8=" }, + "isexe": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/isexe/-/isexe-2.0.0.tgz", + "integrity": "sha1-6PvzdNxVb/iUehDcsFctYz8s+hA=", + "dev": true + }, + "js-tokens": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/js-tokens/-/js-tokens-4.0.0.tgz", + "integrity": "sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ==", + "dev": true + }, + "js-yaml": { + "version": "3.14.0", + "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-3.14.0.tgz", + "integrity": "sha512-/4IbIeHcD9VMHFqDR/gQ7EdZdLimOvW2DdcxFjdyyZ9NsbS+ccrXqVWDtab/lRl5AlUqmpBx8EhPaWR+OtY17A==", + "dev": true, + "requires": { + "argparse": "^1.0.7", + "esprima": "^4.0.0" + }, + "dependencies": { + "esprima": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/esprima/-/esprima-4.0.1.tgz", + "integrity": "sha512-eGuFFw7Upda+g4p+QHvnW0RyTX/SVeJBDM/gCtMARO0cLuT2HcEKnTPvhjV6aGeqrCB/sbNop0Kszm0jsaWU4A==", + "dev": true + } + } + }, + "json-schema-traverse": { + "version": "0.4.1", + "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-0.4.1.tgz", + "integrity": "sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg==", + "dev": true + }, + "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 + }, + "json5": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/json5/-/json5-1.0.1.tgz", + "integrity": "sha512-aKS4WQjPenRxiQsC93MNfjx+nbF4PAdYzmd/1JIj8HYzqfbu86beTuNgXDzPknWk0n0uARlyewZo4s++ES36Ow==", + "dev": true, + "requires": { + "minimist": "^1.2.0" + } + }, "lazy": { "version": "1.0.11", "resolved": "https://registry.npmjs.org/lazy/-/lazy-1.0.11.tgz", @@ -873,6 +1677,28 @@ "type-check": "~0.3.2" } }, + "load-json-file": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/load-json-file/-/load-json-file-2.0.0.tgz", + "integrity": "sha1-eUfkIUmvgNaWy/eXvKq8/h/inKg=", + "dev": true, + "requires": { + "graceful-fs": "^4.1.2", + "parse-json": "^2.2.0", + "pify": "^2.0.0", + "strip-bom": "^3.0.0" + } + }, + "locate-path": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-2.0.0.tgz", + "integrity": "sha1-K1aLJl7slExtnA3pw9u7ygNUzY4=", + "dev": true, + "requires": { + "p-locate": "^2.0.0", + "path-exists": "^3.0.0" + } + }, "lodash": { "version": "4.17.20", "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.20.tgz", @@ -945,6 +1771,12 @@ "resolved": "https://registry.npmjs.org/mute-stream/-/mute-stream-0.0.8.tgz", "integrity": "sha512-nnbWWOkoWyUsTjKrhgD0dcz22mdkSnpYqbEjIm2nhwhuxlSkpywJmBo8h0ZqJdkp73mb90SssHkN4rsRaBAfAA==" }, + "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 + }, "needle": { "version": "2.4.0", "resolved": "https://registry.npmjs.org/needle/-/needle-2.4.0.tgz", @@ -960,6 +1792,26 @@ "resolved": "https://registry.npmjs.org/netmask/-/netmask-1.0.6.tgz", "integrity": "sha1-ICl+idhvb2QA8lDZ9Pa0wZRfzTU=" }, + "normalize-package-data": { + "version": "2.5.0", + "resolved": "https://registry.npmjs.org/normalize-package-data/-/normalize-package-data-2.5.0.tgz", + "integrity": "sha512-/5CMN3T0R4XTj4DcGaexo+roZSdSFW/0AOOTROrjxzCG1wrWXEsGbRKevjlIL+ZDE4sZlJr5ED4YW0yqmkK+eA==", + "dev": true, + "requires": { + "hosted-git-info": "^2.1.4", + "resolve": "^1.10.0", + "semver": "2 || 3 || 4 || 5", + "validate-npm-package-license": "^3.0.1" + }, + "dependencies": { + "semver": { + "version": "5.7.1", + "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.1.tgz", + "integrity": "sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ==", + "dev": true + } + } + }, "normalize-path": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/normalize-path/-/normalize-path-3.0.0.tgz", @@ -981,6 +1833,95 @@ } } }, + "object-inspect": { + "version": "1.8.0", + "resolved": "https://registry.npmjs.org/object-inspect/-/object-inspect-1.8.0.tgz", + "integrity": "sha512-jLdtEOB112fORuypAyl/50VRVIBIdVQOSUUGQHzJ4xBSbit81zRarz7GThkEFZy1RceYrWYcPcBFPQwHyAc1gA==", + "dev": true + }, + "object-keys": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/object-keys/-/object-keys-1.1.1.tgz", + "integrity": "sha512-NuAESUOUMrlIXOfHKzD6bpPu3tYt3xvjNdRIQ+FeT0lNb4K8WR70CaDxhuNguS2XG+GjkyMwOzsN5ZktImfhLA==", + "dev": true + }, + "object.assign": { + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/object.assign/-/object.assign-4.1.1.tgz", + "integrity": "sha512-VT/cxmx5yaoHSOTSyrCygIDFco+RsibY2NM0a4RdEeY/4KgqezwFtK1yr3U67xYhqJSlASm2pKhLVzPj2lr4bA==", + "dev": true, + "requires": { + "define-properties": "^1.1.3", + "es-abstract": "^1.18.0-next.0", + "has-symbols": "^1.0.1", + "object-keys": "^1.1.1" + } + }, + "object.entries": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/object.entries/-/object.entries-1.1.2.tgz", + "integrity": "sha512-BQdB9qKmb/HyNdMNWVr7O3+z5MUIx3aiegEIJqjMBbBf0YT9RRxTJSim4mzFqtyr7PDAHigq0N9dO0m0tRakQA==", + "dev": true, + "requires": { + "define-properties": "^1.1.3", + "es-abstract": "^1.17.5", + "has": "^1.0.3" + }, + "dependencies": { + "es-abstract": { + "version": "1.17.6", + "resolved": "https://registry.npmjs.org/es-abstract/-/es-abstract-1.17.6.tgz", + "integrity": "sha512-Fr89bON3WFyUi5EvAeI48QTWX0AyekGgLA8H+c+7fbfCkJwRWRMLd8CQedNEyJuoYYhmtEqY92pgte1FAhBlhw==", + "dev": true, + "requires": { + "es-to-primitive": "^1.2.1", + "function-bind": "^1.1.1", + "has": "^1.0.3", + "has-symbols": "^1.0.1", + "is-callable": "^1.2.0", + "is-regex": "^1.1.0", + "object-inspect": "^1.7.0", + "object-keys": "^1.1.1", + "object.assign": "^4.1.0", + "string.prototype.trimend": "^1.0.1", + "string.prototype.trimstart": "^1.0.1" + } + } + } + }, + "object.values": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/object.values/-/object.values-1.1.1.tgz", + "integrity": "sha512-WTa54g2K8iu0kmS/us18jEmdv1a4Wi//BZ/DTVYEcH0XhLM5NYdpDHja3gt57VrZLcNAO2WGA+KpWsDBaHt6eA==", + "dev": true, + "requires": { + "define-properties": "^1.1.3", + "es-abstract": "^1.17.0-next.1", + "function-bind": "^1.1.1", + "has": "^1.0.3" + }, + "dependencies": { + "es-abstract": { + "version": "1.17.6", + "resolved": "https://registry.npmjs.org/es-abstract/-/es-abstract-1.17.6.tgz", + "integrity": "sha512-Fr89bON3WFyUi5EvAeI48QTWX0AyekGgLA8H+c+7fbfCkJwRWRMLd8CQedNEyJuoYYhmtEqY92pgte1FAhBlhw==", + "dev": true, + "requires": { + "es-to-primitive": "^1.2.1", + "function-bind": "^1.1.1", + "has": "^1.0.3", + "has-symbols": "^1.0.1", + "is-callable": "^1.2.0", + "is-regex": "^1.1.0", + "object-inspect": "^1.7.0", + "object-keys": "^1.1.1", + "object.assign": "^4.1.0", + "string.prototype.trimend": "^1.0.1", + "string.prototype.trimstart": "^1.0.1" + } + } + } + }, "once": { "version": "1.4.0", "resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz", @@ -1007,6 +1948,30 @@ "word-wrap": "~1.2.3" } }, + "p-limit": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-1.3.0.tgz", + "integrity": "sha512-vvcXsLAJ9Dr5rQOPk7toZQZJApBl2K4J6dANSsEuh6QI41JYcsS/qhTGa9ErIUUgK3WNQoJYvylxvjqmiqEA9Q==", + "dev": true, + "requires": { + "p-try": "^1.0.0" + } + }, + "p-locate": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-2.0.0.tgz", + "integrity": "sha1-IKAQOyIqcMj9OcwuWAaA893l7EM=", + "dev": true, + "requires": { + "p-limit": "^1.1.0" + } + }, + "p-try": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/p-try/-/p-try-1.0.0.tgz", + "integrity": "sha1-y8ec26+P1CKOE/Yh8rGiN8GyB7M=", + "dev": true + }, "pac-proxy-agent": { "version": "3.0.1", "resolved": "https://registry.npmjs.org/pac-proxy-agent/-/pac-proxy-agent-3.0.1.tgz", @@ -1044,16 +2009,55 @@ "thunkify": "^2.1.2" } }, + "parent-module": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/parent-module/-/parent-module-1.0.1.tgz", + "integrity": "sha512-GQ2EWRpQV8/o+Aw8YqtfZZPfNRWZYkbidE9k5rpl/hC3vtHHBfGm2Ifi6qWV+coDGkrUKZAxE3Lot5kcsRlh+g==", + "dev": true, + "requires": { + "callsites": "^3.0.0" + } + }, + "parse-json": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/parse-json/-/parse-json-2.2.0.tgz", + "integrity": "sha1-9ID0BDTvgHQfhGkJn43qGPVaTck=", + "dev": true, + "requires": { + "error-ex": "^1.2.0" + } + }, + "path-exists": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-3.0.0.tgz", + "integrity": "sha1-zg6+ql94yxiSXqfYENe1mwEP1RU=", + "dev": true + }, "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=" }, + "path-key": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/path-key/-/path-key-3.1.1.tgz", + "integrity": "sha512-ojmeN0qd+y0jszEtoY48r0Peq5dwMEkIlCOu6Q5f41lfkswXuKtYrhgoTpLnyIcHm24Uhqx+5Tqm2InSwLhE6Q==", + "dev": true + }, "path-parse": { "version": "1.0.6", "resolved": "https://registry.npmjs.org/path-parse/-/path-parse-1.0.6.tgz", "integrity": "sha512-GSmOT2EbHrINBf9SR7CDELwlJ8AENk3Qn7OikK4nFYAu3Ote2+JYNVvkpAEQm3/TLNEJFD/xZJjzyxg3KBWOzw==" }, + "path-type": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/path-type/-/path-type-2.0.0.tgz", + "integrity": "sha1-8BLMuEFbcJb8LaoQVMPXI4lZTHM=", + "dev": true, + "requires": { + "pify": "^2.0.0" + } + }, "picomatch": { "version": "2.2.2", "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-2.2.2.tgz", @@ -1067,6 +2071,21 @@ "safe-buffer": "^5.1.2" } }, + "pify": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/pify/-/pify-2.3.0.tgz", + "integrity": "sha1-7RQaasBDqEnqWISY59yosVMw6Qw=", + "dev": true + }, + "pkg-dir": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/pkg-dir/-/pkg-dir-2.0.0.tgz", + "integrity": "sha1-9tXREJ4Z1j7fQo4L1X4Sd3YVM0s=", + "dev": true, + "requires": { + "find-up": "^2.1.0" + } + }, "pm2": { "version": "4.4.1", "resolved": "https://registry.npmjs.org/pm2/-/pm2-4.4.1.tgz", @@ -1105,6 +2124,14 @@ "yamljs": "0.3.0" }, "dependencies": { + "@pm2/pm2-version-check": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/@pm2/pm2-version-check/-/pm2-version-check-1.0.3.tgz", + "integrity": "sha512-SBuYsh+o35knItbRW97vl5/5nEc5c5DYP7PxjyPLOfmm9bMaDsVeATXjXMBy6+KLlyrYWHZxGbfXe003NnHClg==", + "requires": { + "debug": "^4.1.1" + } + }, "async": { "version": "3.2.0", "resolved": "https://registry.npmjs.org/async/-/async-3.2.0.tgz", @@ -1181,6 +2208,12 @@ "resolved": "https://registry.npmjs.org/process-nextick-args/-/process-nextick-args-2.0.1.tgz", "integrity": "sha512-3ouUOpQhtgrbOa17J7+uxOTpITYWaGP7/AhoR3+A+/1e9skrzelGi/dXzEYyvbxubEF6Wn2ypscTKiKJFFn1ag==" }, + "progress": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/progress/-/progress-2.0.3.tgz", + "integrity": "sha512-7PiHtLll5LdnKIMw100I+8xJXR5gW2QwWYkT6iJva0bXitZKa/XMrSbdmg3r2Xnaidz9Qumd0VPaMrZlF9V9sA==", + "dev": true + }, "promptly": { "version": "2.2.0", "resolved": "https://registry.npmjs.org/promptly/-/promptly-2.2.0.tgz", @@ -1224,6 +2257,12 @@ "resolved": "https://registry.npmjs.org/ps-list/-/ps-list-6.3.0.tgz", "integrity": "sha512-qau0czUSB0fzSlBOQt0bo+I2v6R+xiQdj78e1BR/Qjfl5OHWJ/urXi8+ilw1eHe+5hSeDI1wrwVTgDp2wst4oA==" }, + "punycode": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/punycode/-/punycode-2.1.1.tgz", + "integrity": "sha512-XRsRjdf+j5ml+y/6GKHPZbrF/8p2Yga0JPtdqTIY2Xe5ohJPD9saDJJLPvp9+NSBprVvevdXZybnj2cv8OEd0A==", + "dev": true + }, "qs": { "version": "6.9.4", "resolved": "https://registry.npmjs.org/qs/-/qs-6.9.4.tgz", @@ -1240,14 +2279,6 @@ "unpipe": "1.0.0" } }, - "react-icons": { - "version": "3.11.0", - "resolved": "https://registry.npmjs.org/react-icons/-/react-icons-3.11.0.tgz", - "integrity": "sha512-JRgiI/vdF6uyBgyZhVyYJUZAop95Sy4XDe/jmT3R/bKliFWpO/uZBwvSjWEdxwzec7SYbEPNPck0Kff2tUGM2Q==", - "requires": { - "camelcase": "^5.0.0" - } - }, "read": { "version": "1.0.7", "resolved": "https://registry.npmjs.org/read/-/read-1.0.7.tgz", @@ -1256,6 +2287,27 @@ "mute-stream": "~0.0.4" } }, + "read-pkg": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/read-pkg/-/read-pkg-2.0.0.tgz", + "integrity": "sha1-jvHAYjxqbbDcZxPEv6xGMysjaPg=", + "dev": true, + "requires": { + "load-json-file": "^2.0.0", + "normalize-package-data": "^2.3.2", + "path-type": "^2.0.0" + } + }, + "read-pkg-up": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/read-pkg-up/-/read-pkg-up-2.0.0.tgz", + "integrity": "sha1-a3KoBImE4MQeeVEP1en6mbO1Sb4=", + "dev": true, + "requires": { + "find-up": "^2.0.0", + "read-pkg": "^2.0.0" + } + }, "readable-stream": { "version": "2.3.7", "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.7.tgz", @@ -1293,6 +2345,12 @@ "picomatch": "^2.2.1" } }, + "regexpp": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/regexpp/-/regexpp-3.1.0.tgz", + "integrity": "sha512-ZOIzd8yVsQQA7j8GCSlPGXwg5PfmA1mrq0JP4nGhh54LaKN3xdai/vHUDu74pKwV8OxseMS65u2NImosQcSD0Q==", + "dev": true + }, "require-in-the-middle": { "version": "5.0.3", "resolved": "https://registry.npmjs.org/require-in-the-middle/-/require-in-the-middle-5.0.3.tgz", @@ -1326,6 +2384,21 @@ "path-parse": "^1.0.6" } }, + "resolve-from": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/resolve-from/-/resolve-from-4.0.0.tgz", + "integrity": "sha512-pb/MYmXstAkysRFx8piNI1tGFNQIFA3vkE3Gq4EuA1dF6gHp/+vgZqsCGJapvy8N3Q+4o7FwvquPJcnZ7RYy4g==", + "dev": true + }, + "rimraf": { + "version": "2.6.3", + "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-2.6.3.tgz", + "integrity": "sha512-mwqeW5XsA2qAejG46gYdENaxXjx9onRNCfn7L0duuP4hCuTIi/QO7PDK07KJfp1d+izWPrzEJDcSqBa0OZQriA==", + "dev": true, + "requires": { + "glob": "^7.1.3" + } + }, "run-series": { "version": "1.1.8", "resolved": "https://registry.npmjs.org/run-series/-/run-series-1.1.8.tgz", @@ -1361,6 +2434,21 @@ "resolved": "https://registry.npmjs.org/setprototypeof/-/setprototypeof-1.1.1.tgz", "integrity": "sha512-JvdAWfbXeIGaZ9cILp38HntZSFSo3mWg6xGcJJsd+d4aRMOqauag1C63dJfDw7OaMYwEbHMOxEZ1lqVRYP2OAw==" }, + "shebang-command": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/shebang-command/-/shebang-command-2.0.0.tgz", + "integrity": "sha512-kHxr2zZpYtdmrN1qDjrrX/Z1rR1kG8Dx+gkpK1G4eXmvXswmcE1hTWBWYUzlraYw1/yZp6YuDY77YtvbN0dmDA==", + "dev": true, + "requires": { + "shebang-regex": "^3.0.0" + } + }, + "shebang-regex": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/shebang-regex/-/shebang-regex-3.0.0.tgz", + "integrity": "sha512-7++dFhtcx3353uBaq8DDR4NuxBetBzC7ZQOhmTQInHEd6bSrXdiEyzCvG07Z44UYdLShWUyXt5M/yhz8ekcb1A==", + "dev": true + }, "shimmer": { "version": "1.2.1", "resolved": "https://registry.npmjs.org/shimmer/-/shimmer-1.2.1.tgz", @@ -1371,6 +2459,43 @@ "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-3.0.3.tgz", "integrity": "sha512-VUJ49FC8U1OxwZLxIbTTrDvLnf/6TDgxZcK8wxR8zs13xpx7xbG60ndBlhNrFi2EMuFRoeDoJO7wthSLq42EjA==" }, + "slice-ansi": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/slice-ansi/-/slice-ansi-2.1.0.tgz", + "integrity": "sha512-Qu+VC3EwYLldKa1fCxuuvULvSJOKEgk9pi8dZeCVK7TqBfUNTH4sFkk4joj8afVSfAYgJoSOetjx9QWOJ5mYoQ==", + "dev": true, + "requires": { + "ansi-styles": "^3.2.0", + "astral-regex": "^1.0.0", + "is-fullwidth-code-point": "^2.0.0" + }, + "dependencies": { + "ansi-styles": { + "version": "3.2.1", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", + "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", + "dev": true, + "requires": { + "color-convert": "^1.9.0" + } + }, + "color-convert": { + "version": "1.9.3", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-1.9.3.tgz", + "integrity": "sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg==", + "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 + } + } + }, "smart-buffer": { "version": "4.1.0", "resolved": "https://registry.npmjs.org/smart-buffer/-/smart-buffer-4.1.0.tgz", @@ -1418,6 +2543,38 @@ "source-map": "^0.6.0" } }, + "spdx-correct": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/spdx-correct/-/spdx-correct-3.1.1.tgz", + "integrity": "sha512-cOYcUWwhCuHCXi49RhFRCyJEK3iPj1Ziz9DpViV3tbZOwXD49QzIN3MpOLJNxh2qwq2lJJZaKMVw9qNi4jTC0w==", + "dev": true, + "requires": { + "spdx-expression-parse": "^3.0.0", + "spdx-license-ids": "^3.0.0" + } + }, + "spdx-exceptions": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/spdx-exceptions/-/spdx-exceptions-2.3.0.tgz", + "integrity": "sha512-/tTrYOC7PPI1nUAgx34hUpqXuyJG+DTHJTnIULG4rDygi4xu/tfgmq1e1cIRwRzwZgo4NLySi+ricLkZkw4i5A==", + "dev": true + }, + "spdx-expression-parse": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/spdx-expression-parse/-/spdx-expression-parse-3.0.1.tgz", + "integrity": "sha512-cbqHunsQWnJNE6KhVSMsMeH5H/L9EpymbzqTQ3uLwNCLZ1Q481oWaofqH7nO6V07xlXwY6PhQdQ2IedWx/ZK4Q==", + "dev": true, + "requires": { + "spdx-exceptions": "^2.1.0", + "spdx-license-ids": "^3.0.0" + } + }, + "spdx-license-ids": { + "version": "3.0.6", + "resolved": "https://registry.npmjs.org/spdx-license-ids/-/spdx-license-ids-3.0.6.tgz", + "integrity": "sha512-+orQK83kyMva3WyPf59k1+Y525csj5JejicWut55zeTWANuN17qSiSLUXWtzHeNWORSvT7GLDJ/E/XiIWoXBTw==", + "dev": true + }, "sprintf-js": { "version": "1.1.2", "resolved": "https://registry.npmjs.org/sprintf-js/-/sprintf-js-1.1.2.tgz", @@ -1428,11 +2585,122 @@ "resolved": "https://registry.npmjs.org/statuses/-/statuses-1.5.0.tgz", "integrity": "sha1-Fhx9rBd2Wf2YEfQ3cfqZOBR4Yow=" }, + "string-width": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-3.1.0.tgz", + "integrity": "sha512-vafcv6KjVZKSgz06oM/H6GDBrAtz8vdhQakGjFIvNrHA6y3HCF1CInLy+QLq8dTJPQ1b+KDUqDFctkdRW44e1w==", + "dev": true, + "requires": { + "emoji-regex": "^7.0.1", + "is-fullwidth-code-point": "^2.0.0", + "strip-ansi": "^5.1.0" + }, + "dependencies": { + "ansi-regex": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-4.1.0.tgz", + "integrity": "sha512-1apePfXM1UOSqw0o9IiFAovVz9M5S1Dg+4TrDwfMewQ6p/rmMueb7tWZjQ1rx4Loy1ArBggoqGpfqqdI4rondg==", + "dev": true + }, + "strip-ansi": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-5.2.0.tgz", + "integrity": "sha512-DuRs1gKbBqsMKIZlrffwlug8MHkcnpjs5VPmL1PAh+mA30U0DTotfDZ0d2UUsXpPmPmMMJ6W773MaA3J+lbiWA==", + "dev": true, + "requires": { + "ansi-regex": "^4.1.0" + } + } + } + }, + "string.prototype.trimend": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/string.prototype.trimend/-/string.prototype.trimend-1.0.1.tgz", + "integrity": "sha512-LRPxFUaTtpqYsTeNKaFOw3R4bxIzWOnbQ837QfBylo8jIxtcbK/A/sMV7Q+OAV/vWo+7s25pOE10KYSjaSO06g==", + "dev": true, + "requires": { + "define-properties": "^1.1.3", + "es-abstract": "^1.17.5" + }, + "dependencies": { + "es-abstract": { + "version": "1.17.6", + "resolved": "https://registry.npmjs.org/es-abstract/-/es-abstract-1.17.6.tgz", + "integrity": "sha512-Fr89bON3WFyUi5EvAeI48QTWX0AyekGgLA8H+c+7fbfCkJwRWRMLd8CQedNEyJuoYYhmtEqY92pgte1FAhBlhw==", + "dev": true, + "requires": { + "es-to-primitive": "^1.2.1", + "function-bind": "^1.1.1", + "has": "^1.0.3", + "has-symbols": "^1.0.1", + "is-callable": "^1.2.0", + "is-regex": "^1.1.0", + "object-inspect": "^1.7.0", + "object-keys": "^1.1.1", + "object.assign": "^4.1.0", + "string.prototype.trimend": "^1.0.1", + "string.prototype.trimstart": "^1.0.1" + } + } + } + }, + "string.prototype.trimstart": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/string.prototype.trimstart/-/string.prototype.trimstart-1.0.1.tgz", + "integrity": "sha512-XxZn+QpvrBI1FOcg6dIpxUPgWCPuNXvMD72aaRaUQv1eD4e/Qy8i/hFTe0BUmD60p/QA6bh1avmuPTfNjqVWRw==", + "dev": true, + "requires": { + "define-properties": "^1.1.3", + "es-abstract": "^1.17.5" + }, + "dependencies": { + "es-abstract": { + "version": "1.17.6", + "resolved": "https://registry.npmjs.org/es-abstract/-/es-abstract-1.17.6.tgz", + "integrity": "sha512-Fr89bON3WFyUi5EvAeI48QTWX0AyekGgLA8H+c+7fbfCkJwRWRMLd8CQedNEyJuoYYhmtEqY92pgte1FAhBlhw==", + "dev": true, + "requires": { + "es-to-primitive": "^1.2.1", + "function-bind": "^1.1.1", + "has": "^1.0.3", + "has-symbols": "^1.0.1", + "is-callable": "^1.2.0", + "is-regex": "^1.1.0", + "object-inspect": "^1.7.0", + "object-keys": "^1.1.1", + "object.assign": "^4.1.0", + "string.prototype.trimend": "^1.0.1", + "string.prototype.trimstart": "^1.0.1" + } + } + } + }, "string_decoder": { "version": "0.10.31", "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-0.10.31.tgz", "integrity": "sha1-YuIDvEF2bGwoyfyEMB2rHFMQ+pQ=" }, + "strip-ansi": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.0.tgz", + "integrity": "sha512-AuvKTrTfQNYNIctbR1K/YGTR1756GycPsg7b9bdV9Duqur4gv6aKqHXah67Z8ImS7WEz5QVcOtlfW2rZEugt6w==", + "dev": true, + "requires": { + "ansi-regex": "^5.0.0" + } + }, + "strip-bom": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/strip-bom/-/strip-bom-3.0.0.tgz", + "integrity": "sha1-IzTBjpx1n3vdVv3vfprj1YjmjtM=", + "dev": true + }, + "strip-json-comments": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-3.1.1.tgz", + "integrity": "sha512-6fPc+R4ihwqP6N/aIv2f1gMH8lOVtWQHoqC4yK6oSDVVocumAsfCqjkXnqiYMhmMwS/mEHLp7Vehlt3ql6lEig==", + "dev": true + }, "supports-color": { "version": "7.2.0", "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", @@ -1447,6 +2715,24 @@ "integrity": "sha512-0Nc8AYEK818h7FI+bbe/kj7xXsMD5zOHvO9alUqQH/G4MHXu5tHQfWqC/bzWOk4JtoQPhnyLgxMYncDA2eeSBw==", "optional": true }, + "table": { + "version": "5.4.6", + "resolved": "https://registry.npmjs.org/table/-/table-5.4.6.tgz", + "integrity": "sha512-wmEc8m4fjnob4gt5riFRtTu/6+4rSe12TpAELNSqHMfF3IqnA+CH37USM6/YR3qRZv7e56kAEAtd6nKZaxe0Ug==", + "dev": true, + "requires": { + "ajv": "^6.10.2", + "lodash": "^4.17.14", + "slice-ansi": "^2.1.0", + "string-width": "^3.0.0" + } + }, + "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 + }, "thunkify": { "version": "2.1.2", "resolved": "https://registry.npmjs.org/thunkify/-/thunkify-2.1.2.tgz", @@ -1465,6 +2751,18 @@ "resolved": "https://registry.npmjs.org/toidentifier/-/toidentifier-1.0.0.tgz", "integrity": "sha512-yaOH/Pk/VEhBWWTlhI+qXxDFXlejDGcQipMlyxda9nthulaxLZUNcUqFxokp0vcYnvteJln5FNQDRrxj3YcbVw==" }, + "tsconfig-paths": { + "version": "3.9.0", + "resolved": "https://registry.npmjs.org/tsconfig-paths/-/tsconfig-paths-3.9.0.tgz", + "integrity": "sha512-dRcuzokWhajtZWkQsDVKbWyY+jgcLC5sqJhg2PSgf4ZkH2aHPvaOY8YWGhmjb68b5qqTfasSsDO9k7RUiEmZAw==", + "dev": true, + "requires": { + "@types/json5": "^0.0.29", + "json5": "^1.0.1", + "minimist": "^1.2.0", + "strip-bom": "^3.0.0" + } + }, "tslib": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.0.1.tgz", @@ -1483,6 +2781,12 @@ "prelude-ls": "~1.1.2" } }, + "type-fest": { + "version": "0.8.1", + "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.8.1.tgz", + "integrity": "sha512-4dbzIzqvjtgiM5rw1k5rEHtBANKmdudhGyBEajN01fEyhaAIhsoKNy6y7+IN93IfpFtwY9iqi7kD+xwKhQsNJA==", + "dev": true + }, "union": { "version": "0.5.0", "resolved": "https://registry.npmjs.org/union/-/union-0.5.0.tgz", @@ -1496,6 +2800,15 @@ "resolved": "https://registry.npmjs.org/unpipe/-/unpipe-1.0.0.tgz", "integrity": "sha1-sr9O6FFKrmFltIF4KdIbLvSZBOw=" }, + "uri-js": { + "version": "4.4.0", + "resolved": "https://registry.npmjs.org/uri-js/-/uri-js-4.4.0.tgz", + "integrity": "sha512-B0yRTzYdUCCn9n+F4+Gh4yIDtMQcaJsmYBDsTSG8g/OejKBodLQ2IHfN3bM7jUsRXndopT7OIXWdYqc1fjmV6g==", + "dev": true, + "requires": { + "punycode": "^2.1.0" + } + }, "url-join": { "version": "2.0.5", "resolved": "https://registry.npmjs.org/url-join/-/url-join-2.0.5.tgz", @@ -1511,6 +2824,22 @@ "resolved": "https://registry.npmjs.org/uuid/-/uuid-3.4.0.tgz", "integrity": "sha512-HjSDRw6gZE5JMggctHBcjVak08+KEVhSIiDzFnT9S9aegmp85S/bReBVTb4QTFaRNptJ9kuYaNhnbNEOkbKb/A==" }, + "v8-compile-cache": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/v8-compile-cache/-/v8-compile-cache-2.1.1.tgz", + "integrity": "sha512-8OQ9CL+VWyt3JStj7HX7/ciTL2V3Rl1Wf5OL+SNTm0yK1KvtReVulksyeRnCANHHuUxHlQig+JJDlUhBt1NQDQ==", + "dev": true + }, + "validate-npm-package-license": { + "version": "3.0.4", + "resolved": "https://registry.npmjs.org/validate-npm-package-license/-/validate-npm-package-license-3.0.4.tgz", + "integrity": "sha512-DpKm2Ui/xN7/HQKCtpZxoRWBhZ9Z0kqtygG8XCgNQ8ZlDnxuQmWhj566j8fN4Cu3/JmbhsDo7fcAJq4s9h27Ew==", + "dev": true, + "requires": { + "spdx-correct": "^3.0.0", + "spdx-expression-parse": "^3.0.0" + } + }, "vizion": { "version": "0.2.13", "resolved": "https://registry.npmjs.org/vizion/-/vizion-0.2.13.tgz", @@ -1526,6 +2855,15 @@ } } }, + "which": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/which/-/which-2.0.2.tgz", + "integrity": "sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA==", + "dev": true, + "requires": { + "isexe": "^2.0.0" + } + }, "word-wrap": { "version": "1.2.3", "resolved": "https://registry.npmjs.org/word-wrap/-/word-wrap-1.2.3.tgz", @@ -1536,6 +2874,15 @@ "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz", "integrity": "sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8=" }, + "write": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/write/-/write-1.0.3.tgz", + "integrity": "sha512-/lg70HAjtkUgWPVZhZcm+T4hkL8Zbtp1nFNOn3lRrxnlv50SRBv7cR7RqR+GMsd3hUXy9hWBo4CHTbFTcOYwig==", + "dev": true, + "requires": { + "mkdirp": "^0.5.1" + } + }, "ws": { "version": "7.2.5", "resolved": "https://registry.npmjs.org/ws/-/ws-7.2.5.tgz", diff --git a/package.json b/package.json index 0fa83fe..6be4671 100644 --- a/package.json +++ b/package.json @@ -18,14 +18,20 @@ "clear": "pm2 flush", "status": "pm2 list", "refresh": "pm2 flush && pm2 stop pm2.config.js && pm2 delete pm2.config.js", - "postinstall": "cd ./server && npm install && npm run config" + "postinstall": "cd ./server && npm install && npm run config", + "lint": "eslint --ignore-path .gitignore -- ./server ", + "lint:fix": "eslint --ignore-path .gitignore --fix -- ./server " }, "author": "Marzavec", "license": "WTFPL", "dependencies": { "esm": "^3.2.25", "http-server": "^0.12.3", - "pm2": "^4.4.1", - "react-icons": "^3.11.0" + "pm2": "^4.4.1" + }, + "devDependencies": { + "eslint": "^7.9.0", + "eslint-config-airbnb-base": "^14.2.0", + "eslint-plugin-import": "^2.22.0" } } diff --git a/server/main.js b/server/main.js index b01d09d..55b116b 100644 --- a/server/main.js +++ b/server/main.js @@ -6,7 +6,7 @@ */ // import and initialize the core application -import { CoreApp } from './src/serverLib/CoreApp'; +import CoreApp from './src/serverLib/CoreApp'; const coreApp = new CoreApp(); coreApp.init(); diff --git a/server/src/commands/admin/addmod.js b/server/src/commands/admin/addmod.js index 8f934ce..db645fe 100644 --- a/server/src/commands/admin/addmod.js +++ b/server/src/commands/admin/addmod.js @@ -5,17 +5,19 @@ import * as UAC from '../utility/UAC/_info'; // module main -export async function run(core, server, socket, data) { +export async function run({ + core, server, socket, payload, +}) { // increase rate limit chance and ignore if not admin if (!UAC.isAdmin(socket.level)) { return server.police.frisk(socket.address, 20); } // add new trip to config - core.config.mods.push({ trip: data.trip }); + core.config.mods.push({ trip: payload.trip }); // find targets current connections - const newMod = server.findSockets({ trip: data.trip }); + const newMod = server.findSockets({ trip: payload.trip }); if (newMod.length !== 0) { for (let i = 0, l = newMod.length; i < l; i += 1) { // upgrade privilages @@ -33,13 +35,13 @@ export async function run(core, server, socket, data) { // return success message server.reply({ cmd: 'info', - text: `Added mod trip: ${data.trip}, remember to run 'saveconfig' to make it permanent`, + text: `Added mod trip: ${payload.trip}, remember to run 'saveconfig' to make it permanent`, }, socket); // notify all mods server.broadcast({ cmd: 'info', - text: `Added mod: ${data.trip}`, + text: `Added mod: ${payload.trip}`, }, { level: UAC.isModerator }); return true; diff --git a/server/src/commands/admin/listusers.js b/server/src/commands/admin/listusers.js index 54c93dc..b7f8d7c 100644 --- a/server/src/commands/admin/listusers.js +++ b/server/src/commands/admin/listusers.js @@ -1,3 +1,7 @@ +/* eslint no-unused-vars: 0 */ +/* eslint no-restricted-syntax: 0 */ +/* eslint guard-for-in: 0 */ + /* Description: Outputs all current channels and their user nicks */ @@ -5,7 +9,7 @@ import * as UAC from '../utility/UAC/_info'; // module main -export async function run(core, server, socket) { +export async function run({ server, socket }) { // increase rate limit chance and ignore if not admin if (!UAC.isAdmin(socket.level)) { return server.police.frisk(socket.address, 20); diff --git a/server/src/commands/admin/reload.js b/server/src/commands/admin/reload.js index a1d22ac..e39fe6f 100644 --- a/server/src/commands/admin/reload.js +++ b/server/src/commands/admin/reload.js @@ -5,7 +5,9 @@ import * as UAC from '../utility/UAC/_info'; // module main -export async function run(core, server, socket, data) { +export async function run({ + core, server, socket, payload, +}) { // increase rate limit chance and ignore if not admin if (!UAC.isAdmin(socket.level)) { return server.police.frisk(socket.address, 20); @@ -26,8 +28,8 @@ export async function run(core, server, socket, data) { ${loadResult}`; } - if (typeof data.reason !== 'undefined') { - loadResult += `\nReason: ${data.reason}`; + if (typeof payload.reason !== 'undefined') { + loadResult += `\nReason: ${payload.reason}`; } // send results to moderators (which the user using this command is higher than) diff --git a/server/src/commands/admin/removemod.js b/server/src/commands/admin/removemod.js index f76ff13..1fff3b0 100644 --- a/server/src/commands/admin/removemod.js +++ b/server/src/commands/admin/removemod.js @@ -5,17 +5,20 @@ import * as UAC from '../utility/UAC/_info'; // module main -export async function run(core, server, socket, data) { +export async function run({ + core, server, socket, payload, +}) { // increase rate limit chance and ignore if not admin if (!UAC.isAdmin(socket.level)) { return server.police.frisk(socket.address, 20); } // remove trip from config - core.config.mods = core.config.mods.filter((mod) => mod.trip !== data.trip); + // eslint-disable-next-line no-param-reassign + core.config.mods = core.config.mods.filter((mod) => mod.trip !== payload.trip); // find targets current connections - const targetMod = server.findSockets({ trip: data.trip }); + const targetMod = server.findSockets({ trip: payload.trip }); if (targetMod.length !== 0) { for (let i = 0, l = targetMod.length; i < l; i += 1) { // downgrade privilages @@ -34,14 +37,14 @@ export async function run(core, server, socket, data) { server.reply({ cmd: 'info', text: `Removed mod trip: ${ - data.trip + payload.trip }, remember to run 'saveconfig' to make it permanent`, }, socket); // notify all mods server.broadcast({ cmd: 'info', - text: `Removed mod: ${data.trip}`, + text: `Removed mod: ${payload.trip}`, }, { level: UAC.isModerator }); return true; diff --git a/server/src/commands/admin/saveconfig.js b/server/src/commands/admin/saveconfig.js index 9031a11..f13bdee 100644 --- a/server/src/commands/admin/saveconfig.js +++ b/server/src/commands/admin/saveconfig.js @@ -5,7 +5,7 @@ import * as UAC from '../utility/UAC/_info'; // module main -export async function run(core, server, socket) { +export async function run({ core, server, socket }) { // increase rate limit chance and ignore if not admin if (!UAC.isAdmin(socket.level)) { return server.police.frisk(socket.address, 20); diff --git a/server/src/commands/admin/shout.js b/server/src/commands/admin/shout.js index 65695b3..27002fc 100644 --- a/server/src/commands/admin/shout.js +++ b/server/src/commands/admin/shout.js @@ -5,7 +5,7 @@ import * as UAC from '../utility/UAC/_info'; // module main -export async function run(core, server, socket, data) { +export async function run({ server, socket, payload }) { // increase rate limit chance and ignore if not admin if (!UAC.isAdmin(socket.level)) { return server.police.frisk(socket.address, 20); @@ -14,7 +14,7 @@ export async function run(core, server, socket, data) { // send text to all channels server.broadcast({ cmd: 'info', - text: `Server Notice: ${data.text}`, + text: `Server Notice: ${payload.text}`, }, {}); return true; diff --git a/server/src/commands/core/changenick.js b/server/src/commands/core/changenick.js index 9776024..a081a1e 100644 --- a/server/src/commands/core/changenick.js +++ b/server/src/commands/core/changenick.js @@ -1,3 +1,5 @@ +/* eslint eqeqeq: 0 */ + /* Description: Allows calling client to change their current nickname */ @@ -5,7 +7,9 @@ import * as UAC from '../utility/UAC/_info'; // module main -export async function run(core, server, socket, data) { +export async function run({ + core, server, socket, payload, +}) { if (server.police.frisk(socket.address, 6)) { return server.reply({ cmd: 'warn', // @todo Remove english and change to numeric id @@ -14,14 +18,14 @@ export async function run(core, server, socket, data) { } // verify user data is string - if (typeof data.nick !== 'string') { + if (typeof payload.nick !== 'string') { return true; } const previousNick = socket.nick; // make sure requested nickname meets standards - const newNick = data.nick.trim(); + const newNick = payload.nick.trim(); if (!UAC.verifyNickname(newNick)) { return server.reply({ cmd: 'warn', // @todo Remove english and change to numeric id @@ -30,7 +34,7 @@ export async function run(core, server, socket, data) { } // prevent admin impersonation - // TODO: prevent mod impersonation + // @todo prevent mod impersonation if (newNick.toLowerCase() === core.config.adminName.toLowerCase()) { server.police.frisk(socket.address, 4); @@ -50,9 +54,9 @@ export async function run(core, server, socket, data) { // find any sockets that have the same nickname const userExists = server.findSockets({ channel: socket.channel, - nick: (targetNick) => targetNick.toLowerCase() === newNick.toLowerCase() && + nick: (targetNick) => targetNick.toLowerCase() === newNick.toLowerCase() // Allow them to rename themselves to a different case - targetNick != previousNick, + && targetNick != previousNick, }); // return error if found @@ -65,7 +69,7 @@ export async function run(core, server, socket, data) { } // build join and leave notices - // TODO: this is a legacy client holdover, name changes in the future will + // @todo this is a legacy client holdover, name changes in the future will // have thieir own event const leaveNotice = { cmd: 'onlineRemove', @@ -90,7 +94,7 @@ export async function run(core, server, socket, data) { }, { channel: socket.channel }); // commit change to nickname - socket.nick = newNick; + socket.nick = newNick; // eslint-disable-line no-param-reassign return true; } @@ -101,7 +105,9 @@ export function initHooks(server) { } // hooks chat commands checking for /nick -export function nickCheck(core, server, socket, payload) { +export function nickCheck({ + core, server, socket, payload, +}) { if (typeof payload.text !== 'string') { return false; } @@ -121,9 +127,14 @@ export function nickCheck(core, server, socket, payload) { const newNick = input[1].replace(/@/g, ''); - this.run(core, server, socket, { - cmd: 'changenick', - nick: newNick, + this.run({ + core, + server, + socket, + payload: { + cmd: 'changenick', + nick: newNick, + }, }); return false; diff --git a/server/src/commands/core/chat.js b/server/src/commands/core/chat.js index 71dbbad..2c3d6e3 100644 --- a/server/src/commands/core/chat.js +++ b/server/src/commands/core/chat.js @@ -22,9 +22,11 @@ const parseText = (text) => { }; // module main -export async function run(core, server, socket, data) { +export async function run({ + core, server, socket, payload, +}) { // check user input - const text = parseText(data.text); + const text = parseText(payload.text); if (!text) { // lets not send objects or empty text, yea? @@ -41,7 +43,7 @@ export async function run(core, server, socket, data) { } // build chat payload - const payload = { + const outgoingPayload = { cmd: 'chat', nick: socket.nick, /* @legacy */ userid: socket.userid, @@ -51,17 +53,17 @@ export async function run(core, server, socket, data) { }; if (UAC.isAdmin(socket.level)) { - payload.admin = true; + outgoingPayload.admin = true; } else if (UAC.isModerator(socket.level)) { - payload.mod = true; + outgoingPayload.mod = true; } if (socket.trip) { - payload.trip = socket.trip; /* @legacy */ + outgoingPayload.trip = socket.trip; /* @legacy */ } // broadcast to channel peers - server.broadcast(payload, { channel: socket.channel }); + server.broadcast(outgoingPayload, { channel: socket.channel }); // stats are fun core.stats.increment('messages-sent'); @@ -76,7 +78,7 @@ export function initHooks(server) { } // checks for miscellaneous '/' based commands -export function commandCheckIn(core, server, socket, payload) { +export function commandCheckIn({ server, socket, payload }) { if (typeof payload.text !== 'string') { return false; } @@ -93,7 +95,7 @@ export function commandCheckIn(core, server, socket, payload) { return payload; } -export function finalCmdCheck(core, server, socket, payload) { +export function finalCmdCheck({ server, socket, payload }) { if (typeof payload.text !== 'string') { return false; } @@ -103,7 +105,7 @@ export function finalCmdCheck(core, server, socket, payload) { } if (payload.text.startsWith('//')) { - payload.text = payload.text.substr(1); + payload.text = payload.text.substr(1); // eslint-disable-line no-param-reassign return payload; } diff --git a/server/src/commands/core/emote.js b/server/src/commands/core/emote.js index 17f2512..b21d7b6 100644 --- a/server/src/commands/core/emote.js +++ b/server/src/commands/core/emote.js @@ -20,7 +20,7 @@ const parseText = (text) => { }; // module main -export async function run(core, server, socket, payload) { +export async function run({ server, socket, payload }) { // check user input let text = parseText(payload.text); @@ -65,7 +65,9 @@ export function initHooks(server) { } // hooks chat commands checking for /me -export function emoteCheck(core, server, socket, payload) { +export function emoteCheck({ + core, server, socket, payload, +}) { if (typeof payload.text !== 'string') { return false; } @@ -86,9 +88,14 @@ export function emoteCheck(core, server, socket, payload) { input.splice(0, 1); const actionText = input.join(' '); - this.run(core, server, socket, { - cmd: 'emote', - text: actionText, + this.run({ + core, + server, + socket, + payload: { + cmd: 'emote', + text: actionText, + }, }); return false; diff --git a/server/src/commands/core/help.js b/server/src/commands/core/help.js index bc861bc..56069c5 100644 --- a/server/src/commands/core/help.js +++ b/server/src/commands/core/help.js @@ -3,7 +3,9 @@ */ // module main -export async function run(core, server, socket, payload) { +export async function run({ + core, server, socket, payload, +}) { // check for spam if (server.police.frisk(socket.address, 2)) { return server.reply({ @@ -24,7 +26,9 @@ export async function run(core, server, socket, payload) { const categories = core.commands.categoriesList.sort(); for (let i = 0, j = categories.length; i < j; i += 1) { reply += `|${categories[i].replace('../src/commands/', '').replace(/^\w/, (c) => c.toUpperCase())}:|`; - const catCommands = core.commands.all(categories[i]).sort((a, b) => a.info.name.localeCompare(b.info.name)); + const catCommands = core.commands.all(categories[i]).sort( + (a, b) => a.info.name.localeCompare(b.info.name), + ); reply += `${catCommands.map((c) => `${c.info.name}`).join(', ')}|\n`; } @@ -40,6 +44,7 @@ export async function run(core, server, socket, payload) { reply += `|**Aliases:**|${typeof command.info.aliases !== 'undefined' ? command.info.aliases.join(', ') : 'None'}|\n`; reply += `|**Category:**|${command.info.category.replace('../src/commands/', '').replace(/^\w/, (c) => c.toUpperCase())}|\n`; reply += `|**Required Parameters:**|${command.requiredData || 'None'}|\n`; + // eslint-disable-next-line no-useless-escape reply += `|**Description:**|${command.info.description || '¯\_(ツ)_/¯'}|\n\n`; reply += `**Usage:** ${command.info.usage || command.info.name}`; } @@ -60,7 +65,9 @@ export function initHooks(server) { } // hooks chat commands checking for /whisper -export function helpCheck(core, server, socket, payload) { +export function helpCheck({ + core, server, socket, payload, +}) { if (typeof payload.text !== 'string') { return false; } @@ -68,9 +75,14 @@ export function helpCheck(core, server, socket, payload) { if (payload.text.startsWith('/help')) { const input = payload.text.substr(1).split(' ', 2); - this.run(core, server, socket, { - cmd: input[0], - command: input[1], + this.run({ + core, + server, + socket, + payload: { + cmd: input[0], + command: input[1], + }, }); return false; diff --git a/server/src/commands/core/invite.js b/server/src/commands/core/invite.js index 2f86d9a..7136892 100644 --- a/server/src/commands/core/invite.js +++ b/server/src/commands/core/invite.js @@ -8,16 +8,17 @@ * @param {any} channel * @return {string} */ -export function getChannel (channel=undefined) { +export function getChannel(channel = undefined) { if (typeof channel === 'string') { return channel; - } else { - return Math.random().toString(36).substr(2, 8); } + return Math.random().toString(36).substr(2, 8); } // module main -export async function run(core, server, socket, data) { +export async function run({ + core, server, socket, payload, +}) { // check for spam if (server.police.frisk(socket.address, 2)) { return server.reply({ @@ -27,18 +28,18 @@ export async function run(core, server, socket, data) { } // verify user input - if (typeof data.userid !== 'number' || typeof data.channel !== 'string') { + if (typeof payload.userid !== 'number' || typeof payload.channel !== 'string') { return true; } // why would you invite yourself? - if (data.userid === socket.userid) { + if (payload.userid === socket.userid) { return true; } - // @todo Verify this socket is part of data.channel - multichannel patch + // @todo Verify this socket is part of payload.channel - multichannel patch // find target user - let targetClient = server.findSockets({ channel: data.channel, userid: data.userid }); + let targetClient = server.findSockets({ channel: payload.channel, userid: payload.userid }); if (targetClient.length === 0) { return server.reply({ @@ -50,22 +51,22 @@ export async function run(core, server, socket, data) { [targetClient] = targetClient; // generate common channel - const channel = getChannel(data.to); + const channel = getChannel(payload.to); // build invite - const payload = { + const outgoingPayload = { cmd: 'invite', channel: socket.channel, from: socket.userid, - to: data.userid, + to: payload.userid, inviteChannel: channel, }; // send invite notice to target client - server.reply(payload, targetClient); + server.reply(outgoingPayload, targetClient); // send invite notice to this client - server.reply(payload, socket); + server.reply(outgoingPayload, socket); // stats are fun core.stats.increment('invites-sent'); @@ -73,7 +74,7 @@ export async function run(core, server, socket, data) { return true; } -export const requiredData = [];//['nick']; +export const requiredData = []; // ['nick']; export const info = { name: 'invite', description: 'Sends an invite to the target client with the provided channel, or a random channel.', diff --git a/server/src/commands/core/join.js b/server/src/commands/core/join.js index bf789c1..3ee6722 100644 --- a/server/src/commands/core/join.js +++ b/server/src/commands/core/join.js @@ -1,3 +1,5 @@ +/* eslint no-param-reassign: 0 */ + /* Description: Initial entry point, applies `channel` and `nick` to the calling socket */ @@ -29,7 +31,7 @@ export function parseNickname(core, data) { return 'Nickname must consist of up to 24 letters, numbers, and underscores'; } - let password = data.pass || false; + const password = data.pass || false; if (hash(password + core.config.tripSalt) === core.config.adminTrip) { userInfo.uType = 'admin'; /* @legacy */ @@ -43,7 +45,7 @@ export function parseNickname(core, data) { userInfo.trip = hash(password + core.config.tripSalt); } - // TODO: disallow moderator impersonation + // @todo disallow moderator impersonation // for (const mod of core.config.mods) { core.config.mods.forEach((mod) => { if (userInfo.trip === mod.trip) { @@ -56,7 +58,9 @@ export function parseNickname(core, data) { } // module main -export async function run(core, server, socket, data) { +export async function run({ + core, server, socket, payload, +}) { // check for spam if (server.police.frisk(socket.address, 3)) { return server.reply({ @@ -75,17 +79,17 @@ export async function run(core, server, socket, data) { } // check user input - if (typeof data.channel !== 'string' || typeof data.nick !== 'string') { + if (typeof payload.channel !== 'string' || typeof payload.nick !== 'string') { return true; } - const channel = data.channel.trim(); + const channel = payload.channel.trim(); if (!channel) { // must join a non-blank channel return true; } - const userInfo = this.parseNickname(core, data); + const userInfo = this.parseNickname(core, payload); if (typeof userInfo === 'string') { return server.reply({ cmd: 'warn', // @todo Remove english and change to numeric id @@ -95,7 +99,7 @@ export async function run(core, server, socket, data) { // check if the nickname already exists in the channel const userExists = server.findSockets({ - channel: data.channel, + channel: payload.channel, nick: (targetNick) => targetNick.toLowerCase() === userInfo.nick.toLowerCase(), }); @@ -108,13 +112,13 @@ export async function run(core, server, socket, data) { } // populate final userinfo fields - // @TODO: this could be move into parseNickname, changing the function name to match + // @todo this could be move into parseNickname, changing the function name to match userInfo.hash = server.getSocketHash(socket); userInfo.userid = socket.userid; - // @TODO: place this within it's own function allowing import + // @todo place this within it's own function allowing import // prepare to notify channel peers - const newPeerList = server.findSockets({ channel: data.channel }); + const newPeerList = server.findSockets({ channel: payload.channel }); const nicks = []; /* @legacy */ const users = []; @@ -126,7 +130,7 @@ export async function run(core, server, socket, data) { hash: userInfo.hash, level: userInfo.level, userid: userInfo.userid, - channel: data.channel, + channel: payload.channel, }; // send join announcement and prep online set @@ -141,7 +145,7 @@ export async function run(core, server, socket, data) { hash: newPeerList[i].hash, level: newPeerList[i].level, userid: newPeerList[i].userid, - channel: data.channel, + channel: payload.channel, isme: false, }); } @@ -150,7 +154,7 @@ export async function run(core, server, socket, data) { socket.uType = userInfo.uType; /* @legacy */ socket.nick = userInfo.nick; socket.trip = userInfo.trip; - socket.channel = data.channel; /* @legacy */ + socket.channel = payload.channel; /* @legacy */ socket.hash = userInfo.hash; socket.level = userInfo.level; @@ -162,7 +166,7 @@ export async function run(core, server, socket, data) { hash: socket.hash, level: socket.level, userid: socket.userid, - channel: data.channel, + channel: payload.channel, isme: true, }); @@ -179,7 +183,7 @@ export async function run(core, server, socket, data) { return true; } -export const requiredData = ['channel', 'nick']; +export const requiredData = []; // ['channel', 'nick']; export const info = { name: 'join', description: 'Place calling socket into target channel with target nick & broadcast event to channel', diff --git a/server/src/commands/core/morestats.js b/server/src/commands/core/morestats.js index 3b5ceb2..e84a309 100644 --- a/server/src/commands/core/morestats.js +++ b/server/src/commands/core/morestats.js @@ -21,7 +21,7 @@ const formatTime = (time) => { }; // module main -export async function run(core, server, socket) { +export async function run({ core, server, socket }) { // gather connection and channel count let ips = {}; let channels = {}; @@ -63,14 +63,21 @@ export function initHooks(server) { } // hooks chat commands checking for /stats -export function statsCheck(core, server, socket, payload) { +export function statsCheck({ + core, server, socket, payload, +}) { if (typeof payload.text !== 'string') { return false; } if (payload.text.startsWith('/stats')) { - this.run(core, server, socket, { - cmd: 'morestats', + this.run({ + core, + server, + socket, + payload: { + cmd: 'morestats', + }, }); return false; diff --git a/server/src/commands/core/move.js b/server/src/commands/core/move.js index 49f3946..e27445c 100644 --- a/server/src/commands/core/move.js +++ b/server/src/commands/core/move.js @@ -1,9 +1,10 @@ /* Description: Changes the current channel of the calling socket + @deprecated This module will be removed or replaced */ // module main -export async function run(core, server, socket, data) { +export async function run({ server, socket, payload }) { // check for spam if (server.police.frisk(socket.address, 6)) { return server.reply({ @@ -13,18 +14,18 @@ export async function run(core, server, socket, data) { } // check user input - if (typeof data.channel !== 'string') { + if (typeof payload.channel !== 'string') { return true; } - if (data.channel === '') { + if (payload.channel === '') { return server.reply({ cmd: 'warn', // @todo Remove english and change to numeric id text: 'Cannot move to an empty channel.', }, socket); } - if (data.channel === socket.channel) { + if (payload.channel === socket.channel) { // they are trying to rejoin the channel return true; } @@ -32,7 +33,7 @@ export async function run(core, server, socket, data) { // check that the nickname isn't already in target channel const currentNick = socket.nick.toLowerCase(); const userExists = server.findSockets({ - channel: data.channel, + channel: payload.channel, nick: (targetNick) => targetNick.toLowerCase() === currentNick, }); @@ -60,9 +61,9 @@ export async function run(core, server, socket, data) { } } - // TODO: import function from join module + // @todo import function from join module // broadcast join notice to new peers - const newPeerList = server.findSockets({ channel: data.channel }); + const newPeerList = server.findSockets({ channel: payload.channel }); const moveAnnouncement = { cmd: 'onlineAdd', nick: socket.nick, @@ -85,7 +86,7 @@ export async function run(core, server, socket, data) { }, socket); // commit change - socket.channel = data.channel; + socket.channel = payload.channel; // eslint-disable-line no-param-reassign return true; } @@ -95,7 +96,9 @@ export function initHooks(server) { server.registerHook('in', 'chat', this.moveCheck.bind(this), 29); } -export function moveCheck(core, server, socket, payload) { +export function moveCheck({ + core, server, socket, payload, +}) { if (typeof payload.text !== 'string') { return false; } @@ -113,9 +116,14 @@ export function moveCheck(core, server, socket, payload) { return false; } - this.run(core, server, socket, { - cmd: 'move', - channel: input[1], + this.run({ + core, + server, + socket, + payload: { + cmd: 'move', + channel: input[1], + }, }); return false; diff --git a/server/src/commands/core/ping.js b/server/src/commands/core/ping.js index 6266f4c..642a526 100644 --- a/server/src/commands/core/ping.js +++ b/server/src/commands/core/ping.js @@ -1,3 +1,4 @@ +/* eslint no-empty-function: 0 */ /* Description: This module is only in place to supress error notices legacy sources may get */ diff --git a/server/src/commands/core/session.js b/server/src/commands/core/session.js index cd6bba1..4a4c9b4 100644 --- a/server/src/commands/core/session.js +++ b/server/src/commands/core/session.js @@ -1,3 +1,5 @@ +/* eslint no-param-reassign: 0 */ + /* Description: Create a new socket session or restore previous session */ @@ -5,19 +7,19 @@ // module support functions const createSessionID = () => { let sessionID = ''; - for( let i = 0, j = 32; i < j; i++) { + for (let i = 0, j = 32; i < j; i += 1) { sessionID += Math.random().toString(36).substr(2, 9); } return sessionID; -} +}; // module main -export async function run(core, server, socket) { +export async function run({ server, socket }) { // gather connection and channel count let ips = {}; let channels = {}; - // todo: use public channel flag - let publicChanCounts = { + // @todo use public channel flag + const publicChanCounts = { lounge: 0, meta: 0, math: 0, @@ -30,13 +32,13 @@ export async function run(core, server, socket) { chinese: 0, }; - // todo: code resuage between here and `morestats`, export function + // todo code resuage between here and `morestats`, export function server.clients.forEach((client) => { if (client.channel) { channels[client.channel] = true; ips[client.address] = true; if (typeof publicChanCounts[client.channel] !== 'undefined') { - publicChanCounts[client.channel]++; + publicChanCounts[client.channel] += 1; } } }); @@ -47,7 +49,7 @@ export async function run(core, server, socket) { ips = null; channels = null; - // @todo: restore session + // @todo restore session socket.sessionID = createSessionID(); socket.hcProtocol = 2; socket.userid = Math.floor(Math.random() * 9999999999999); @@ -67,5 +69,5 @@ export const info = { name: 'session', description: 'Restore previous state by session id or return new session id (currently unavailable)', usage: ` - API: { cmd: 'session', id: '' }` + API: { cmd: 'session', id: '' }`, }; diff --git a/server/src/commands/core/stats.js b/server/src/commands/core/stats.js index 421aec2..76bbc98 100644 --- a/server/src/commands/core/stats.js +++ b/server/src/commands/core/stats.js @@ -3,7 +3,7 @@ */ // module main -export async function run(core, server, socket) { +export async function run({ core, server, socket }) { // gather connection and channel count let ips = {}; let channels = {}; diff --git a/server/src/commands/core/whisper.js b/server/src/commands/core/whisper.js index f0215a3..5ed7d8f 100644 --- a/server/src/commands/core/whisper.js +++ b/server/src/commands/core/whisper.js @@ -25,7 +25,7 @@ const parseText = (text) => { }; // module main -export async function run(core, server, socket, payload) { +export async function run({ server, socket, payload }) { // check user input const text = parseText(payload.text); @@ -85,7 +85,9 @@ export function initHooks(server) { } // hooks chat commands checking for /whisper -export function whisperCheck(core, server, socket, payload) { +export function whisperCheck({ + core, server, socket, payload, +}) { if (typeof payload.text !== 'string') { return false; } @@ -107,10 +109,15 @@ export function whisperCheck(core, server, socket, payload) { input.splice(0, 2); const whisperText = input.join(' '); - this.run(core, server, socket, { - cmd: 'whisper', - nick: target, - text: whisperText, + this.run({ + core, + server, + socket, + payload: { + cmd: 'whisper', + nick: target, + text: whisperText, + }, }); return false; @@ -130,10 +137,15 @@ export function whisperCheck(core, server, socket, payload) { input.splice(0, 1); const whisperText = input.join(' '); - this.run(core, server, socket, { - cmd: 'whisper', - nick: socket.whisperReply, - text: whisperText, + this.run({ + core, + server, + socket, + payload: { + cmd: 'whisper', + nick: socket.whisperReply, + text: whisperText, + }, }); return false; diff --git a/server/src/commands/internal/disconnect.js b/server/src/commands/internal/disconnect.js index 74a9ca1..27280da 100644 --- a/server/src/commands/internal/disconnect.js +++ b/server/src/commands/internal/disconnect.js @@ -4,8 +4,8 @@ */ // module main -export async function run(core, server, socket, data) { - if (data.cmdKey !== server.cmdKey) { +export async function run({ server, socket, payload }) { + if (payload.cmdKey !== server.cmdKey) { // internal command attempt by client, increase rate limit chance and ignore return server.police.frisk(socket.address, 20); } diff --git a/server/src/commands/internal/legacylayer.js b/server/src/commands/internal/legacylayer.js index f5772ad..f4775b0 100644 --- a/server/src/commands/internal/legacylayer.js +++ b/server/src/commands/internal/legacylayer.js @@ -1,3 +1,5 @@ +/* eslint no-param-reassign: 0 */ + /* Description: This module adjusts outgoing data, making it compatible with legacy clients Dear god this module is horrifying @@ -6,7 +8,7 @@ // import * as UAC from '../utility/UAC/_info'; // module main -export async function run(core, server, socket, data) { +export async function run({ server, socket }) { return server.police.frisk(socket.address, 20); } @@ -21,14 +23,14 @@ export function initHooks(server) { } // hook incoming join events, if session was not invoked, default proto to 1 -export function joinCheck(core, server, socket, payload) { +export function joinCheck({ socket, payload }) { if (typeof socket.hcProtocol === 'undefined') { socket.hcProtocol = 1; const nickArray = payload.nick.split('#', 2); payload.nick = nickArray[0].trim(); if (nickArray[1] && typeof payload.pass === 'undefined') { - payload.pass = nickArray[1]; + payload.pass = nickArray[1]; // eslint-disable-line prefer-destructuring } // dunno how this happened on the legacy version @@ -45,30 +47,30 @@ export function joinCheck(core, server, socket, payload) { } // if legacy client sent an invite, downgrade request -export function inviteInCheck(core, server, socket, payload) { +export function inviteInCheck({ server, socket, payload }) { if (socket.hcProtocol === 1) { - let targetClient = server.findSockets({ channel: socket.channel, nick: data.nick }); + let targetClient = server.findSockets({ channel: socket.channel, nick: payload.nick }); if (targetClient.length === 0) { server.reply({ cmd: 'warn', text: 'Could not find user in that channel', }, socket); - + return false; } - + [targetClient] = targetClient; - + payload.userid = targetClient.userid; payload.channel = socket.channel; } - + return payload; } -// -export function inviteOutCheck(core, server, socket, payload) { +// +export function inviteOutCheck({ server, socket, payload }) { if (socket.hcProtocol === 1) { payload.cmd = 'info'; if (socket.userid === payload.from) { @@ -89,59 +91,59 @@ export function inviteOutCheck(core, server, socket, payload) { return payload; } -export function banCheck(core, server, socket, payload) { +export function banCheck({ server, socket, payload }) { if (socket.hcProtocol === 1) { - let targetClient = server.findSockets({ channel: socket.channel, nick: data.nick }); + let targetClient = server.findSockets({ channel: socket.channel, nick: payload.nick }); if (targetClient.length === 0) { server.reply({ cmd: 'warn', text: 'Could not find user in that channel', }, socket); - + return false; } - + [targetClient] = targetClient; - + payload.userid = targetClient.userid; payload.channel = socket.channel; } - + return payload; } -export function dumbCheck(core, server, socket, payload) { +export function dumbCheck({ server, socket, payload }) { if (socket.hcProtocol === 1) { - let targetClient = server.findSockets({ channel: socket.channel, nick: data.nick }); + let targetClient = server.findSockets({ channel: socket.channel, nick: payload.nick }); if (targetClient.length === 0) { server.reply({ cmd: 'warn', text: 'Could not find user in that channel', }, socket); - + return false; } - + [targetClient] = targetClient; - + payload.userid = targetClient.userid; payload.channel = socket.channel; } - + return payload; } -export function kickCheck(core, server, socket, payload) { +export function kickCheck({ server, socket, payload }) { if (socket.hcProtocol === 1) { if (typeof payload.nick !== 'number') { - if (typeof payload.nick !== 'object' && !Array.isArray(data.nick)) { + if (typeof payload.nick !== 'object' && !Array.isArray(payload.nick)) { return true; } } - let targetClient = server.findSockets({ channel: socket.channel, nick: data.nick }); + const targetClient = server.findSockets({ channel: socket.channel, nick: payload.nick }); if (targetClient.length === 0) { return false; @@ -151,10 +153,10 @@ export function kickCheck(core, server, socket, payload) { for (let i = 0, j = targetClient.length; i < j; i += 1) { payload.userid.push(targetClient[i].userid); } - + payload.channel = socket.channel; } - + return payload; } diff --git a/server/src/commands/internal/socketreply.js b/server/src/commands/internal/socketreply.js index 88c28f1..4221a76 100644 --- a/server/src/commands/internal/socketreply.js +++ b/server/src/commands/internal/socketreply.js @@ -3,8 +3,8 @@ */ // module main -export async function run(core, server, socket, data) { - if (data.cmdKey !== server.cmdKey) { +export async function run({ server, socket, payload }) { + if (payload.cmdKey !== server.cmdKey) { // internal command attempt by client, increase rate limit chance and ignore return server.police.frisk(socket.address, 20); } @@ -12,7 +12,7 @@ export async function run(core, server, socket, data) { // send warning to target socket server.reply({ cmd: 'warn', // @todo Remove english and change to numeric id - text: data.text + text: payload.text, }, socket); return true; diff --git a/server/src/commands/mod/ban.js b/server/src/commands/mod/ban.js index b62beb7..ff601e8 100644 --- a/server/src/commands/mod/ban.js +++ b/server/src/commands/mod/ban.js @@ -1,3 +1,4 @@ +/* eslint no-console: 0 */ /* Description: Adds the target socket's ip to the ratelimiter */ @@ -5,19 +6,21 @@ import * as UAC from '../utility/UAC/_info'; // module main -export async function run(core, server, socket, data) { +export async function run({ + core, server, socket, payload, +}) { // increase rate limit chance and ignore if not admin or mod if (!UAC.isModerator(socket.level)) { return server.police.frisk(socket.address, 10); } // check user input - if (typeof data.userid !== 'number') { + if (typeof payload.userid !== 'number') { return true; } // find target user - let badClient = server.findSockets({ channel: socket.channel, userid: data.userid }); + let badClient = server.findSockets({ channel: socket.channel, userid: payload.userid }); if (badClient.length === 0) { return server.reply({ @@ -52,8 +55,8 @@ export async function run(core, server, socket, data) { // notify mods server.broadcast({ cmd: 'info', - text: `${socket.nick}#${socket.trip} banned ${targetNick} in ${data.channel}, userhash: ${badClient.hash}`, - channel: data.channel, + text: `${socket.nick}#${socket.trip} banned ${targetNick} in ${payload.channel}, userhash: ${badClient.hash}`, + channel: payload.channel, user: UAC.getUserDetails(badClient), banner: UAC.getUserDetails(socket), }, { level: UAC.isModerator }); @@ -67,7 +70,7 @@ export async function run(core, server, socket, data) { return true; } -//export const requiredData = ['nick']; +// export const requiredData = ['nick']; export const info = { name: 'ban', description: 'Disconnects the target nickname in the same channel as calling socket & adds to ratelimiter', diff --git a/server/src/commands/mod/dumb.js b/server/src/commands/mod/dumb.js index 401f49f..3f8723f 100644 --- a/server/src/commands/mod/dumb.js +++ b/server/src/commands/mod/dumb.js @@ -1,3 +1,6 @@ +/* eslint no-param-reassign: 0 */ +/* eslint no-multi-assign: 0 */ + /* * Description: Make a user (spammer) dumb (mute) * Author: simple @@ -13,19 +16,21 @@ export function init(core) { } // module main -export async function run(core, server, socket, data) { +export async function run({ + core, server, socket, payload, +}) { // increase rate limit chance and ignore if not admin or mod if (!UAC.isModerator(socket.level)) { return server.police.frisk(socket.address, 10); } // check user input - if (typeof data.userid !== 'number') { + if (typeof payload.userid !== 'number') { return true; } // find target user - let badClient = server.findSockets({ channel: data.channel, userid: data.userid }); + let badClient = server.findSockets({ channel: payload.channel, userid: payload.userid }); if (badClient.length === 0) { return server.reply({ @@ -50,14 +55,14 @@ export async function run(core, server, socket, data) { }; // store allies if needed - if (data.allies && Array.isArray(data.allies)) { - record.allies = data.allies; + if (payload.allies && Array.isArray(payload.allies)) { + record.allies = payload.allies; } // notify mods server.broadcast({ cmd: 'info', - text: `${socket.nick}#${socket.trip} muzzled ${badClient.nick} in ${data.channel}, userhash: ${badClient.hash}`, + text: `${socket.nick}#${socket.trip} muzzled ${badClient.nick} in ${payload.channel}, userhash: ${badClient.hash}`, }, { level: UAC.isModerator }); return true; @@ -71,7 +76,9 @@ export function initHooks(server) { } // hook incoming chat commands, shadow-prevent chat if they are muzzled -export function chatCheck(core, server, socket, payload) { +export function chatCheck({ + core, server, socket, payload, +}) { if (typeof payload.text !== 'string') { return false; } @@ -116,10 +123,10 @@ export function chatCheck(core, server, socket, payload) { } // shadow-prevent all invites from muzzled users -export function inviteCheck(core, server, socket, payload) { +export function inviteCheck({ core, socket, payload }) { if (core.muzzledHashes[socket.hash]) { // @todo convert to protocol 2 - /*const nickValid = Invite.checkNickname(payload.nick); + /* const nickValid = Invite.checkNickname(payload.nick); if (nickValid !== null) { server.reply({ cmd: 'warn', // @todo Remove english and change to numeric id @@ -132,7 +139,7 @@ export function inviteCheck(core, server, socket, payload) { const channel = Invite.getChannel(); // send fake reply - server.reply(Invite.createSuccessPayload(payload.nick, channel), socket);*/ + server.reply(Invite.createSuccessPayload(payload.nick, channel), socket); */ return false; } @@ -141,7 +148,9 @@ export function inviteCheck(core, server, socket, payload) { } // shadow-prevent all whispers from muzzled users -export function whisperCheck(core, server, socket, payload) { +export function whisperCheck({ + core, server, socket, payload, +}) { if (typeof payload.nick !== 'string') { return false; } @@ -159,7 +168,8 @@ export function whisperCheck(core, server, socket, payload) { text: `You whispered to @${targetNick}: ${payload.text}`, }, socket); - // blanket "spam" protection, may expose the ratelimiting lines from `chat` and use that, TODO: one day #lazydev + // blanket "spam" protection, may expose the ratelimiting lines from + // `chat` and use that, @todo one day #lazydev server.police.frisk(socket.address, 9); return false; diff --git a/server/src/commands/mod/kick.js b/server/src/commands/mod/kick.js index 5fc38f7..0c73e2a 100644 --- a/server/src/commands/mod/kick.js +++ b/server/src/commands/mod/kick.js @@ -1,3 +1,5 @@ +/* eslint no-console: 0 */ + /* Description: Forces a change on the target(s) socket's channel, then broadcasts event */ @@ -5,29 +7,31 @@ import * as UAC from '../utility/UAC/_info'; // module main -export async function run(core, server, socket, data) { +export async function run({ + core, server, socket, payload, +}) { // increase rate limit chance and ignore if not admin or mod if (!UAC.isModerator(socket.level)) { return server.police.frisk(socket.address, 10); } // check user input - if (typeof data.userid !== 'number') { + if (typeof payload.userid !== 'number') { // @todo create multi-ban ui - if (typeof data.userid !== 'object' && !Array.isArray(data.userid)) { + if (typeof payload.userid !== 'object' && !Array.isArray(payload.userid)) { return true; } } let destChannel; - if (typeof data.to === 'string' && !!data.to.trim()) { - destChannel = data.to; + if (typeof payload.to === 'string' && !!payload.to.trim()) { + destChannel = payload.to; } else { destChannel = Math.random().toString(36).substr(2, 8); } // find target user(s) - const badClients = server.findSockets({ channel: data.channel, userid: data.userid }); + const badClients = server.findSockets({ channel: payload.channel, userid: payload.userid }); if (badClients.length === 0) { return server.reply({ @@ -76,7 +80,6 @@ export async function run(core, server, socket, data) { console.log(`${socket.nick} [${socket.trip}] kicked ${kicked[i].nick} in ${socket.channel} to ${destChannel} `); } - // broadcast client leave event for (let i = 0, j = kicked.length; i < j; i += 1) { server.broadcast({ diff --git a/server/src/commands/mod/moveuser.js b/server/src/commands/mod/moveuser.js index ffed4b5..331dcae 100644 --- a/server/src/commands/mod/moveuser.js +++ b/server/src/commands/mod/moveuser.js @@ -5,23 +5,23 @@ import * as UAC from '../utility/UAC/_info'; // module main -export async function run(core, server, socket, data) { +export async function run({ server, socket, payload }) { // increase rate limit chance and ignore if not admin or mod if (!UAC.isModerator(socket.level)) { return server.police.frisk(socket.address, 10); } // check user input - if (typeof data.nick !== 'string' || typeof data.channel !== 'string') { + if (typeof payload.nick !== 'string' || typeof payload.channel !== 'string') { return true; } - if (data.channel === socket.channel) { + if (payload.channel === socket.channel) { // moving them into the same channel? y u do this? return true; } - const badClients = server.findSockets({ channel: socket.channel, nick: data.nick }); + const badClients = server.findSockets({ channel: socket.channel, nick: payload.nick }); if (badClients.length === 0) { return server.reply({ @@ -41,7 +41,7 @@ export async function run(core, server, socket, data) { const currentNick = badClient.nick.toLowerCase(); const userExists = server.findSockets({ - channel: data.channel, + channel: payload.channel, nick: (targetNick) => targetNick.toLowerCase() === currentNick, }); @@ -68,8 +68,8 @@ export async function run(core, server, socket, data) { } } - // TODO: import from join module - const newPeerList = server.findSockets({ channel: data.channel }); + // @todo import from join module + const newPeerList = server.findSockets({ channel: payload.channel }); const moveAnnouncement = { cmd: 'onlineAdd', nick: badClient.nick, @@ -90,12 +90,12 @@ export async function run(core, server, socket, data) { nicks, }, badClient); - badClient.channel = data.channel; + badClient.channel = payload.channel; server.broadcast({ cmd: 'info', - text: `${badClient.nick} was moved into ?${data.channel}`, - }, { channel: data.channel }); + text: `${badClient.nick} was moved into ?${payload.channel}`, + }, { channel: payload.channel }); return true; } diff --git a/server/src/commands/mod/speak.js b/server/src/commands/mod/speak.js index eb3141c..19774cc 100644 --- a/server/src/commands/mod/speak.js +++ b/server/src/commands/mod/speak.js @@ -1,3 +1,5 @@ +/* eslint no-param-reassign: 0 */ + /* * Description: Pardon a dumb user to be able to speak again * Author: simple @@ -13,22 +15,24 @@ export function init(core) { } // module main -export async function run(core, server, socket, data) { +export async function run({ + core, server, socket, payload, +}) { // increase rate limit chance and ignore if not admin or mod if (!UAC.isModerator(socket.level)) { return server.police.frisk(socket.address, 10); } // check user input - if (typeof data.ip !== 'string' && typeof data.hash !== 'string') { + if (typeof payload.ip !== 'string' && typeof payload.hash !== 'string') { return server.reply({ cmd: 'warn', // @todo Remove english and change to numeric id text: "hash:'targethash' or ip:'1.2.3.4' is required", }, socket); } - if (typeof data.ip === 'string') { - if (data.ip === '*') { + if (typeof payload.ip === 'string') { + if (payload.ip === '*') { core.muzzledHashes = {}; return server.broadcast({ @@ -36,7 +40,7 @@ export async function run(core, server, socket, data) { text: `${socket.nick} unmuzzled all users`, }, { level: UAC.isModerator }); } - } else if (data.hash === '*') { + } else if (payload.hash === '*') { core.muzzledHashes = {}; return server.broadcast({ @@ -47,10 +51,10 @@ export async function run(core, server, socket, data) { // find target & remove mute status let target; - if (typeof data.ip === 'string') { - target = server.getSocketHash(data.ip); + if (typeof payload.ip === 'string') { + target = server.getSocketHash(payload.ip); } else { - target = data.hash; + target = payload.hash; } delete core.muzzledHashes[target]; diff --git a/server/src/commands/mod/unban.js b/server/src/commands/mod/unban.js index 29840a5..0c5cb50 100644 --- a/server/src/commands/mod/unban.js +++ b/server/src/commands/mod/unban.js @@ -1,3 +1,5 @@ +/* eslint no-console: 0 */ + /* Description: Removes a target ip from the ratelimiter */ @@ -5,14 +7,16 @@ import * as UAC from '../utility/UAC/_info'; // module main -export async function run(core, server, socket, data) { +export async function run({ + core, server, socket, payload, +}) { // increase rate limit chance and ignore if not admin or mod if (!UAC.isModerator(socket.level)) { return server.police.frisk(socket.address, 10); } // check user input - if (typeof data.ip !== 'string' && typeof data.hash !== 'string') { + if (typeof payload.ip !== 'string' && typeof payload.hash !== 'string') { return server.reply({ cmd: 'warn', // @todo Remove english and change to numeric id text: "hash:'targethash' or ip:'1.2.3.4' is required", @@ -22,12 +26,12 @@ export async function run(core, server, socket, data) { // find target let mode; let target; - if (typeof data.ip === 'string') { + if (typeof payload.ip === 'string') { mode = 'ip'; - target = data.ip; + target = payload.ip; } else { mode = 'hash'; - target = data.hash; + target = payload.hash; } // remove arrest record diff --git a/server/src/commands/mod/unbanall.js b/server/src/commands/mod/unbanall.js index 9d417aa..b43685a 100644 --- a/server/src/commands/mod/unbanall.js +++ b/server/src/commands/mod/unbanall.js @@ -1,3 +1,5 @@ +/* eslint no-console: 0 */ + /* Description: Clears all bans and ratelimits */ @@ -5,7 +7,7 @@ import * as UAC from '../utility/UAC/_info'; // module main -export async function run(core, server, socket) { +export async function run({ core, server, socket }) { // increase rate limit chance and ignore if not admin or mod if (!UAC.isModerator(socket.level)) { return server.police.frisk(socket.address, 10); diff --git a/server/src/scripts/configLib/SetupWizard.js b/server/src/scripts/configLib/SetupWizard.js index ac2f3a0..3bb0823 100644 --- a/server/src/scripts/configLib/SetupWizard.js +++ b/server/src/scripts/configLib/SetupWizard.js @@ -1,3 +1,9 @@ +/* eslint no-bitwise: 0 */ +/* eslint global-require: 0 */ +/* eslint class-methods-use-this: 0 */ +/* eslint no-param-reassign: 0 */ +/* eslint no-console: 0 */ + import { start as _start, get, @@ -8,6 +14,7 @@ import { * @author Marzavec ( https://github.com/marzavec ) * @version v2.0.0 * @license WTFPL ( http://www.wtfpl.net/txt/copying/ ) + * @todo Convert to use the `enquirer` package instead */ class SetupWizard { /** diff --git a/server/src/scripts/setupSchema/Banner.js b/server/src/scripts/setupSchema/Banner.js index f13fde7..5bb2066 100644 --- a/server/src/scripts/setupSchema/Banner.js +++ b/server/src/scripts/setupSchema/Banner.js @@ -1,3 +1,5 @@ +/* eslint no-console: 0 */ + /** * This script will be run before the package starts asking for the config data, * used to output a simple guide for the coming questions, or to spam some sexy diff --git a/server/src/scripts/setupSchema/Footer.js b/server/src/scripts/setupSchema/Footer.js index 5fb627b..98b65a5 100644 --- a/server/src/scripts/setupSchema/Footer.js +++ b/server/src/scripts/setupSchema/Footer.js @@ -1,3 +1,5 @@ +/* eslint no-console: 0 */ + /** * This script will be run once all questions have finished and no errors have * occured. You can congratulate the user on their fine choice in software usage diff --git a/server/src/scripts/setupSchema/Questions.js b/server/src/scripts/setupSchema/Questions.js index 532ba67..b62834f 100644 --- a/server/src/scripts/setupSchema/Questions.js +++ b/server/src/scripts/setupSchema/Questions.js @@ -1,3 +1,6 @@ +/* eslint no-undef: 0 */ +/* eslint global-require: 0 */ + /** * This object contains Prompt ( https://www.npmjs.com/package/prompt ) style * questions that the SetupWizard will require an answer to. Questions are asked diff --git a/server/src/serverLib/CommandManager.js b/server/src/serverLib/CommandManager.js index e715c6b..c1d9426 100644 --- a/server/src/serverLib/CommandManager.js +++ b/server/src/serverLib/CommandManager.js @@ -1,3 +1,5 @@ +/* eslint no-console: 0 */ + import { basename, join, @@ -98,6 +100,7 @@ class CommandManager { .replace(new RegExp(sep.replace('\\', '\\\\'), 'g'), '/'); } + // eslint-disable-next-line no-param-reassign command.info.category = category; if (this.categories.indexOf(category) === -1) { @@ -126,6 +129,7 @@ class CommandManager { * @private * @return {String} Module errors or null if none */ + // eslint-disable-next-line class-methods-use-this validateCommand(object) { if (typeof object !== 'object') { return 'command setup is invalid'; } if (typeof object.run !== 'function') { return 'run function is missing'; } @@ -253,11 +257,11 @@ class CommandManager { * @private * @return {*} Arbitrary module return data */ - async execute(command, server, socket, data) { + async execute(command, server, socket, payload) { if (typeof command.requiredData !== 'undefined') { const missing = []; for (let i = 0, len = command.requiredData.length; i < len; i += 1) { - if (typeof data[command.requiredData[i]] === 'undefined') { missing.push(command.requiredData[i]); } + if (typeof payload[command.requiredData[i]] === 'undefined') { missing.push(command.requiredData[i]); } } if (missing.length > 0) { @@ -278,7 +282,12 @@ class CommandManager { } try { - return await command.run(this.core, server, socket, data); + return await command.run({ + core: this.core, + server, + socket, + payload, + }); } catch (err) { const errText = `Failed to execute '${command.info.name}': `; diff --git a/server/src/serverLib/ConfigManager.js b/server/src/serverLib/ConfigManager.js index bb414be..85224f1 100644 --- a/server/src/serverLib/ConfigManager.js +++ b/server/src/serverLib/ConfigManager.js @@ -1,3 +1,5 @@ +/* eslint no-console: 0 */ + import dateFormat from 'dateformat'; import { existsSync, diff --git a/server/src/serverLib/CoreApp.js b/server/src/serverLib/CoreApp.js index 8c2225d..5fb7233 100644 --- a/server/src/serverLib/CoreApp.js +++ b/server/src/serverLib/CoreApp.js @@ -1,3 +1,5 @@ +/* eslint no-console: 0 */ + import { join } from 'path'; import { CommandManager, @@ -90,4 +92,4 @@ class CoreApp { } } -export { CoreApp }; +export { CoreApp as default }; diff --git a/server/src/serverLib/ImportsManager.js b/server/src/serverLib/ImportsManager.js index ac1fc4c..ac429a0 100644 --- a/server/src/serverLib/ImportsManager.js +++ b/server/src/serverLib/ImportsManager.js @@ -1,3 +1,6 @@ +/* eslint global-require: 0 */ +/* eslint no-console: 0 */ + import { resolve, basename as _basename, @@ -57,7 +60,7 @@ class ImportsManager { let imported; try { - imported = require(file); + imported = require(file); // eslint-disable-line import/no-dynamic-require if (!this.imports[dirName]) { this.imports[dirName] = {}; diff --git a/server/src/serverLib/MainServer.js b/server/src/serverLib/MainServer.js index 6095bbe..41af7e5 100644 --- a/server/src/serverLib/MainServer.js +++ b/server/src/serverLib/MainServer.js @@ -1,3 +1,6 @@ +/* eslint no-bitwise: 0 */ +/* eslint no-console: 0 */ + import { Server as WsServer, OPEN as SocketReady, @@ -189,10 +192,6 @@ class MainServer extends WsServer { * Issue #1: hard coded `cmd` check * Issue #2: hard coded `cmd` value checks */ - if (typeof payload.cmd === 'undefined') { - return; - } - if (typeof payload.cmd !== 'string') { return; } @@ -509,7 +508,12 @@ class MainServer extends WsServer { for (let i = 0, j = hooks.length; i < j; i += 1) { try { - newPayload = hooks[i].run(this.core, this, socket, newPayload); + newPayload = hooks[i].run({ + core: this.core, + server: this, + socket, + payload: newPayload, + }); } catch (err) { const errText = `Hook failure, '${type}', '${command}': `; if (this.core.config.logErrDetailed === true) { diff --git a/server/src/serverLib/RateLimiter.js b/server/src/serverLib/RateLimiter.js index de91e5e..9e526b7 100644 --- a/server/src/serverLib/RateLimiter.js +++ b/server/src/serverLib/RateLimiter.js @@ -77,6 +77,7 @@ class RateLimiter { return true; } + // eslint-disable-next-line no-restricted-properties record.score *= Math.pow(2, -(Date.now() - record.time) / this.halflife); record.score += deltaScore; record.time = Date.now(); diff --git a/server/src/serverLib/index.js b/server/src/serverLib/index.js index a820588..21cfa14 100644 --- a/server/src/serverLib/index.js +++ b/server/src/serverLib/index.js @@ -1,3 +1,5 @@ +/* eslint global-require: 0 */ + export const CommandManager = require('./CommandManager').default; export const ConfigManager = require('./ConfigManager').default; export const ImportsManager = require('./ImportsManager').default;