Replace JSON.parse/stringify deep clone with structuredClone() #14
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Problem: DeparturesManager.displayDepartures() used JSON.parse(JSON.stringify(departures)) to deep clone departure data. This is slow and loses Date objects, undefined values, and other non-JSON types.
Solution: Replaced with structuredClone(departures) which is the modern browser/Node API for deep cloning that preserves all object types.
Files changed: