MCPcopy Index your code
hub / github.com/TanStack/db / deepCopyFrom

Function deepCopyFrom

packages/db/src/query/optimizer.ts:854–875  ·  view source on GitHub ↗
(from: From)

Source from the content-addressed store, hash-verified

852}
853
854function 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
877function deepCopyJoinFrom(
878 from: CollectionRefClass | QueryRefClass,

Callers 2

deepCopyQueryFunction · 0.85
deepCopyJoinFromFunction · 0.85

Calls 2

deepCopyQueryFunction · 0.85
mapMethod · 0.45

Tested by

no test coverage detected