summaryrefslogtreecommitdiff
path: root/webcards/scripts/socket/message.js
diff options
context:
space:
mode:
authorKyle Gunger <corechg@gmail.com>2020-09-15 20:03:52 -0400
committerKyle Gunger <corechg@gmail.com>2020-09-15 20:03:52 -0400
commit2ce432034eb35f763182de03fb7b42d2a07afc4b (patch)
treee57d7bc40d12c32c79f1f16ba669a5426ae80525 /webcards/scripts/socket/message.js
parent20201f77b5cf5cbb1c70b1cc51c4108d620a3202 (diff)
Webcards update from local git server
Diffstat (limited to 'webcards/scripts/socket/message.js')
-rw-r--r--webcards/scripts/socket/message.js18
1 files changed, 11 insertions, 7 deletions
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});
}
-};
+}