@@ -49,7 +49,17 @@ import {
4949} from '../core/view/EventRegistration' ;
5050
5151import { Repo } from '../core/Repo' ;
52- import { QueryParams } from '../core/view/QueryParams' ;
52+ import {
53+ QueryParams ,
54+ queryParamsLimitToFirst ,
55+ queryParamsLimitToLast ,
56+ queryParamsStartAfter ,
57+ queryParamsStartAt ,
58+ queryParamsEndAt ,
59+ queryParamsEndBefore ,
60+ queryParamsGetQueryObject ,
61+ queryParamsOrderBy
62+ } from '../core/view/QueryParams' ;
5363import { Reference } from './Reference' ;
5464import { DataSnapshot } from './DataSnapshot' ;
5565
@@ -355,7 +365,7 @@ export class Query {
355365 return new Query (
356366 this . repo ,
357367 this . path ,
358- this . queryParams_ . limitToFirst ( limit ) ,
368+ queryParamsLimitToFirst ( this . queryParams_ , limit ) ,
359369 this . orderByCalled_
360370 ) ;
361371 }
@@ -384,7 +394,7 @@ export class Query {
384394 return new Query (
385395 this . repo ,
386396 this . path ,
387- this . queryParams_ . limitToLast ( limit ) ,
397+ queryParamsLimitToLast ( this . queryParams_ , limit ) ,
388398 this . orderByCalled_
389399 ) ;
390400 }
@@ -416,7 +426,7 @@ export class Query {
416426 ) ;
417427 }
418428 const index = new PathIndex ( parsedPath ) ;
419- const newParams = this . queryParams_ . orderBy ( index ) ;
429+ const newParams = queryParamsOrderBy ( this . queryParams_ , index ) ;
420430 Query . validateQueryEndpoints_ ( newParams ) ;
421431
422432 return new Query ( this . repo , this . path , newParams , /*orderByCalled=*/ true ) ;
@@ -428,7 +438,7 @@ export class Query {
428438 orderByKey ( ) : Query {
429439 validateArgCount ( 'Query.orderByKey' , 0 , 0 , arguments . length ) ;
430440 this . validateNoPreviousOrderByCall_ ( 'Query.orderByKey' ) ;
431- const newParams = this . queryParams_ . orderBy ( KEY_INDEX ) ;
441+ const newParams = queryParamsOrderBy ( this . queryParams_ , KEY_INDEX ) ;
432442 Query . validateQueryEndpoints_ ( newParams ) ;
433443 return new Query ( this . repo , this . path , newParams , /*orderByCalled=*/ true ) ;
434444 }
@@ -439,7 +449,7 @@ export class Query {
439449 orderByPriority ( ) : Query {
440450 validateArgCount ( 'Query.orderByPriority' , 0 , 0 , arguments . length ) ;
441451 this . validateNoPreviousOrderByCall_ ( 'Query.orderByPriority' ) ;
442- const newParams = this . queryParams_ . orderBy ( PRIORITY_INDEX ) ;
452+ const newParams = queryParamsOrderBy ( this . queryParams_ , PRIORITY_INDEX ) ;
443453 Query . validateQueryEndpoints_ ( newParams ) ;
444454 return new Query ( this . repo , this . path , newParams , /*orderByCalled=*/ true ) ;
445455 }
@@ -450,7 +460,7 @@ export class Query {
450460 orderByValue ( ) : Query {
451461 validateArgCount ( 'Query.orderByValue' , 0 , 0 , arguments . length ) ;
452462 this . validateNoPreviousOrderByCall_ ( 'Query.orderByValue' ) ;
453- const newParams = this . queryParams_ . orderBy ( VALUE_INDEX ) ;
463+ const newParams = queryParamsOrderBy ( this . queryParams_ , VALUE_INDEX ) ;
454464 Query . validateQueryEndpoints_ ( newParams ) ;
455465 return new Query ( this . repo , this . path , newParams , /*orderByCalled=*/ true ) ;
456466 }
@@ -463,7 +473,7 @@ export class Query {
463473 validateFirebaseDataArg ( 'Query.startAt' , 1 , value , this . path , true ) ;
464474 validateKey ( 'Query.startAt' , 2 , name , true ) ;
465475
466- const newParams = this . queryParams_ . startAt ( value , name ) ;
476+ const newParams = queryParamsStartAt ( this . queryParams_ , value , name ) ;
467477 Query . validateLimit_ ( newParams ) ;
468478 Query . validateQueryEndpoints_ ( newParams ) ;
469479 if ( this . queryParams_ . hasStart ( ) ) {
@@ -490,7 +500,7 @@ export class Query {
490500 validateFirebaseDataArg ( 'Query.startAfter' , 1 , value , this . path , false ) ;
491501 validateKey ( 'Query.startAfter' , 2 , name , true ) ;
492502
493- const newParams = this . queryParams_ . startAfter ( value , name ) ;
503+ const newParams = queryParamsStartAfter ( this . queryParams_ , value , name ) ;
494504 Query . validateLimit_ ( newParams ) ;
495505 Query . validateQueryEndpoints_ ( newParams ) ;
496506 if ( this . queryParams_ . hasStart ( ) ) {
@@ -511,7 +521,7 @@ export class Query {
511521 validateFirebaseDataArg ( 'Query.endAt' , 1 , value , this . path , true ) ;
512522 validateKey ( 'Query.endAt' , 2 , name , true ) ;
513523
514- const newParams = this . queryParams_ . endAt ( value , name ) ;
524+ const newParams = queryParamsEndAt ( this . queryParams_ , value , name ) ;
515525 Query . validateLimit_ ( newParams ) ;
516526 Query . validateQueryEndpoints_ ( newParams ) ;
517527 if ( this . queryParams_ . hasEnd ( ) ) {
@@ -532,7 +542,7 @@ export class Query {
532542 validateFirebaseDataArg ( 'Query.endBefore' , 1 , value , this . path , false ) ;
533543 validateKey ( 'Query.endBefore' , 2 , name , true ) ;
534544
535- const newParams = this . queryParams_ . endBefore ( value , name ) ;
545+ const newParams = queryParamsEndBefore ( this . queryParams_ , value , name ) ;
536546 Query . validateLimit_ ( newParams ) ;
537547 Query . validateQueryEndpoints_ ( newParams ) ;
538548 if ( this . queryParams_ . hasEnd ( ) ) {
@@ -589,7 +599,7 @@ export class Query {
589599 * An object representation of the query parameters used by this Query.
590600 */
591601 queryObject ( ) : object {
592- return this . queryParams_ . getQueryObject ( ) ;
602+ return queryParamsGetQueryObject ( this . queryParams_ ) ;
593603 }
594604
595605 queryIdentifier ( ) : string {
0 commit comments