mirror of
https://github.com/CommunitySolidServer/CommunitySolidServer.git
synced 2024-10-03 14:55:10 +00:00
fix: update eslint settings
This commit is contained in:
@@ -27,7 +27,7 @@ export abstract class AsyncHandler<TInput, TOutput = void> {
|
||||
*
|
||||
* @returns The result of the handle function of the handler.
|
||||
*/
|
||||
public async handleSafe (data: TInput): Promise<TOutput> {
|
||||
public async handleSafe(data: TInput): Promise<TOutput> {
|
||||
await this.canHandle(data);
|
||||
|
||||
return this.handle(data);
|
||||
|
||||
@@ -12,7 +12,7 @@ export class CompositeAsyncHandler<TIn, TOut> implements AsyncHandler<TIn, TOut>
|
||||
* Creates a new CompositeAsyncHandler that stores the given handlers.
|
||||
* @param handlers - Handlers over which it will run.
|
||||
*/
|
||||
public constructor (handlers: AsyncHandler<TIn, TOut>[]) {
|
||||
public constructor(handlers: AsyncHandler<TIn, TOut>[]) {
|
||||
this.handlers = handlers;
|
||||
}
|
||||
|
||||
@@ -22,7 +22,7 @@ export class CompositeAsyncHandler<TIn, TOut> implements AsyncHandler<TIn, TOut>
|
||||
*
|
||||
* @returns A promise resolving if at least 1 handler supports to input, or rejecting if none do.
|
||||
*/
|
||||
public async canHandle (input: TIn): Promise<void> {
|
||||
public async canHandle(input: TIn): Promise<void> {
|
||||
await this.findHandler(input);
|
||||
}
|
||||
|
||||
@@ -33,7 +33,7 @@ export class CompositeAsyncHandler<TIn, TOut> implements AsyncHandler<TIn, TOut>
|
||||
* @returns A promise corresponding to the handle call of a handler that supports the input.
|
||||
* It rejects if no handlers support the given data.
|
||||
*/
|
||||
public async handle (input: TIn): Promise<TOut> {
|
||||
public async handle(input: TIn): Promise<TOut> {
|
||||
let handler: AsyncHandler<TIn, TOut>;
|
||||
|
||||
try {
|
||||
@@ -52,7 +52,7 @@ export class CompositeAsyncHandler<TIn, TOut> implements AsyncHandler<TIn, TOut>
|
||||
* @returns A promise corresponding to the handle call of a handler that supports the input.
|
||||
* It rejects if no handlers support the given data.
|
||||
*/
|
||||
public async handleSafe (input: TIn): Promise<TOut> {
|
||||
public async handleSafe(input: TIn): Promise<TOut> {
|
||||
const handler = await this.findHandler(input);
|
||||
|
||||
return handler.handle(input);
|
||||
@@ -66,7 +66,7 @@ export class CompositeAsyncHandler<TIn, TOut> implements AsyncHandler<TIn, TOut>
|
||||
*
|
||||
* @returns A promise resolving to a handler that supports the data or otherwise rejecting.
|
||||
*/
|
||||
private async findHandler (input: TIn): Promise<AsyncHandler<TIn, TOut>> {
|
||||
private async findHandler(input: TIn): Promise<AsyncHandler<TIn, TOut>> {
|
||||
const errors: Error[] = [];
|
||||
|
||||
for (const handler of this.handlers) {
|
||||
|
||||
@@ -11,7 +11,7 @@ export abstract class HttpError extends Error {
|
||||
* @param name - Error name. Useful for logging and stack tracing.
|
||||
* @param message - Message to be thrown.
|
||||
*/
|
||||
protected constructor (statusCode: number, name: string, message: string) {
|
||||
protected constructor(statusCode: number, name: string, message: string) {
|
||||
super(message);
|
||||
this.statusCode = statusCode;
|
||||
this.name = name;
|
||||
|
||||
@@ -9,7 +9,7 @@ export class UnsupportedHttpError extends HttpError {
|
||||
* Default message is 'The given input is not supported by the server configuration.'.
|
||||
* @param message - Optional, more specific, message.
|
||||
*/
|
||||
public constructor (message?: string) {
|
||||
public constructor(message?: string) {
|
||||
super(400, 'UnsupportedHttpError', message || 'The given input is not supported by the server configuration.');
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user