Created
May 27, 2018 08:34
-
-
Save Aniket-Engg/064e8e2fe3778e6d909143c8df6d1c2e to your computer and use it in GitHub Desktop.
Exporting Block without ExtraData
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
export var write = (ws, message) => | |
{ | |
if(message.hasOwnProperty('data')){ | |
var temp = JSON.parse(message.data); | |
if(temp.length == 1) | |
delete temp[0]['extraData']; | |
else{ | |
for(var i=1;i<temp.length;i++) | |
delete temp[i]['extraData']; | |
} | |
message.data = JSON.stringify(temp); | |
} | |
ws.send(JSON.stringify(message)); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment