Adds an optional clone method to the FormatPlugin interface. This method is used to clone the object returned by read before passing it to update. This is useful when the object returned by read is not trivially cloneable.
One use case is when trying to preserve comments in a JSONC file using the comment-json package, which uses symbol properties on the object to store comments. The default clone method would not preserve these symbol properties, so a custom clone method is needed.
Adds an optional
clone
method to theFormatPlugin
interface. This method is used to clone the object returned byread
before passing it toupdate
. This is useful when the object returned byread
is not trivially cloneable.One use case is when trying to preserve comments in a JSONC file using the
comment-json
package, which uses symbol properties on the object to store comments. The defaultclone
method would not preserve these symbol properties, so a customclone
method is needed.Fixes #10