Skip to content

Commit

Permalink
Fix categories type
Browse files Browse the repository at this point in the history
  • Loading branch information
bartelink committed Sep 28, 2023
1 parent 76f9966 commit 1e71a67
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/Propulsion.Feed/FeedSource.fs
Original file line number Diff line number Diff line change
Expand Up @@ -327,9 +327,9 @@ type SinglePassFeedSource
module Categories =
let startsWith (p: string) (s: FsCodec.StreamName) = (FsCodec.StreamName.toString s).StartsWith(p)

let categoryFilter categories =
let prefixes = Array.map (fun x -> startsWith $"{x}-") categories
fun (x: FsCodec.StreamName) -> Array.exists (fun f -> f x) prefixes
let categoryFilter (categories: string[]) =
let prefixes = categories |> Array.map startsWith
fun (x: FsCodec.StreamName) -> prefixes |> Array.exists (fun f -> f x)

let mapFilters categories streamFilter =
match categories, streamFilter with
Expand All @@ -338,7 +338,7 @@ module Categories =
| None, Some (filter: Func<_, bool>) -> filter.Invoke
| Some categories, Some filter ->
let categoryFilter = categoryFilter categories
fun x -> categoryFilter x && filter.Invoke x
fun x -> categoryFilter x && filter.Invoke x

namespace Propulsion.Feed

Expand Down

0 comments on commit 1e71a67

Please sign in to comment.