(from: From)
| 852 | } |
| 853 | |
| 854 | function deepCopyFrom(from: From): From { |
| 855 | if (from.type === `collectionRef`) { |
| 856 | return new CollectionRefClass(from.collection, from.alias) |
| 857 | } |
| 858 | |
| 859 | if (from.type === `queryRef`) { |
| 860 | return new QueryRefClass(deepCopyQuery(from.query), from.alias) |
| 861 | } |
| 862 | |
| 863 | if (from.type === `unionAll`) { |
| 864 | return new UnionAllClass( |
| 865 | from.queries.map((branch) => deepCopyQuery(branch)), |
| 866 | ) |
| 867 | } |
| 868 | |
| 869 | return new UnionFromClass( |
| 870 | from.sources.map( |
| 871 | (source: CollectionRefClass | QueryRefClass) => |
| 872 | deepCopyFrom(source) as any, |
| 873 | ), |
| 874 | ) |
| 875 | } |
| 876 | |
| 877 | function deepCopyJoinFrom( |
| 878 | from: CollectionRefClass | QueryRefClass, |
no test coverage detected