Skip to content

Commit

Permalink
Merge pull request nestjs#1199 from jbpionnier/refactor/void_0_not_ne…
Browse files Browse the repository at this point in the history
…cessary

refactor: remove void 0 not necessary
  • Loading branch information
kamilmysliwiec authored Oct 17, 2018
2 parents 96b0a19 + bd05652 commit a78a31e
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 8 deletions.
4 changes: 2 additions & 2 deletions packages/common/services/logger.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ export class Logger implements LoggerService {
isTimeDiffEnabled?: boolean,
) {
if (Logger.contextEnvironment === NestEnvironment.TEST) {
return void 0;
return;
}
const output =
message && isObject(message) ? JSON.stringify(message, null, 2) : message;
Expand All @@ -110,7 +110,7 @@ export class Logger implements LoggerService {

private static printStackTrace(trace: string) {
if (this.contextEnvironment === NestEnvironment.TEST || !trace) {
return void 0;
return;
}
process.stdout.write(trace);
process.stdout.write(`\n`);
Expand Down
4 changes: 2 additions & 2 deletions packages/core/exceptions/exceptions-handler.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ export class ExceptionsHandler extends BaseExceptionFilter {

public next(exception: Error | HttpException | any, ctx: ArgumentsHost) {
if (this.invokeCustomFilters(exception, ctx)) {
return void 0;
return;
}
super.catch(exception, ctx);
}
Expand All @@ -29,7 +29,7 @@ export class ExceptionsHandler extends BaseExceptionFilter {
public invokeCustomFilters(exception, response): boolean {
if (isEmpty(this.filters)) return false;

const filter = this.filters.find(({ exceptionMetatypes, func }) => {
const filter = this.filters.find(({ exceptionMetatypes }) => {
const hasMetatype =
!exceptionMetatypes.length ||
exceptionMetatypes.some(
Expand Down
2 changes: 1 addition & 1 deletion packages/core/injector/injector.ts
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ export class Injector {
throw new RuntimeException();
}
if (targetMetatype.isResolved) {
return void 0;
return;
}
await this.resolveConstructorParams<T>(
wrapper,
Expand Down
2 changes: 1 addition & 1 deletion packages/core/injector/module-ref.ts
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ export abstract class ModuleRef {

private initFlattenModule() {
if (this.flattenModuleFixture) {
return void 0;
return;
}
const modules = this.container.getModules();
const initialValue = {
Expand Down
4 changes: 2 additions & 2 deletions packages/websockets/exceptions/ws-exceptions-handler.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ export class WsExceptionsHandler extends BaseWsExceptionFilter {
public handle(exception: Error | WsException | any, host: ArgumentsHost) {
const client = host.switchToWs().getClient();
if (this.invokeCustomFilters(exception, host) || !client.emit) {
return void 0;
return;
}
super.catch(exception, host);
}
Expand All @@ -26,7 +26,7 @@ export class WsExceptionsHandler extends BaseWsExceptionFilter {
public invokeCustomFilters(exception, args: ArgumentsHost): boolean {
if (isEmpty(this.filters)) return false;

const filter = this.filters.find(({ exceptionMetatypes, func }) => {
const filter = this.filters.find(({ exceptionMetatypes }) => {
const hasMetatype =
!exceptionMetatypes.length ||
exceptionMetatypes.some(
Expand Down

0 comments on commit a78a31e

Please sign in to comment.