Closed anko closed 7 years ago
In icaro I am using standards and toJSON
[is the method](https://developer.mozilla.org/en/docs/Web/JavaScript/Reference/Global_Objects/JSON/stringify#toJSON()_behavior) JSON.stringify
uses to convert anything into a string. I don't see any reason to rename this method but thanks for asking anyway
Oh man, JavaScript's own naming is confusing. :sweat: Seeing [that](https://developer.mozilla.org/en/docs/Web/JavaScript/Reference/Global_Objects/JSON/stringify#toJSON()_behavior), I agree. It would be bad to fight the language spec.
To me, JSON means the text format that JavaScript's built-in
JSON
library is designed to operate on, withJSON.stringify
andJSON.parse
.However, calling
toJSON
on an icaro-wrapped object returns an object (not JSON), which is confusing.Could we rename it? I'd suggest
obj.toBasicObject
.