It seems ko.mapping.toJSON
is calling stringifyJson: function (data, replacer, space)
behind the closed doors, but it doesn't allow the caller to pass the optional params (replacer
and space
) so they can be passed along to stringifyJson
.
Is there another overload or am I missing the whole point?
The actual story:
I am using ko.mapping.toJSON
to json stringify
my view model for sending back to server, which it does perfectly as it ignore all other properties that didn't came from store/db.
But I want to tweak it a little to save some KB
's by leaving out null
values.