DJDNS / js-deje

JS implementation of DEJE client
1 stars 0 forks source link

Clean up object serialization API #11

Open MaddieM4 opened 10 years ago

MaddieM4 commented 10 years ago

There's a bit of awkwardly duplicated code in document.serialize and event.serialize. Both of them should, ideally, accept a format object and pass it on to utils.serialize.

Will also need changes to the test suite.

MaddieM4 commented 10 years ago

Another, very valid option is to remove the per-object convenience functions (which are somewhat redundant) and simply use the Utils.serialize function. I actually kinda prefer this, since it will also make it more consistent to serialize arbitrary objects in the serialization test suite in the future.