ftlabs/fruitmachine

module.toJSON() doesn't return JSON :)

Closed this issue · 4 comments

Suggest a rename to module.serialize().

This is following backbone convention:

model.toJSON();

But the output isn't JSON, it's javascript objects - which is even weirder when this API convention is used in other languages - when the output is even less JSON'y...

Incidentally, @matthew-andrews, I feel tempted to implement this as follows in the PHP port:

$module->serialize(); // returns associative array
$module->toJSON(); // returns JSON-encoded serialization

Even though it is misleading it's consistent with other libs... Maybe it's ok...