From f28e65ab8035682372edbe1c11d9ca2581e0a2e6 Mon Sep 17 00:00:00 2001 From: marzavec Date: Wed, 6 Nov 2019 23:35:23 -0800 Subject: Syntax update and formatting tweaks --- server/src/scripts/setupSchema/Banner.js | 12 ++++++------ server/src/scripts/setupSchema/Questions.js | 20 ++++++++++---------- 2 files changed, 16 insertions(+), 16 deletions(-) (limited to 'server/src/scripts/setupSchema') diff --git a/server/src/scripts/setupSchema/Banner.js b/server/src/scripts/setupSchema/Banner.js index 823f0fe..f13fde7 100644 --- a/server/src/scripts/setupSchema/Banner.js +++ b/server/src/scripts/setupSchema/Banner.js @@ -5,8 +5,8 @@ * */ -const stripIndents = require('common-tags').stripIndents; -const chalk = require('chalk'); +import { stripIndents } from 'common-tags'; +import chalk from 'chalk'; // gotta have that sexy console console.log(stripIndents` @@ -20,9 +20,9 @@ console.log(stripIndents` ${chalk.white('Note:')} ${chalk.green('npm/yarn run config')} will re-run this utility. You will now be asked for the following: - - ${chalk.magenta(' Salt')}, the salt for username trip - - ${chalk.magenta('Admin Name')}, the initial admin username - - ${chalk.magenta('Admin Pass')}, the initial admin password - - ${chalk.magenta(' Port')}, the port for the websocket + - ${chalk.magenta(' Salt')}, the salt for username trip + - ${chalk.magenta('Admin Name')}, the initial admin username + - ${chalk.magenta('Admin Pass')}, the initial admin password + - ${chalk.magenta(' Port')}, the port for the websocket \u200b `); diff --git a/server/src/scripts/setupSchema/Questions.js b/server/src/scripts/setupSchema/Questions.js index f84d32f..532ba67 100644 --- a/server/src/scripts/setupSchema/Questions.js +++ b/server/src/scripts/setupSchema/Questions.js @@ -15,10 +15,10 @@ const Questions = { type: 'string', hidden: true, replace: '*', - before: value => { + before: (value) => { salt = value; return value; - } + }, }, adminName: { @@ -26,7 +26,7 @@ const Questions = { pattern: /^"?[a-zA-Z0-9_]+"?$/, type: 'string', message: 'Nicks can only contain letters, numbers and underscores', - before: value => value.replace(/"/g, '') + before: (value) => value.replace(/"/g, ''), }, adminTrip: { @@ -35,21 +35,21 @@ const Questions = { replace: '*', description: 'Admin Password', message: 'You must enter or re-enter a password', - before: value => { + before: (value) => { const crypto = require('crypto'); - let sha = crypto.createHash('sha256'); + const sha = crypto.createHash('sha256'); sha.update(value + salt); return sha.digest('base64').substr(0, 6); - } + }, }, websocketPort: { type: 'integer', message: 'The port may only be a number!', description: 'Websocket Port', - default: '6060' - } - } -} + default: '6060', + }, + }, +}; module.exports = Questions; -- cgit v1.2.1