From 2ce432034eb35f763182de03fb7b42d2a07afc4b Mon Sep 17 00:00:00 2001 From: Kyle Gunger Date: Tue, 15 Sep 2020 20:03:52 -0400 Subject: Webcards update from local git server --- webcards/scripts/socket/message.js | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) (limited to 'webcards/scripts/socket/message.js') diff --git a/webcards/scripts/socket/message.js b/webcards/scripts/socket/message.js index 5e821c4..044027d 100644 --- a/webcards/scripts/socket/message.js +++ b/webcards/scripts/socket/message.js @@ -1,14 +1,18 @@ -function Message(type, data){ - this.t = type; - this.d = data; -} +'use strict'; + +class Message{ + constructor (type, data) + { + this.t = type; + this.d = data; + } -Message.prototype = { - stringify: function(){ + stringify () + { var dat = this.d if(typeof dat !== "string"){ dat = JSON.stringify(dat); } return JSON.stringify({type: this.t, data: dat}); } -}; +} -- cgit v1.2.3