When parsing then creating a component will be mutated. This means if you wish to parse pull out some data but save the original structure you have to call toJSON on the component to create a clean copy.
I think we could clone? The original objects so we don't mutate them during component creation I don't have a test case for this I merely observed it while writing some tests for my gaia code.
We changed this behavior sightly in Componentv2 so it intentionally mutations the objects but keeps them compatible with jCal so its the best of both worlds.
When parsing then creating a component will be mutated. This means if you wish to parse pull out some data but save the original structure you have to call
toJSON
on the component to create a clean copy.I think we could clone? The original objects so we don't mutate them during component creation I don't have a test case for this I merely observed it while writing some tests for my gaia code.