breach / thrust

Chromium-based cross-platform / cross-language application framework
MIT License
2.77k stars 121 forks source link

Why does a key with an empty json array get ommitted from a message? #271

Open camsoupa opened 9 years ago

camsoupa commented 9 years ago

Why does a key with an empty json array get ommitted from a message?

// node.js
remote({ key1: 1, key2: [] })

// Browser
THRUST.remote.listen(function (msg) {
 // key2 ommitted! msg == { key1: 1 } 
  ...
})
miketheprogrammer commented 9 years ago

I would always recommend serializing js objects into json before sending them. A message is really meant to be a string. On Mar 28, 2015 4:38 PM, "camsoupa" notifications@github.com wrote:

Why does a key with an empty json array get ommitted from a message?

// node.js

remote({ key1: 1, key2: [] }) // Browser THRUST.remote.listen(function (msg) { // key2 ommitted! msg == { key1: 1 } ... })

— Reply to this email directly or view it on GitHub https://github.com/breach/thrust/issues/271.