@@ -81,7 +81,6 @@ export class FilterBase {
8181 : undefined ,
8282 } ) ;
8383 }
84-
8584 let target = this . target ;
8685 while ( target . target !== undefined ) {
8786 if ( TargetGuards . isTargetRef ( target . target ) ) {
@@ -222,32 +221,32 @@ export class FilterRef<T> implements Filter<T> {
222221
223222 public byRef < K extends RefKeys < T > & string > ( linkOn : K ) : Filter < ExtractCrossReferenceType < T [ K ] > > {
224223 this . target . target = { type_ : 'single' , linkOn : linkOn } ;
225- return new FilterRef < ExtractCrossReferenceType < T [ K ] > > ( this . target ) ;
224+ return new FilterRef < ExtractCrossReferenceType < T [ K ] > > ( Object . assign ( { } , this . target ) ) ;
226225 }
227226
228227 public byRefMultiTarget < K extends RefKeys < T > & string > ( linkOn : K , targetCollection : string ) {
229228 this . target . target = { type_ : 'multi' , linkOn : linkOn , targetCollection : targetCollection } ;
230- return new FilterRef < ExtractCrossReferenceType < T [ K ] > > ( this . target ) ;
229+ return new FilterRef < ExtractCrossReferenceType < T [ K ] > > ( Object . assign ( { } , this . target ) ) ;
231230 }
232231
233232 public byProperty < K extends NonRefKeys < T > & string > ( name : K , length = false ) {
234- return new FilterProperty < T [ K ] > ( name , length , this . target ) ;
233+ return new FilterProperty < T [ K ] > ( name , length , Object . assign ( { } , this . target ) ) ;
235234 }
236235
237236 public byRefCount < K extends RefKeys < T > & string > ( linkOn : K ) {
238- return new FilterCount ( linkOn , this . target ) ;
237+ return new FilterCount ( linkOn , Object . assign ( { } , this . target ) ) ;
239238 }
240239
241240 public byId ( ) {
242- return new FilterId ( this . target ) ;
241+ return new FilterId ( Object . assign ( { } , this . target ) ) ;
243242 }
244243
245244 public byCreationTime ( ) {
246- return new FilterCreationTime ( this . target ) ;
245+ return new FilterCreationTime ( Object . assign ( { } , this . target ) ) ;
247246 }
248247
249248 public byUpdateTime ( ) {
250- return new FilterUpdateTime ( this . target ) ;
249+ return new FilterUpdateTime ( Object . assign ( { } , this . target ) ) ;
251250 }
252251}
253252
0 commit comments