File tree Expand file tree Collapse file tree 2 files changed +5
-3
lines changed Expand file tree Collapse file tree 2 files changed +5
-3
lines changed Original file line number Diff line number Diff line change @@ -129,6 +129,9 @@ export type Hit<T = Record<string, any>> = T & {
129129
130130export type Hits < T = Record < string , any > > = Array < Hit < T > >
131131
132+ export type FacetStat = { min : number ; max : number }
133+ export type FacetStats = Record < string , FacetStat >
134+
132135export type SearchResponse <
133136 T = Record < string , any > ,
134137 S extends SearchParams | undefined = undefined
@@ -137,7 +140,7 @@ export type SearchResponse<
137140 processingTimeMs : number
138141 facetDistribution ?: FacetDistribution
139142 query : string
140- facetStats ?: Record < string , { min ?: number ; max ?: number } >
143+ facetStats ?: FacetStats
141144} & ( undefined extends S
142145 ? Partial < FinitePagination & InfinitePagination >
143146 : true extends IsFinitePagination < NonNullable < S > >
Original file line number Diff line number Diff line change @@ -515,8 +515,7 @@ describe.each([
515515 id : { '123' : 1 , '2' : 1 } ,
516516 } )
517517
518- expect ( response ) . toHaveProperty ( 'facetStats' , { id : { min : 2 , max : 123 } } )
519- expect ( response . facetStats ?. [ 'id' ] ?. min ) . toBe ( 2 )
518+ expect ( response . facetStats ) . toEqual ( { id : { min : 2 , max : 123 } } )
520519 expect ( response . facetStats ?. [ 'id' ] ?. max ) . toBe ( 123 )
521520 expect ( response ) . toHaveProperty ( 'hits' , expect . any ( Array ) )
522521 expect ( response . hits . length ) . toEqual ( 2 )
You can’t perform that action at this time.
0 commit comments