Correct usage pattern for Flatted vs JSON
mainTo maintain data integrity, you must use flatted for both serialization and deserialization. Mixing JSON.parse with flatted.stringify (or vice versa) will break circular references and data integrity.
Correct Pattern:
flatted.parse(flatted.stringify(data))
Incorrect Patterns:
JSON.parse(flatted.stringify(data))flatted.parse(JSON.stringify(data))
Note: flatted only serializes data compatible with the JSON standard. Internal classes or types not allowed by JSON will not be serialized as expected.