lib/UpnpClient.js
function convert (message) {
  const obj = {}
  const lines = message.toString().trim().split('\r\n')
  if (lines && lines[0]) {
    obj.status = lines[0]
    for (const line of lines) {
      const fields = line.split(': ')
      if (fields.length === 2) {
        obj[fields[0].toLowerCase()] = fields[1]
      }
    }
  }
  return obj
}
function convert (message) {
  const obj = {}
  const lines = message.toString().trim().split('\r\n')
  if (lines && lines[0]) {
    obj.status = lines[0]
    for (const line of lines) {
      const fields = line.split(': ')
      if (fields.length === 2) {
        obj[fields[0].toLowerCase()] = fields[1]
      }
    }
  }
  return obj
}
function convert ( message ) { const obj = { } const lines = message . toString ( ) . trim ( ) . split ( '\r\n' ) if ( lines && lines [ 0 ] ) { obj . status = lines [ 0 ] for ( const line of lines ) { const fields = line . split ( ': ' ) if ( fields . length === 2 ) { obj [ fields [ 0 ] . toLowerCase ( ) ] = fields [ 1 ] } } } return obj }
Convert UPnP message to object.
Convert UPnP message to object .