@@ -30,7 +30,7 @@ export async function add_item_to_channel(channel_name: string, item: ItemRecord
3030 return false
3131 }
3232
33- const channel_items : ItemRecord [ ] = channel_data [ channel_key ] || [ ]
33+ const channel_items : ItemRecord [ ] = channel_data [ channel_key ] as ItemRecord [ ] || [ ]
3434
3535 // Check if the item already exists in the channel
3636 const item_exists = channel_items . some ( existing_item => existing_item . guid === item . guid )
@@ -59,7 +59,7 @@ export async function update_item_properties(
5959 return
6060 }
6161
62- let channel_items : ItemRecord [ ] = channel_data [ channel_key ] || [ ]
62+ let channel_items : ItemRecord [ ] = channel_data [ channel_key ] as ItemRecord [ ] || [ ]
6363
6464 // Update the item properties
6565 channel_items = channel_items . map ( item => {
@@ -83,7 +83,7 @@ export async function update_item_vc_and_lvt(channel_name: string, item_guid: st
8383 return null
8484 }
8585
86- let channel_items : ItemRecord [ ] = channel_data [ channel_key ] || [ ]
86+ let channel_items : ItemRecord [ ] = channel_data [ channel_key ] as ItemRecord [ ] || [ ]
8787
8888 // Increment the view count for the specified item
8989 let updated_view_count : number | null = null
@@ -109,7 +109,7 @@ export async function increment_item_bounce_count(channel_name: string, item_gui
109109 return
110110 }
111111
112- let channel_items : ItemRecord [ ] = channel_data [ channel_key ] || [ ]
112+ let channel_items : ItemRecord [ ] = channel_data [ channel_key ] as ItemRecord [ ] || [ ]
113113
114114 // Increment the bounce count for the specified item
115115 channel_items = channel_items . map ( item => {
@@ -132,7 +132,7 @@ export async function add_revision_history_entry(channel_name: string, item_guid
132132 return [ ]
133133 }
134134
135- let channel_items : ItemRecord [ ] = channel_data [ channel_key ] || [ ]
135+ let channel_items : ItemRecord [ ] = channel_data [ channel_key ] as ItemRecord [ ] || [ ]
136136
137137 // Add the revision ID to the item's revision history
138138 let updated_rev_history : string [ ] = [ ]
@@ -159,7 +159,7 @@ export async function remove_item_from_channel(channel_name: string, item_guid:
159159 return
160160 }
161161
162- let channel_items : ItemRecord [ ] = channel_data [ channel_key ] || [ ]
162+ let channel_items : ItemRecord [ ] = channel_data [ channel_key ] as ItemRecord [ ] || [ ]
163163
164164 // Remove the item from the channel
165165 channel_items = channel_items . filter ( item => item . guid !== item_guid )
@@ -180,7 +180,7 @@ export async function add_if_not_exists(
180180 return false
181181 }
182182
183- let channel_items : ItemRecord [ ] = channel_data [ channel_key ] || [ ]
183+ let channel_items : ItemRecord [ ] = channel_data [ channel_key ] as ItemRecord [ ] || [ ]
184184
185185 // Check if the item already exists in the channel
186186 const item_exists = channel_items . some ( existing_item => existing_item . guid === item_guid )
0 commit comments