@@ -171,9 +171,12 @@ function setupScanParameters(commandName: string) {
171171 ) ;
172172}
173173
174- async function getDeviceIp ( options : ProgramOption , configFile : FileConfig ) {
174+ async function getDeviceIp (
175+ options : ProgramOption ,
176+ configFile : FileConfig ,
177+ ) : Promise < string > {
175178 let ip = getOptConfiguredValue ( options . address , configFile . ip ) ;
176- if ( ip ! == undefined ) {
179+ if ( ip = == undefined ) {
177180 const name = getConfiguredValue (
178181 options . name ,
179182 configFile . name ,
@@ -465,9 +468,7 @@ function createListenCliCmd(configFile: FileConfig) {
465468 . action ( async ( _ , cmd ) => {
466469 const options = cmd . optsWithGlobals ( ) ;
467470 const ip = await getDeviceIp ( options , configFile ) ;
468- if ( ip !== undefined ) {
469- HPApi . setDeviceIP ( ip ) ;
470- }
471+ HPApi . setDeviceIP ( ip ) ;
471472
472473 const isDebug = getIsDebug ( options , configFile ) ;
473474 HPApi . setDebug ( isDebug ) ;
@@ -566,9 +567,7 @@ function createAdfAutoscanCliCmd(fileConfig: FileConfig) {
566567 const options = cmd . optsWithGlobals ( ) ;
567568
568569 const ip = await getDeviceIp ( options , fileConfig ) ;
569- if ( ip !== undefined ) {
570- HPApi . setDeviceIP ( ip ) ;
571- }
570+ HPApi . setDeviceIP ( ip ) ;
572571
573572 const isDebug = getIsDebug ( options , fileConfig ) ;
574573 HPApi . setDebug ( isDebug ) ;
@@ -643,9 +642,7 @@ function createSingleScanCliCmd(fileConfig: FileConfig) {
643642 const options = cmd . optsWithGlobals ( ) ;
644643
645644 const ip = await getDeviceIp ( options , fileConfig ) ;
646- if ( ip !== undefined ) {
647- HPApi . setDeviceIP ( ip ) ;
648- }
645+ HPApi . setDeviceIP ( ip ) ;
649646
650647 const isDebug = getIsDebug ( options , fileConfig ) ;
651648 HPApi . setDebug ( isDebug ) ;
@@ -692,9 +689,7 @@ function createClearRegistrationsCliCmd(fileConfig: FileConfig) {
692689 const options : ProgramOption = cmd . optsWithGlobals ( ) ;
693690
694691 const ip = await getDeviceIp ( options , fileConfig ) ;
695- if ( ip !== undefined ) {
696- HPApi . setDeviceIP ( ip ) ;
697- }
692+ HPApi . setDeviceIP ( ip ) ;
698693
699694 const isDebug = getIsDebug ( options , fileConfig ) ;
700695 HPApi . setDebug ( isDebug ) ;
0 commit comments