const res ={
wadoUriRoot: '10.10.99.88:8042',
qidoRoot: '10.10.99.88:8042',
wadoRoot: '10.10.99.88:8042',
}
let serveAddStr =(serve)=>{
let res = {}
for(let item in serve){
let isInclude = serve[item].includes('http')||serve[item].includes('https')
if(!isInclude){
res[item] = item.includes('wadoUri')?`http://${serve[item]}/wado`:`http://${serve[item]}/dicom-web`
}
}
return res
}
console.log(serveAddStr(res))
let servedeleteStr =(serve)=>{
let res = {}
let reg_str =/\d+\.\d+\.\d+\.\d+/
for(let item in serve){
let isInclude = serve[item].includes('http')||serve[item].includes('https')
if(isInclude){
res[item] =serve[item].match(reg_str)?.[0]
}
}
return res
}
console.log(servedeleteStr(serveAddStr(res)))
console