style: align multiline ternary operators

This commit is contained in:
2026-09-28 16:37:01 +03:00
committed by ksv741
parent b78c215ff1
commit 183b7f1efd
54 changed files with 986 additions and 982 deletions
+10 -10
View File
@@ -15,18 +15,18 @@ export class HttpExceptionFilter implements ExceptionFilter {
const context = host.switchToHttp();
const response = context.getResponse<Response>();
const status =
exception instanceof HttpException ?
exception.getStatus() :
HttpStatus.INTERNAL_SERVER_ERROR;
exception instanceof HttpException
? exception.getStatus()
: HttpStatus.INTERNAL_SERVER_ERROR;
const payload =
exception instanceof HttpException ? exception.getResponse() : undefined;
const isValidation = Array.isArray(
(payload as { message?: unknown })?.message,
);
const code = isValidation ?
'VALIDATION_ERROR' :
this.codeFor(status, payload);
const code = isValidation
? 'VALIDATION_ERROR'
: this.codeFor(status, payload);
response.locals ??= {};
response.locals.publicErrorCode = code;
response
@@ -35,13 +35,13 @@ export class HttpExceptionFilter implements ExceptionFilter {
.json({
status,
code,
...(isValidation ?
{
...(isValidation
? {
errors: this.validationErrors(
(payload as { message: ValidationError[] }).message,
),
} :
{}),
}
: {}),
});
}