KararTY/dank-twitch-irc

Parser Improvements

Opened this issue · 0 comments

First mention #15 (comment)

  • Remove the branch in decodeValue(), as we do it in parseTags() now. Or just remove decodeValue() altogether, it's not really needed, we can do all the logic in parseTags() (tests will have to be updated, either way).
  • Use the this binding of parseTags() as a constructor function, then instance with new, no need to create an extra object, as it's already a this bounded function.
  • Use the buffer directly, then toString() tags and their properties.
  • Move to a traditional for loop, slice indices instead of using split() (the above checkbox would make this cleaner as it comes with a keys() iterator method).