This repository was archived by the owner on Jun 25, 2025. It is now read-only.
File tree Expand file tree Collapse file tree 3 files changed +19
-2
lines changed Expand file tree Collapse file tree 3 files changed +19
-2
lines changed Original file line number Diff line number Diff line change 11{
22 "name" : " apisearch" ,
3- "version" : " 0.2.6 " ,
3+ "version" : " 0.2.7 " ,
44 "description" : " Javascript client for Apisearch." ,
55 "main" : " lib/index.js" ,
66 "types" : " lib/index.d.ts" ,
Original file line number Diff line number Diff line change @@ -1182,7 +1182,7 @@ export class Query {
11821182 for ( const i in this . itemsPromoted ) {
11831183 array
11841184 . items_promoted
1185- . push ( this . itemsPromoted [ i ] . toArray ) ;
1185+ . push ( this . itemsPromoted [ i ] . toArray ( ) ) ;
11861186 }
11871187 }
11881188
Original file line number Diff line number Diff line change @@ -330,6 +330,23 @@ describe('Query()', () => {
330330 type : 'marvel'
331331 } ) ;
332332 } ) ;
333+
334+ it ( 'should work properly when doing toArray' , ( ) => {
335+ // Promote thi two uuids into an existing array from the last test
336+ query . promoteUUIDs (
337+ new ItemUUID ( 'ironman' , 'marvel' ) ,
338+ new ItemUUID ( 'thor' , 'marvel' )
339+ ) ;
340+ expect ( query . toArray ( ) . items_promoted . length ) . to . equal ( 2 ) ;
341+ expect ( query . toArray ( ) . items_promoted [ 0 ] ) . to . deep . equal ( {
342+ id : 'ironman' ,
343+ type : 'marvel'
344+ } ) ;
345+ expect ( query . toArray ( ) . items_promoted [ 1 ] ) . to . deep . equal ( {
346+ id : 'thor' ,
347+ type : 'marvel'
348+ } ) ;
349+ } ) ;
333350 } ) ;
334351
335352 describe ( '-> When excluding uuids' , ( ) => {
You can’t perform that action at this time.
0 commit comments