Advertisement
Guest User

Untitled

a guest
Mar 21st, 2019
76
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.25 KB | None | 0 0
  1. import * as Protocol from '../../protocol/protocol.chat';
  2.  
  3. const smth = Protocol.parse(packet);
  4.  
  5. if (smth instanceof Error) {
  6. // Oops. Something wrong with this packet.
  7. }
  8. if (Protocol.ChatMessage.instanceOf(smth) === true) {
  9. // This is chat message
  10. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement