-
Notifications
You must be signed in to change notification settings - Fork 9
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
User provided prototype encoder/decoders lack API #6
Comments
Generally objects are attempted to be collected entirely themselves; objects which have references will always be valid within the JSOX context itself without external reviver support; although an external reviver that does a value replacement should include the original objects from JSOX. typed-arraythe values in the array are all gathered until the closing arrayType[...] typed stringRecall that any non-control characters/non number leadin type value is a valid string without quotes... string string2
"another example" "parameter"
// another common example [ object Object ]
// the previous failes unless there is a type called 'object' registered.
// If there is no reviver registered, string-string class definitions will throw a value 'Double String s....' something. There's no way to make a prototype object dynamically, and is really a fault at conversion of the value into a JS value. typed objectsObjects are created initially with The last time the type revive callback is called, the field is passed as |
Updated readme with notes... should refer to tests and others in the area |
Internally there's support for the 'map' type.
This type looks a lot like any other object to JS; and can recursively encode itself using the same stringifier, which allows objects in the map to reference other objects, or be references for other objects, however, if this was implemented purely as a user-side method, it would lack the ability to put itself as a path member in the path array that tracks the current branch of the object. Objects encoded within this which are references will lack the contents of the object.
So, user objects which are circular maybe have issues.
This could have been solved in the map by encoding the content of the map object using a different stringifier(and different parser on the other side) so that the base of the references in that will be within the map-type object itself, however, this would prevent members of the map from referencing objects outside the map...
So probably some hooks should be added to the API to allow this; ATM I don't know what the shape of those will be.
The text was updated successfully, but these errors were encountered: