Skip to content

Commit

Permalink
Fix llisting type errors
Browse files Browse the repository at this point in the history
  • Loading branch information
ThatGuySam committed Mar 18, 2024
1 parent 5fdc30b commit 8f28021
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/helpers/listing.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
import type { deepmergeCustom } from 'deepmerge-ts'
import type { Listing } from './types.ts'

type DeepMergeConfig = Parameters<typeof deepmergeCustom>[0]

export function hasLogo ( listing: Listing ) {
return listing?.logo_on_black
}
Expand Down Expand Up @@ -88,8 +91,8 @@ export function convertNullValuesForAstro ( listings: Listing[] ) {
} )
}

export const listingMergeConfig = {
mergeArrays: ( values: Array<any> ) => {
export const listingMergeConfig: DeepMergeConfig = {
mergeArrays: ( values ) => {
// Use Set to merge arrays
// so that duplicates are removed
return Array.from( new Set( values.flat() ) )
Expand Down

0 comments on commit 8f28021

Please sign in to comment.