as-json
as-json copied to clipboard
JSON serialization/deserialization for AssemblyScript
Hi, would it be possible to please also allow `@serializable` besides / instead of `@json` ? @serializable is more generic (similar to rust) and would also make class declarations compatible...
Currently additional properties in the incoming JSON are ignored. It would be useful to throw an error when additional properties are encountered. For example: ``` // The entry file of...
It would be very useful for some use cases to support serialisation / deserialisation of heterogeneous arrays (via type inheritance). For example: ``` @json abstract class Animal { name!: string;...
The [as-variant](https://github.com/MaxGraey/as-variant) library is a dependency: https://github.com/JairusSW/as-json/blob/49158541030dc90358ccfb02f01980453f8205bf/package.json#L46-L50 But it's not used in any code. An attempt to serialize a variant: ```ts const v = Variant.from(123); const s = JSON.stringify(v); ```...
Boyer-Moore becomes faster for longer strings. Massive datasets can be parsed with less than `O(n)`
If serialization or deserialization fails, this library throws an error. In other languages this would be fine, because you could use try/catch to handle the error. Unfortunately, AssemblyScript doesn't yet...
One feature that comparable libraries such as serde for Rust offer, is the ability to flatten inner objects. This would be a nice addition for as-json. From usage perspective, this...
I am trying out below code which has some imports which gets length prefixed strings from memory. These host native imports implementation is closed. Below is the code ```typescript import...