File tree Expand file tree Collapse file tree 1 file changed +15
-8
lines changed
packages/store/node-server-sdk-redis/src Expand file tree Collapse file tree 1 file changed +15
-8
lines changed Original file line number Diff line number Diff line change @@ -112,14 +112,21 @@ export default class RedisCore implements interfaces.PersistentDataStore {
112112 }
113113
114114 #prepareArray( values : Record < string , string > ) {
115- const results : interfaces . KeyedItem < string , interfaces . SerializedItemDescriptor > [ ] = [ ] ;
116- Object . keys ( values ) . forEach ( ( key ) => {
117- const value = values [ key ] ;
118- // When getting we do not populate version and deleted.
119- // The SDK will have to deserialize to access these values.
120- results . push ( { key, item : { version : 0 , deleted : false , serializedItem : value } } ) ;
121- } ) ;
122- return results ;
115+ const keys = Object . keys ( values ) ;
116+ const results : interfaces . KeyedItem < string , interfaces . SerializedItemDescriptor > [ ] = new Array (
117+ keys . length ,
118+ ) ;
119+ return keys . reduce ( ( acc , key , index ) => {
120+ acc [ index ] = {
121+ key,
122+ item : {
123+ version : 0 ,
124+ deleted : false ,
125+ serializedItem : values [ key ] ,
126+ } ,
127+ } ;
128+ return acc ;
129+ } , results ) ;
123130 }
124131
125132 #useItemsFromCodefresh(
You can’t perform that action at this time.
0 commit comments