Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
.forEach(function (rr) {
if (rr.type === 'SRV') {
var parts = rr.name.split('.')
service.name = parts.shift()
service.replyDomain = parts.pop()
service.fullName = rr.name
service.host = rr.data.target
service.port = rr.data.port
service.type = serviceName.parse(parts.join('.'))
} else if (rr.type === 'TXT') {
service.rawTxt = rr.data
service.txt = txt.decode(rr.data)
}
})
.forEach(function (rr) {
if (rr.type === 'SRV') {
var parts = rr.name.split('.')
var name = parts[0]
var types = serviceName.parse(parts.slice(1, -1).join('.'))
service.name = name
service.fqdn = rr.name
service.host = rr.data.target
service.referer = referer
service.port = rr.data.port
service.type = types.name
service.protocol = types.protocol
service.subtypes = types.subtypes
} else if (rr.type === 'TXT') {
service.rawTxt = rr.data
service.txt = txt.decode(rr.data)
}
})