Skip to content

Commit c4b92e9

Browse files
style(): adjust coding style
1 parent 91500ba commit c4b92e9

1 file changed

Lines changed: 7 additions & 8 deletions

File tree

packages/core/nest-application-context.ts

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ import {
66
} from '@nestjs/common';
77
import { Abstract } from '@nestjs/common/interfaces';
88
import { Type } from '@nestjs/common/interfaces/type.interface';
9+
import { isEmpty } from '@nestjs/common/utils/shared.utils';
910
import { UnknownModuleException } from './errors/exceptions/unknown-module.exception';
1011
import {
1112
callAppShutdownHook,
@@ -87,7 +88,7 @@ export class NestApplicationContext implements INestApplicationContext {
8788
* @returns {this} The Nest application context instance
8889
*/
8990
public enableShutdownHooks(signals: (ShutdownSignal | string)[] = []): this {
90-
if (signals.length === 0) {
91+
if (isEmpty(signals)) {
9192
signals = Object.keys(ShutdownSignal).map(
9293
(key: string) => ShutdownSignal[key],
9394
);
@@ -98,13 +99,11 @@ export class NestApplicationContext implements INestApplicationContext {
9899
}
99100

100101
signals = signals
101-
// To string and consistentify
102-
.map(
103-
(signal: ShutdownSignal | string): string =>
104-
signal
105-
.toString()
106-
.toUpperCase()
107-
.trim(),
102+
.map((signal: ShutdownSignal | string): string =>
103+
signal
104+
.toString()
105+
.toUpperCase()
106+
.trim(),
108107
)
109108
// Filter out the signals which is already listening to
110109
.filter(

0 commit comments

Comments
 (0)