File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 66} from '@nestjs/common' ;
77import { Abstract } from '@nestjs/common/interfaces' ;
88import { Type } from '@nestjs/common/interfaces/type.interface' ;
9+ import { isEmpty } from '@nestjs/common/utils/shared.utils' ;
910import { UnknownModuleException } from './errors/exceptions/unknown-module.exception' ;
1011import {
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 (
You can’t perform that action at this time.
0 commit comments