(source: Document)
| 26 | * ``` |
| 27 | */ |
| 28 | export function cloneDocument(source: Document): Document { |
| 29 | const target = new Document().setLogger(source.getLogger()); |
| 30 | const resolve = createDefaultPropertyResolver(target, source); |
| 31 | mergeDocuments(target, source, resolve); |
| 32 | |
| 33 | // Root properties (name, asset, default scene, extras) are not overwritten by |
| 34 | // mergeDocuments(), and should be explicitly copied when cloning. |
| 35 | // biome-ignore lint/suspicious/noExplicitAny: TODO |
| 36 | target.getRoot().copy(source.getRoot(), resolve as any); |
| 37 | |
| 38 | return target; |
| 39 | } |
| 40 | |
| 41 | /** |
| 42 | * Merges contents of source {@link Document} into target Document, without |
no test coverage detected