@@ -5,7 +5,7 @@ import "blob-polyfill";
55import { ReadableStream } from "web-streams-polyfill" ;
66import { LIST_STATUS } from "@models/list" ;
77import { StreamListDiff } from "@models/stream" ;
8- import { streamListDiffClient } from "." ;
8+ import { streamListDiff } from "." ;
99import prevListFile from "../../../mocks/prevList.json" ;
1010import nextListFile from "../../../mocks/nextList.json" ;
1111
@@ -18,7 +18,7 @@ describe("data emission", () => {
1818 { id : 1 , name : "Item 1" } ,
1919 { id : 2 , name : "Item 2" } ,
2020 ] ;
21- const diff = streamListDiffClient ( [ ] , nextList , "id" , { chunksSize : 2 } ) ;
21+ const diff = streamListDiff ( [ ] , nextList , "id" , { chunksSize : 2 } ) ;
2222
2323 const expectedChunks = [
2424 {
@@ -53,7 +53,7 @@ describe("data emission", () => {
5353 { id : 1 , name : "Item 1" } ,
5454 { id : 2 , name : "Item 2" } ,
5555 ] ;
56- const diff = streamListDiffClient ( prevList , [ ] , "id" , { chunksSize : 2 } ) ;
56+ const diff = streamListDiff ( prevList , [ ] , "id" , { chunksSize : 2 } ) ;
5757
5858 const expectedChunks = [
5959 {
@@ -93,7 +93,7 @@ describe("data emission", () => {
9393 { id : 2 , name : "Item 2" } ,
9494 { id : 3 , name : "Item 3" } ,
9595 ] ;
96- const diff = streamListDiffClient ( prevList , nextList , "id" ) ;
96+ const diff = streamListDiff ( prevList , nextList , "id" ) ;
9797
9898 const expectedChunks = [
9999 [
@@ -164,7 +164,7 @@ describe("data emission", () => {
164164 { id : 9 , name : "Item 9" } ,
165165 { id : 8 , name : "Item 8" } ,
166166 ] ;
167- const diff = streamListDiffClient ( prevList , nextList , "id" , {
167+ const diff = streamListDiff ( prevList , nextList , "id" , {
168168 chunksSize : 5 ,
169169 } ) ;
170170
@@ -291,7 +291,7 @@ describe("data emission", () => {
291291 { id : 5 , name : "Item 5" } ,
292292 ] ;
293293
294- const diff = streamListDiffClient ( prevList , nextList , "id" , {
294+ const diff = streamListDiff ( prevList , nextList , "id" , {
295295 chunksSize : 150 ,
296296 } ) ;
297297
@@ -362,7 +362,7 @@ describe("data emission", () => {
362362 { id : 3 , name : "Item 3" } ,
363363 { id : 5 , name : "Item 5" } ,
364364 ] ;
365- const diff = streamListDiffClient ( prevList , nextList , "id" , {
365+ const diff = streamListDiff ( prevList , nextList , "id" , {
366366 chunksSize : 5 ,
367367 considerMoveAsUpdate : true ,
368368 } ) ;
@@ -434,7 +434,7 @@ describe("data emission", () => {
434434 { id : 3 , name : "Item 3" } ,
435435 { id : 5 , name : "Item 5" } ,
436436 ] ;
437- const diff = streamListDiffClient ( prevList , nextList , "id" , {
437+ const diff = streamListDiff ( prevList , nextList , "id" , {
438438 chunksSize : 5 ,
439439 showOnly : [ "added" , "deleted" ] ,
440440 } ) ;
@@ -522,7 +522,7 @@ describe("data emission", () => {
522522 { id : 9 , name : "Item 9" } ,
523523 { id : 8 , name : "Item 8" } ,
524524 ] ;
525- const diff = streamListDiffClient ( prevList , nextList , "id" , {
525+ const diff = streamListDiff ( prevList , nextList , "id" , {
526526 chunksSize : 5 ,
527527 } ) ;
528528
@@ -751,7 +751,7 @@ describe("input handling", () => {
751751 } ,
752752 } ) ;
753753
754- const diff = streamListDiffClient ( prevStream , nextStream , "id" , {
754+ const diff = streamListDiff ( prevStream , nextStream , "id" , {
755755 chunksSize : 5 ,
756756 } ) ;
757757
@@ -775,7 +775,7 @@ describe("input handling", () => {
775775 type : "application/json" ,
776776 } ) ;
777777
778- const diff = streamListDiffClient ( prevFile , nextFile , "id" , {
778+ const diff = streamListDiff ( prevFile , nextFile , "id" , {
779779 chunksSize : 5 ,
780780 } ) ;
781781
@@ -801,7 +801,7 @@ describe("input handling", () => {
801801 type : "application/json" ,
802802 } ) ;
803803
804- const diff = streamListDiffClient ( prevStream , nextFile , "id" , {
804+ const diff = streamListDiff ( prevStream , nextFile , "id" , {
805805 chunksSize : 5 ,
806806 } ) ;
807807
@@ -824,7 +824,7 @@ describe("input handling", () => {
824824 } ,
825825 } ) ;
826826
827- const diff = streamListDiffClient ( prevStream , nextList , "id" , {
827+ const diff = streamListDiff ( prevStream , nextList , "id" , {
828828 chunksSize : 5 ,
829829 } ) ;
830830
@@ -844,7 +844,7 @@ describe("input handling", () => {
844844 type : "application/json" ,
845845 } ) ;
846846
847- const diff = streamListDiffClient ( prevFile , nextList , "id" , {
847+ const diff = streamListDiff ( prevFile , nextList , "id" , {
848848 chunksSize : 5 ,
849849 } ) ;
850850
@@ -863,7 +863,7 @@ describe("input handling", () => {
863863
864864describe ( "finish event" , ( ) => {
865865 it ( "emits 'finish' event if no prevList nor nextList is provided" , ( done ) => {
866- const diff = streamListDiffClient ( [ ] , [ ] , "id" ) ;
866+ const diff = streamListDiff ( [ ] , [ ] , "id" ) ;
867867 diff . on ( "finish" , ( ) => done ( ) ) ;
868868 } ) ;
869869 it ( "emits 'finish' event when all the chunks have been processed" , ( done ) => {
@@ -875,7 +875,7 @@ describe("finish event", () => {
875875 { id : 2 , name : "Item 2" } ,
876876 { id : 3 , name : "Item 3" } ,
877877 ] ;
878- const diff = streamListDiffClient ( prevList , nextList , "id" ) ;
878+ const diff = streamListDiff ( prevList , nextList , "id" ) ;
879879 diff . on ( "finish" , ( ) => done ( ) ) ;
880880 } ) ;
881881} ) ;
@@ -893,7 +893,7 @@ describe("error event", () => {
893893 ] ;
894894
895895 // @ts -expect-error prevList is invalid by design for the test
896- const diff = streamListDiffClient ( prevList , nextList , "id" ) ;
896+ const diff = streamListDiff ( prevList , nextList , "id" ) ;
897897
898898 diff . on ( "error" , ( err ) => {
899899 expect ( err [ "message" ] ) . toEqual (
@@ -915,7 +915,7 @@ describe("error event", () => {
915915 ] ;
916916
917917 // @ts -expect-error nextList is invalid by design for the test
918- const diff = streamListDiffClient ( prevList , nextList , "id" ) ;
918+ const diff = streamListDiff ( prevList , nextList , "id" ) ;
919919
920920 diff . on ( "error" , ( err ) => {
921921 expect ( err [ "message" ] ) . toEqual (
@@ -932,7 +932,7 @@ describe("error event", () => {
932932 { id : 2 , name : "Item 2" } ,
933933 ] ;
934934
935- const diff = streamListDiffClient ( prevList , nextList , "id" ) ;
935+ const diff = streamListDiff ( prevList , nextList , "id" ) ;
936936
937937 diff . on ( "error" , ( err ) => {
938938 expect ( err [ "message" ] ) . toEqual (
@@ -949,7 +949,7 @@ describe("error event", () => {
949949 ] ;
950950 const nextList = [ { id : 1 , name : "Item 1" } , { name : "Item 2" } ] ;
951951
952- const diff = streamListDiffClient ( prevList , nextList , "id" ) ;
952+ const diff = streamListDiff ( prevList , nextList , "id" ) ;
953953
954954 diff . on ( "error" , ( err ) => {
955955 expect ( err [ "message" ] ) . toEqual (
@@ -966,7 +966,7 @@ describe("error event", () => {
966966 ] ;
967967 const nextList = [ { id : 1 , name : "Item 1" } , { name : "Item 2" } ] ;
968968
969- const diff = streamListDiffClient ( prevList , nextList , "id" , {
969+ const diff = streamListDiff ( prevList , nextList , "id" , {
970970 chunksSize : - 3 ,
971971 } ) ;
972972
@@ -982,7 +982,7 @@ describe("error event", () => {
982982 const nextList = [ { id : 1 , name : "Item 1" } , { name : "Item 2" } ] ;
983983
984984 // @ts -expect-error - prevList is invalid by design for the test
985- const diff = streamListDiffClient ( { name : "hello" } , nextList , "id" ) ;
985+ const diff = streamListDiff ( { name : "hello" } , nextList , "id" ) ;
986986
987987 diff . on ( "error" , ( err ) => {
988988 expect ( err [ "message" ] ) . toEqual (
@@ -995,7 +995,7 @@ describe("error event", () => {
995995 const prevList = [ { id : 1 , name : "Item 1" } , { name : "Item 2" } ] ;
996996
997997 // @ts -expect-error - nextList is invalid by design for the test
998- const diff = streamListDiffClient ( prevList , null , "id" ) ;
998+ const diff = streamListDiff ( prevList , null , "id" ) ;
999999
10001000 diff . on ( "error" , ( err ) => {
10011001 expect ( err [ "message" ] ) . toEqual (
@@ -1025,7 +1025,7 @@ describe("performance", () => {
10251025 nextList [ 20_000 ] . value = "updated-value-20000" ; // Another updated entry
10261026 nextList . push ( { id : numEntries , value : `new-value-${ numEntries } ` } ) ; // 1 added entry
10271027
1028- const diffListener = streamListDiffClient < { id : number ; value : string } > (
1028+ const diffListener = streamListDiff < { id : number ; value : string } > (
10291029 prevList ,
10301030 nextList ,
10311031 "id" ,
0 commit comments