DRYing up these two if conditions
DRYing up these two if conditions

jonroden/NodeAPI,dongguangming/NodeAPI,AlexanderMazaletskiy/NodeAPI,mlabieniec/NodeAPI,MichalTuleja/jdl-backend,Simulsoft/NodeAPI,nishant8BITS/NodeAPI,ealeksandrov/NodeAPI,antianlu/NodeAPI,fritz-c/NodeAPI