Skip to content

Instantly share code, notes, and snippets.

@Aniket-Engg
Created May 27, 2018 08:34
Show Gist options
  • Save Aniket-Engg/064e8e2fe3778e6d909143c8df6d1c2e to your computer and use it in GitHub Desktop.
Save Aniket-Engg/064e8e2fe3778e6d909143c8df6d1c2e to your computer and use it in GitHub Desktop.
Exporting Block without ExtraData
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