From f296c6fe266be2593cc86f205d0dbdc065f86142 Mon Sep 17 00:00:00 2001 From: baldo Date: Thu, 28 Jul 2022 12:19:40 +0200 Subject: [PATCH] Got rid of some warnings. --- server/logger.ts | 16 +++++++++------- server/validation/constraints.ts | 1 + 2 files changed, 10 insertions(+), 7 deletions(-) diff --git a/server/logger.ts b/server/logger.ts index d3740ed..edaadc7 100644 --- a/server/logger.ts +++ b/server/logger.ts @@ -5,24 +5,26 @@ import _ from 'lodash'; export type LoggingFunction = (...args: any[]) => void; const noopTaggedLogger: TaggedLogger = { - log(level: LogLevel, ...args: any[]): void {}, - debug(...args: any[]): void {}, - info(...args: any[]): void {}, - warn(...args: any[]): void {}, - error(...args: any[]): void {}, - profile(...args: any[]): void {}, + log(_level: LogLevel, ..._args: any[]): void {}, + debug(..._args: any[]): void {}, + info(..._args: any[]): void {}, + warn(..._args: any[]): void {}, + error(..._args: any[]): void {}, + profile(..._args: any[]): void {}, }; export interface ActivatableLogger extends Logger { init(enabled: boolean, loggingFunction?: LoggingFunction): void; } +/** + * TODO: Check if LoggingConfig.debug and LoggingConfig.profile are handled. + */ export class ActivatableLoggerImpl implements ActivatableLogger { private enabled: boolean = false; private loggingFunction: LoggingFunction = console.info; init(enabled: boolean, loggingFunction?: LoggingFunction): void { - const config = require('./config').config; this.enabled = enabled; this.loggingFunction = loggingFunction || console.info; } diff --git a/server/validation/constraints.ts b/server/validation/constraints.ts index 587faf3..e90cfe7 100644 --- a/server/validation/constraints.ts +++ b/server/validation/constraints.ts @@ -1,6 +1,7 @@ // ATTENTION: Those constraints are no longer the same file as for the client / admin interface. // Make sure changes are also reflected in /shared/validation/constraints.js. +// noinspection RegExpSimplifiable const CONSTRAINTS = { id:{ type: 'string',